Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit 72cf4c4

Browse files
authored
chore(readme): fix order of README for clarity (#787)
1 parent fd2729e commit 72cf4c4

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,41 @@ Uncomment `GOOGLE_APPLICATION_CREDENTIALS` in the values file as well as the fol
810810

811811
This will mount the secret at `/app/gcp-creds/gcp-creds.json` and make it available via the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
812812

813+
#### Usage
814+
815+
Once you have kubernetes-external-secrets installed, you can create an external secret with YAML like the following:
816+
817+
```yml
818+
apiVersion: kubernetes-client.io/v1
819+
kind: ExternalSecret
820+
metadata:
821+
name: gcp-secrets-manager-example # name of the k8s external secret and the k8s secret
822+
spec:
823+
backendType: gcpSecretsManager
824+
projectId: my-gsm-secret-project
825+
data:
826+
- key: my-gsm-secret-name # name of the GCP secret
827+
name: my-kubernetes-secret-name # key name in the k8s secret
828+
version: latest # version of the GCP secret
829+
property: value # name of the field in the GCP secret
830+
```
831+
832+
The field "key" is the name of the secret in Google Secret Manager. The field "name" is the name of the Kubernetes secret this external secret will generate. The metadata "name" field is the name of the external secret in Kubernetes.
833+
834+
To retrieve external secrets, you can use the following command:
835+
836+
kubectl get externalsecrets -n $NAMESPACE
837+
838+
To retrieve the secrets themselves, you can use the regular:
839+
840+
kubectl get secrets -n $NAMESPACE
841+
842+
To retrieve an individual secret's content, use the following where "mysecret" is the key to the secret content under the "data" field:
843+
844+
kubectl get secret my-secret -o 'go-template={{index .data "mysecret"}}' | base64 -D
845+
846+
The secrets will persist even if the helm installation is removed, although they will no longer sync to Google Secret Manager.
847+
813848
### IBM Cloud Secrets Manager
814849

815850
kubernetes-external-secrets supports fetching secrets from [IBM Cloud Secrets Manager](https://cloud.ibm.com/catalog/services/secrets-manager)
@@ -846,41 +881,6 @@ spec:
846881
secretType: username_password
847882
```
848883

849-
#### Usage
850-
851-
Once you have kubernetes-external-secrets installed, you can create an external secret with YAML like the following:
852-
853-
```yml
854-
apiVersion: kubernetes-client.io/v1
855-
kind: ExternalSecret
856-
metadata:
857-
name: gcp-secrets-manager-example # name of the k8s external secret and the k8s secret
858-
spec:
859-
backendType: gcpSecretsManager
860-
projectId: my-gsm-secret-project
861-
data:
862-
- key: my-gsm-secret-name # name of the GCP secret
863-
name: my-kubernetes-secret-name # key name in the k8s secret
864-
version: latest # version of the GCP secret
865-
property: value # name of the field in the GCP secret
866-
```
867-
868-
The field "key" is the name of the secret in Google Secret Manager. The field "name" is the name of the Kubernetes secret this external secret will generate. The metadata "name" field is the name of the external secret in Kubernetes.
869-
870-
To retrieve external secrets, you can use the following command:
871-
872-
kubectl get externalsecrets -n $NAMESPACE
873-
874-
To retrieve the secrets themselves, you can use the regular:
875-
876-
kubectl get secrets -n $NAMESPACE
877-
878-
To retrieve an individual secret's content, use the following where "mysecret" is the key to the secret content under the "data" field:
879-
880-
kubectl get secret my-secret -o 'go-template={{index .data "mysecret"}}' | base64 -D
881-
882-
The secrets will persist even if the helm installation is removed, although they will no longer sync to Google Secret Manager.
883-
884884
## Binary Secrets
885885

886886
Most backends do not treat binary secrets any differently than text secrets. Since you typically store a binary secret as a base64-encoded string in the backend, you need to explicitly let the ExternalSecret know that the secret is binary, otherwise it will be encoded in base64 again.

0 commit comments

Comments
 (0)