Sub topic 3
Installing the operator
This chapter installs External Secrets Operator (ESO) with Helm and checks that it is running. It assumes you can use kubectl and Helm, and that you have a cluster where you may create namespaces and install CRDs (CustomResourceDefinitions, the objects that add new resource kinds to Kubernetes).
What the chart installs
The Helm chart deploys the ESO controller and registers the custom resources from the previous chapter. In a default install you get three Deployments in the release namespace:
- The main controller, which reconciles
SecretStore,ClusterSecretStoreandExternalSecretobjects. - A webhook, which validates ESO resources when you apply them.
- A cert controller, which creates and renews the TLS certificate the webhook uses.
The chart also installs the CRDs in the external-secrets.io API group. CRDs are cluster-wide, so installing them needs cluster-level permissions even if you run the controller in one namespace.
Install with Helm
Add the official chart repository and install the chart into its own namespace. The --create-namespace flag creates external-secrets if it does not exist.
helm repo add external-secrets https://charts.external-secrets.io
helm repo update
helm install external-secrets external-secrets/external-secrets \
--namespace external-secrets --create-namespace
kubectl get pods -n external-secrets
kubectl get crds | grep external-secrets.ioThe first three commands install the operator. The last two verify it.
Verify the install
Run kubectl get pods -n external-secrets. You should see three Pods, each Running and 1/1 ready. The Pod names start with the release name, external-secrets, external-secrets-webhook and external-secrets-cert-controller.
Then run kubectl get crds | grep external-secrets.io. The list should include at least these kinds:
| CRD | Purpose |
|---|---|
| `secretstores.external-secrets.io` | Namespaced connection to a provider |
| `clustersecretstores.external-secrets.io` | Cluster-wide connection to a provider |
| `externalsecrets.external-secrets.io` | Request to sync a remote secret |
Other CRDs, such as pushsecrets and clusterexternalsecrets, appear too. Later chapters cover them.
Common installation problems
- Pods stuck in
PendingorCrashLoopBackOff. Runkubectl describe podandkubectl logson the failing Pod. Resource limits and image pull errors are the usual causes. - Webhook errors when applying an ExternalSecret. The message mentions a failed call to
external-secrets-webhook. The webhook Pod is probably not ready yet, or its certificate has not been issued. Wait for the cert controller to become ready and apply again. - CRDs missing. If the chart was installed with
installCRDs=false, or the CRDs were removed, thegrepreturns nothing. Reinstall with the default values. - Permission denied on CRD creation. Your Kubernetes user lacks cluster-level rights. Ask a cluster administrator to install the chart.
Pin the version
helm install without --version takes the latest chart. For repeatable installs, pin one:
helm search repo external-secrets/external-secrets --versions | head
helm upgrade --install external-secrets external-secrets/external-secrets \
--namespace external-secrets --create-namespace \
--version <chart-version>Replace <chart-version> with a version from the search output. Upgrade by changing that value and re-running the command. Read the release notes first, because API versions and defaults can change between releases.
With the controller running, it can act on resources. Nothing syncs yet, because no store tells it where to read from. The next chapter creates one.
Exercise
After helm install, the three ESO Pods are Running, but kubectl apply of an ExternalSecret fails with an error about calling external-secrets-webhook. What is the most likely cause, and how do you check it?
Show answer
The webhook Pod is probably not ready, or the cert controller has not yet issued the webhook's TLS certificate. Run kubectl get pods -n external-secrets and kubectl logs on the cert controller and webhook Pods. Wait until both are ready, then apply the manifest again.
Exercise
Which command shows which API version (v1 or v1beta1) of the ESO resources your cluster serves?
Show answer
kubectl api-resources --api-group=external-secrets.io