Kubernetes: kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.7.0/cert-manager.yaml
Helm install: helm install --name cert-manager --namespace cert-manager --version v1.4.0 jetstack/cert-manager --set installCRDs=true
Use either issuer or cluster-issuer.
-
issuer.yaml:
apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: selfsigned-issuer # namespace: eshop spec: selfSigned: {}
Apply issuer:
kubectl apply issuer.yaml
-
the
ClusterIssuer
is a cluster-wide (non-namespaced) resource, you only need to create one for the whole cluster. cluster-issuer.yaml:apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: selfsigned-issuer-cluster spec: selfSigned: {}
Apply issuer:
kubectl apply cluster-issuer.yaml
Use issuerRef based on your issuer certificate.yaml:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: selfsigned-cert
# namespace: eshop
spec:
dnsNames:
- "*.eshop-st-web"
- "*.eshop-st-public-web"
- "*.eshop-st-authserver"
- "*.eshop-st-identity"
- "*.eshop-st-administration"
- "*.eshop-st-basket"
- "*.eshop-st-catalog"
- "*.eshop-st-ordering"
- "*.eshop-st-payment"
- "*.eshop-st-gateway-web"
- "*.eshop-st-gateway-web-public"
secretName: eshop-staging-tls
issuerRef:
name: selfsigned-issuer
# name: selfsigned-issuer-cluster
Apply issuer: kubectl apply certificate.yaml
Check secrets:
kubectl get secrets -n=namespace
Check certificates:
kubectl get certificates -n=namespace
kubectl describe certificate selfsigned-cert -n=namespace
Use annotation based on your issuer.
Ingress configuration
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
# cert-manager.io/cluster-issuer: selfsigned-cluster-issuer
cert-manager.io/issuer: selfsigned-issuer
name: local-ingress
namespace: my-app-namespace
spec:
rules:
- host: test-app.com
http:
paths:
- backend:
serviceName: my-app-service
servicePort: 80
path: /
tls:
- hosts:
- test-app.com
secretName: eshop-staging-tls
kubectl get Issuers,ClusterIssuers,Certificates,CertificateRequests,Orders,Challenges --all-namespaces