Created
November 12, 2023 21:04
-
-
Save jshbrntt/c9fe3c385957f0fa903ae60f3bbc5d1d to your computer and use it in GitHub Desktop.
Kubernetes: Example HTTPS Certificate Resources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: cert-manager.io/v1 | |
kind: ClusterIssuer | |
metadata: | |
name: letsencrypt-staging | |
spec: | |
acme: | |
# Change this to your email to receive notifications about the HTTPS certificate | |
email: user@example.com | |
privateKeySecretRef: | |
name: letsencrypt-staging-issuer-account-key | |
server: https://acme-staging-v02.api.letsencrypt.org/directory | |
solvers: | |
- http01: | |
ingress: | |
class: nginx | |
--- | |
apiVersion: cert-manager.io/v1 | |
kind: ClusterIssuer | |
metadata: | |
name: letsencrypt-prod | |
spec: | |
acme: | |
# Change this to your email to receive notifications about the HTTPS certificate | |
email: user@example.com | |
privateKeySecretRef: | |
name: letsencrypt-prod-issuer-account-key | |
server: https://acme-v02.api.letsencrypt.org/directory | |
solvers: | |
- http01: | |
ingress: | |
class: nginx | |
--- | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
annotations: | |
# Use the staging issuer first to test it is working, then switch to prod | |
# cert-manager.io/cluster-issuer: letsencrypt-staging | |
cert-manager.io/cluster-issuer: letsencrypt-prod | |
kubernetes.io/tls-acme: "true" | |
name: helloworld | |
spec: | |
ingressClassName: nginx | |
rules: | |
- host: helloworld.10.0.0.1.nip.io | |
http: | |
paths: | |
- backend: | |
service: | |
name: helloworld | |
port: | |
number: 8080 | |
path: / | |
pathType: Prefix | |
tls: | |
- hosts: | |
- helloworld.10.0.0.1.nip.io | |
secretName: helloworld-tls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment