If you cannot use the quickstart method, follow these steps to manually set up the CA and the autocert controller.
1. Prerequisites
- Install
step CLI version 0.18.2 or later. - Ensure you have cluster-admin permissions (on GKE, you may need to explicitly bind the
cluster-admin role to your user).
2. Create a CA
First, set a temporary STEPPATH to stage CA artifacts:
export STEPPATH=$(mktemp -d /tmp/step.XXX)
Initialize the CA using step ca init. You will be prompted for a password to encrypt key material:
step ca init \
--name Autocert \
--dns "ca.step.svc.cluster.local,127.0.0.1" \
--address ":4443" \
--provisioner admin \
--with-ca-url "ca.step.svc.cluster.local"
Add the autocert provisioner to the CA:
step ca provisioner add autocert --create
3. Install the CA in Kubernetes
Create the step namespace and upload the CA configuration, certificates, and secrets as ConfigMaps. You must also create Kubernetes secrets for the passwords used during CA initialization and provisioner creation.
Note: Use the exact passwords you entered during the step ca init and step ca provisioner add steps.
4. Install the autocert controller
Apply the controller manifest and the RBAC configuration to allow autocert to manage bootstrap token secrets.
5. Register the mutation webhook
Finally, register the autocert mutation webhook with Kubernetes to enable automatic certificate injection.
# 1. Quickstart (Alternative to manual)
kubectl run autocert-init -it --rm --image smallstep/autocert-init --restart Never
# 2. Manual: Create CA
export STEPPATH=$(mktemp -d /tmp/step.XXX)
step ca init \
--name Autocert \
--dns "ca.step.svc.cluster.local,127.0.0.1" \
--address ":4443" \
--provisioner admin \
--with-ca-url "ca.step.svc.cluster.local"
step ca provisioner add autocert --create
# 3. Manual: Kubernetes Setup (Namespace and ConfigMaps)
kubectl create namespace step
kubectl -n step create configmap config --from-file $(step path)/config
kubectl -n step create configmap certs --from-file $(step path)/certs
kubectl -n step create configmap secrets --from-file $(step path)/secrets
kubectl -n step create secret generic ca-password --from-literal password=<ca-password>
kubectl -n step create secret generic autocert-password --from-literal password=<autocert-password>
# 4. Manual: Apply manifests
kubectl apply -f https://raw.githubusercontent.com/smallstep/autocert/master/install/01-step-ca.yaml
kubectl apply -f https://raw.githubusercontent.com/smallstep/autocert/master/install/02-autocert.yaml
kubectl apply -f https://raw.githubusercontent.com/smallstep/autocert/master/install/03-rbac.yaml