Certificate Management
How automatic HTTPS certificates work
Siovos provides automatic HTTPS certificates for all your services using a private certificate authority. Here's how it works.
The Certificate Chain#
Three components work together to provide seamless certificate management:
Step CA - Your private Certificate Authority. Issues trusted certificates for any *.internal domain (or your configured suffix).
cert-manager - Kubernetes operator that automates certificate requests. Watches for Ingress resources and Certificate CRDs, then requests certificates from Step CA.
Reflector - Copies certificate secrets across namespaces. Allows a certificate issued in one namespace to be used by services in other namespaces.
How It Works#
- You create an Ingress with a TLS section
- cert-manager detects the Ingress and creates a Certificate request
- cert-manager contacts Step CA to issue the certificate
- The certificate is stored as a Kubernetes Secret
- Traefik uses the secret to serve HTTPS
- Reflector copies the secret to other namespaces if configured
Requesting a Certificate#
Via Ingress (Recommended)#
Add the cert-manager annotation to your Ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app
annotations:
cert-manager.io/cluster-issuer: step-ca-issuer
spec:
ingressClassName: traefik
tls:
- hosts:
- my-app.internal
secretName: my-app-tls
rules:
- host: my-app.internal
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app
port:
number: 80cert-manager will automatically:
- Create a Certificate resource
- Request a certificate from Step CA
- Store it in the
my-app-tlssecret
Via Certificate Resource (Manual)#
For more control, create a Certificate resource directly:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: my-app-cert
namespace: my-namespace
spec:
secretName: my-app-tls
duration: 720h # 30 days
renewBefore: 168h # 7 days
issuerRef:
name: step-ca-issuer
kind: ClusterIssuer
dnsNames:
- my-app.internal
- api.my-app.internalCertificate Renewal#
Certificates are automatically renewed before expiration. By default:
- Certificate duration: 30 days
- Renewal: automatic before expiration
You can check certificate status:
kubectl get certificates -A
kubectl describe certificate my-app-cert -n my-namespaceSharing Certificates Across Namespaces#
Use Reflector annotations to copy a certificate secret to other namespaces:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: shared-cert
namespace: cert-manager
spec:
secretName: shared-tls
secretTemplate:
annotations:
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "app1,app2,app3"
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
issuerRef:
name: step-ca-issuer
kind: ClusterIssuer
dnsNames:
- "*.internal"The secret will be automatically copied to app1, app2, and app3 namespaces.
Wildcard Certificates#
For multiple subdomains, use a wildcard certificate:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: wildcard-cert
spec:
secretName: wildcard-tls
issuerRef:
name: step-ca-issuer
kind: ClusterIssuer
dnsNames:
- "*.internal"
- "internal"Wildcard certificates cover *.internal but not internal itself. Include both if needed.
Trusting the Certificates#
Certificates issued by Step CA are only trusted by machines that have the root CA certificate installed. See Certificate Installation for instructions.
Checking Certificate Status#
View all certificates:
kubectl get certificates -ACheck a specific certificate:
kubectl describe certificate my-app-cert -n my-namespaceView the actual secret:
kubectl get secret my-app-tls -n my-namespace -o yamlTroubleshooting#
Certificate not issued#
-
Check cert-manager logs:
kubectl logs -n cert-manager deployment/cert-manager -
Check the Certificate status:
kubectl describe certificate my-app-cert -
Look for CertificateRequest resources:
kubectl get certificaterequests -A
Certificate shows "Not Ready"#
Common causes:
- Step CA is not running
- ClusterIssuer is misconfigured
- DNS name is not allowed by the issuer policy
Secret not copied by Reflector#
- Verify Reflector annotations are correct
- Check Reflector logs:
kubectl logs -n reflector deployment/reflector
Next Steps#
- Certificate Installation - Install the root CA on your devices
- Ingress with Traefik - Configure routing with automatic TLS
- Troubleshooting - More certificate issues