Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: console.openshift.io/v1
kind: ConsoleYAMLSample
metadata:
name: cert-manager-acme-issuer-sample
spec:
description: An example ACME Issuer for Let's Encrypt production certificates with
HTTP-01 challenge
targetResource:
apiVersion: cert-manager.io/v1
kind: Issuer
title: Example ACME Issuer (Let's Encrypt)
yaml: |-
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-prod
namespace: default
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-prod-account-key
solvers:
- http01:
ingress:
ingressClassName: openshift-default
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: console.openshift.io/v1
kind: ConsoleYAMLSample
metadata:
name: cert-manager-certificate-sample
spec:
description: A simple Certificate example
targetResource:
apiVersion: cert-manager.io/v1
kind: Certificate
title: Example Certificate
yaml: |-
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-cert
namespace: default
spec:
secretName: example-tls
commonName: example.com
dnsNames:
- example.com
issuerRef:
name: selfsigned-issuer
kind: Issuer
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
apiVersion: console.openshift.io/v1
kind: ConsoleQuickStart
metadata:
annotations:
capability.openshift.io/name: Console
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: cert-manager-example
spec:
conclusion: |-
Great job! You've successfully created your first Issuer and Certificate.

### Next Steps:

- For production, use Let's Encrypt (ACME Issuer) instead of self-signed certificates
- Explore ClusterIssuer for cluster-wide certificate management
- Check out the [cert-manager documentation](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/security_and_compliance/cert-manager-operator-for-red-hat-openshift) to learn more
description: Create and issue TLS certificates using the cert-manager Operator for
Red Hat OpenShift
displayName: cert-manager Operator for Red Hat OpenShift Example
durationMinutes: 10
introduction: |-
# cert-manager Operator for Red Hat OpenShift

The cert-manager Operator for Red Hat OpenShift enables you to create and sign TLS certificates from an external PKI for your workloads
running on an OpenShift cluster.

### Expected Learning

With this Quick Start, you will learn about the following CRDs provided by the cert-manager operator:
1. **Issuer** - defines a certificate authority that can sign certificates
2. **Certificate** - defines the desired certificate and its properties

This Quick Start will walk you through creating your first certificate:
- Create a self-signed Issuer (for testing)
- Create a Certificate signed by that Issuer
- View the generated certificate in a Kubernetes Secret
- Learn how to use it in your applications

**Note**: For production, you would use Let's Encrypt (ACME), HashiCorp Vault, or your organization's CA instead of self-signed certificates.
prerequisites:
- You completed the "Install the cert-manager Operator for Red Hat OpenShift" quick
start.
- You have a namespace in which to deploy the example CRs.
tags:
- example
- operator
- certificates
tasks:
- description: |-
### To navigate to the installed operator:
1. Go to the **Installed Operators** from the [Ecosystem]{{highlight qs-nav-ecosystem}} section of the navigation.
2. In the **Search by name** field, type `cert-manager`.
3. Look for **cert-manager Operator for Red Hat OpenShift**. If you had completed the prerequisite Quick Start, the tile should appear.
4. Click on the installed operator

You will be brought to the **Operator Details** page and be presented with **Provided APIs**
review:
failedTaskHelp: This task isn't verified yet. Try the task again.
instructions: |-
#### Verify you see a list of **Provided APIs**:
The list should include `Issuer`, `ClusterIssuer`, and `Certificate`
summary:
failed: Try the steps again.
success: You are in the right place, and ready to start the rest of the Quick
Start
title: Navigate to installed cert-manager operator
- description: |-
### Create or select a project to work in
1. Find the **Project** dropdown menu at the top of the screen.
2. Select or create the project in which you want to work in.

**Note**: For this example, we'll create an `Issuer` which is namespace-scoped. If you want to issue certificates
across multiple namespaces, you can create a `ClusterIssuer` instead.
review:
failedTaskHelp: Try the task again.
instructions: '#### Verify the name in the **Project** dropdown menu is the
expected project'
summary:
failed: Try the steps again.
success: You are in the right place.
title: Select a project
- description: |-
### To create a self-signed Issuer

An Issuer represents a certificate authority that can sign certificates. We'll create a self-signed Issuer
for this example. This is useful for testing and development.

1. Find the `Issuer` Custom Resource in the list of **Provided APIs** or in the top side-scrolling menu bar.
- From the list of **Provided APIs**, click the **Create instance** link.
- From the **top side-scrolling menu bar**, click **Issuer** and then click **Create Issuer**.

2. Switch to **YAML view** in the editor.

3. On the right sidebar, look for the **Samples** section and select **"Example Self-Signed Issuer"**.

4. Click **Try it** to populate the editor with the sample YAML.

5. Click the **Create** button to create the Issuer.
review:
failedTaskHelp: This task isn't verified yet. Try the task again.
instructions: |-
#### Verify the Issuer was successfully created:
1. You should see the Issuer listed with the name `selfsigned-issuer`
2. Check that the **Ready** condition shows **True** in the Conditions section
summary:
failed: Try the steps again.
success: You just created a self-signed Issuer! Now we can create certificates.
title: Create a self-signed Issuer
- description: |-
### To create a Certificate

Now we'll create a certificate that will be signed by our Issuer.

1. Find the `Certificate` Custom Resource in the list of **Provided APIs** or in the top side-scrolling menu bar.
- From the list of **Provided APIs**, click the **Create instance** link.
- From the **top side-scrolling menu bar**, click **Certificate** and then click **Create Certificate**.

2. Switch to **YAML view** in the editor.

3. On the right sidebar, look for the **Samples** section and select **"Example Certificate"**.

4. Click **Try it** to populate the editor with the sample YAML.

5. Click the **Create** button to create the Certificate.
review:
failedTaskHelp: This task isn't verified yet. Try the task again.
instructions: |-
#### Verify the Certificate was successfully created:
1. You should see the Certificate listed with the name `example-cert`.
2. Check that the **Ready** condition shows **True**.
3. Navigate to the [Workloads]{{highlight qs-nav-workloads}} section and click **Secrets**
4. You should see a new Secret named `example-tls`.
summary:
failed: Try the steps again.
success: You just created your first certificate! cert-manager has issued it
and stored it in a Secret.
title: Create a Certificate
- description: |-
### To inspect the certificate

Let's look at the Secret that contains the certificate.

1. Make sure you're in the [Workloads]{{highlight qs-nav-workloads}} section, click **Secrets**.
2. Click on the **example-tls** Secret.
3. You should see the certificate data with keys:
- `tls.crt` - The certificate.
- `tls.key` - The private key.
- `ca.crt` - The CA certificate.
review:
failedTaskHelp: This task isn't verified yet. Try the task again.
instructions: |-
#### Verify you can see the certificate data:
Is the Secret `example-tls` present with `tls.crt` and `tls.key`?
summary:
failed: Try the steps again.
success: Great! Your certificate is ready to use.
title: View the certificate
- description: |-
### How to use certificates

Now you can use this certificate in your applications. Here's a simple example for an OpenShift Route:

```yaml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: my-app
spec:
to:
kind: Service
name: my-service
tls:
termination: edge
externalCertificate:
name: example-tls
```

Or in an Ingress:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app
spec:
tls:
- secretName: example-tls
rules:
- host: example.com
```

**Note**: cert-manager will automatically renew certificates before they expire!
review:
failedTaskHelp: Review the examples above.
instructions: |-
#### Do you understand how to use certificates?
Certificates can be referenced in Routes and Ingress resources.
summary:
failed: Review the examples again.
success: You now know how to create and use certificates!
title: Use the certificate
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: console.openshift.io/v1
kind: ConsoleYAMLSample
metadata:
name: cert-manager-issuer-sample
spec:
description: A simple self-signed Issuer for development and testing
targetResource:
apiVersion: cert-manager.io/v1
kind: Issuer
title: Example Self-Signed Issuer
yaml: |-
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: default
spec:
selfSigned: {}
25 changes: 25 additions & 0 deletions config/console/cert-manager-acme-issuer-sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: console.openshift.io/v1
kind: ConsoleYAMLSample
metadata:
name: cert-manager-acme-issuer-sample
spec:
targetResource:
apiVersion: cert-manager.io/v1
kind: Issuer
title: Example ACME Issuer (Let's Encrypt)
description: An example ACME Issuer for Let's Encrypt production certificates with HTTP-01 challenge
yaml: |-
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-prod
namespace: default
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-prod-account-key
solvers:
- http01:
ingress:
ingressClassName: openshift-default
Comment on lines +18 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

ACME Issuer sample missing required contact field.

Let's Encrypt's ACME requires a contact field with an email address for account registration. The current sample omits this, causing the resource to fail with an ACME account registration error when applied. Past reviews identified an example.com placeholder email caused validation errors; rather than removing it entirely, the field needs to be present with valid guidance.

Add the contact field to the ACME spec:

     spec:
       acme:
         server: https://acme-v02.api.letsencrypt.org/directory
+        contact:
+        - mailto:admin@example.com
         privateKeySecretRef:
           name: letsencrypt-prod-account-key
         solvers:

Alternatively, update the description to explicitly instruct users to replace the email placeholder:

-  description: An example ACME Issuer for Let's Encrypt production certificates with HTTP-01 challenge
+  description: An example ACME Issuer for Let's Encrypt production certificates with HTTP-01 challenge. Update the contact email before applying.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
acme:
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-prod-account-key
solvers:
- http01:
ingress:
ingressClassName: openshift-default
acme:
server: https://acme-v02.api.letsencrypt.org/directory
contact:
- mailto:admin@example.com
privateKeySecretRef:
name: letsencrypt-prod-account-key
solvers:
- http01:
ingress:
ingressClassName: openshift-default
🤖 Prompt for AI Agents
In config/console/cert-manager-acme-issuer-sample.yaml around lines 18 to 25,
the ACME issuer spec is missing the required contact field; add a contact entry
under acme using the mailto: format (e.g. contact: ["mailto:ops@example.com"])
and include a comment or replaceable placeholder instructing users to put a real
email address for account registration and not to leave the example value as-is;
ensure the contact field is an array of mailto strings so cert-manager/Let's
Encrypt can register the ACME account successfully.

25 changes: 25 additions & 0 deletions config/console/cert-manager-certificate-sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: console.openshift.io/v1
kind: ConsoleYAMLSample
metadata:
name: cert-manager-certificate-sample
spec:
targetResource:
apiVersion: cert-manager.io/v1
kind: Certificate
title: Example Certificate
description: A simple Certificate example
yaml: |-
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-cert
namespace: default
spec:
secretName: example-tls
commonName: example.com
dnsNames:
- example.com
issuerRef:
name: selfsigned-issuer
kind: Issuer

Loading