# List of all API Resources of External Secrets Operator | |
$ kubectl api-resources | grep -i secret | |
secrets v1 true Secret | |
clusterexternalsecrets ces external-secrets.io/v1beta1 false ClusterExternalSecret | |
clustersecretstores css external-secrets.io/v1beta1 false ClusterSecretStore | |
externalsecrets es external-secrets.io/v1beta1 true ExternalSecret | |
secretstores ss external-secrets.io/v1beta1 true SecretStore | |
# List of all secretstores | |
$ kubectl get ss --all-namespaces | |
# List of all externalsecrets | |
$ kubectl get es --all-namespaces | |
# List of all clustersecretstores | |
$ kubectl get css --all-namespaces | |
# List of all clusterexternalsecrets | |
$ kubectl get ss --all-namespaces | |
Here is a list of some of the most common commands to work with the External Secrets Operator: | |
$ kubectl get all -l ext-secrets.io/controller=true | |
This command lists all resources of the External Secrets Operator in the current namespace. | |
$ kubectl get all -l ext-secrets.io/controller=true --all-namespaces | |
This command lists all resources of the External Secrets Operator in all namespaces. | |
$ kubectl get <resource type> -l ext-secrets.io/controller=true | |
This command lists all resources of a specific type, such as SecretStores or ExternalSecrets, in the current namespace. | |
$ kubectl create secretstore -f secretstore.yaml | |
This command creates a SecretStore resource from a YAML file. | |
$ kubectl update secretstore -f secretstore.yaml | |
This command updates a SecretStore resource from a YAML file. | |
$ kubectl delete secretstore secretstore-name | |
This command deletes a SecretStore resource. | |
$ kubectl create externalsecret -f externalsecret.yaml | |
This command creates an ExternalSecret resource from a YAML file. | |
$ kubectl update externalsecret -f externalsecret.yaml | |
This command updates an ExternalSecret resource from a YAML file. | |
$ kubectl delete externalsecret externalsecret-name | |
This command deletes an ExternalSecret resource. | |
$ kubectl describe secretstore secretstore-name | |
This command describes a SecretStore resource. | |
$ kubectl describe externalsecret externalsecret-name | |
This command describes an ExternalSecret resource. | |
$ kubectl logs externalsecret-name | |
This command displays the logs for an ExternalSecret resource. | |
$ kubectl troubleshoot externalsecret-name | |
This command troubleshoots an ExternalSecret resource. | |
Installing the External Secrets Operator | |
Depending on the package manager you're using:Using Helm: | |
$ helm repo add external-secrets https://external-secrets.github.io/kubernetes-external-secrets/ | |
$ helm install my-release external-secrets/kubernetes-external-secrets | |
Checking the External Secrets Operator logs | |
If you've named your release "my-release", then: | |
$ kubectl logs deployment/my-release-kubernetes-external-secrets | |
Creating an ExternalSecret custom resource | |
apiVersion: 'kubernetes-client.io/v1' | |
kind: ExternalSecret | |
metadata: | |
name: my-secret-name | |
spec: | |
backendType: [backend-type] # example: systemManager (for AWS) | |
data: | |
- key: [external-secret-key] # the key under which your secret is stored externally | |
name: [k8s-secret-key] # the key under which you want the secret to be available in Kubernetes | |
Apply the resource with: | |
$ kubectl apply -f my-external-secret.yaml | |
Viewing the created Kubernetes Secret | |
This command will show the secret synchronized from the external source: | |
$ kubectl get secret my-secret-name -o yaml | |
Deleting an ExternalSecret | |
If you wish to delete an ExternalSecret: | |
$ kubectl delete externalsecret my-secret-name | |
Monitoring and Debugging | |
You can describe the ExternalSecret to get more details: | |
$ kubectl describe externalsecret my-secret-name | |
Uninstalling the External Secrets Operator | |
If you've installed via Helm and named your release "my-release": | |
$ helm uninstall my-release |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND