Skip to main content
Before you can start sealing secrets, the Kubeseal CLI must retrieve the public key from the Sealed Secrets controller running in your cluster. This key allows Kubeseal to encrypt secrets so that only the controller can decrypt them.

1. Verify Your Cluster Is Running

First, ensure your Kubernetes cluster is healthy by listing all pods in the kube-system namespace:
You should see output similar to:
If any core component is not Running, troubleshoot using kubectl describe pod <pod-name> -n kube-system or check your cluster’s control-plane logs.

2. Attempt to Fetch the Public Certificate

Run the following command to fetch the controller’s public certificate. This step fails initially because Kubeseal doesn’t know which controller service to target:
Expected error:

3. Discover the Sealed Secrets Service

Identify the actual service name and namespace by listing services in kube-system:
Example output:
From this list, note:
  • Service Name: my-release-sealed-secrets
  • Namespace: kube-system

4. Fetch and Save the Public Key

With the service details in hand, re-run the fetch command with the appropriate flags:
If this completes without errors, you now have pub-cert.pem containing the Sealed Secrets controller’s public key.
You’re ready to use kubeseal with --cert pub-cert.pem to encrypt your Kubernetes Secrets. Learn more in the Sealed Secrets documentation.

Quick Reference Table

Watch Video