-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Examples in docs could use more specific naming #1743
Description
At times the examples in the documentation are not clear on what the source and destination values, e.g., all the names or keys being named the same like example in Google Secret Manager example where the comment "name of the GCPSM secret key" appears to be on the wrong line:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: example
spec:
refreshInterval: 1h # rate SecretManager pulls GCPSM
secretStoreRef:
kind: SecretStore
name: example # name of the SecretStore (or kind specified)
target:
name: secret-to-be-created # name of the k8s Secret to be created
creationPolicy: Owner
data:
- secretKey: dev-secret-test # name of the GCPSM secret key
remoteRef:
key: dev-secret-testEven though they all are technically correct after reading and understanding them, it would be great if the examples in general were a bit more usage example based with all unique names to make things more clear and quicker to understand. For example the above could look like:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: twilio-secret-from-google # can be different than the name of secret to be created
spec:
refreshInterval: 1h # rate SecretManager pulls GCPSM
secretStoreRef:
kind: SecretStore
name: google # name of the SecretStore (or kind specified)
target:
name: twilio # name of the k8s Secret to be created
creationPolicy: Owner
data:
- secretKey: account-sid # key in the k8s Secret to be created
remoteRef:
key: twilio-account-sid # name of the GCPSM secret key
- secretKey: auth-token
remoteRef:
key: twilio-auth-tokenThis type of change would be especially helpful in the Kubernetes Provider examples since it has things like creating a SecretStore named example with just a single ExternalSecret named example as well. It may be more realistic to assume in examples to imply that there be may be more than one ExternalSecret per SecretStore? The namespace is also left off of the resources which can be confusing since the remote namespace that is being fetched is called default. The page never mentions what the "local" namespace is -- is it also default? They probably should be different so the example of fetching secrets from another namespace in the cluster works without coming up with a completely separate example set of resources. Example from docs:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: example
spec:
refreshInterval: 1h
secretStoreRef:
kind: SecretStore
name: example # name of the SecretStore (or kind specified)
target:
name: secret-to-be-created # name of the k8s Secret to be created
data:
- secretKey: extra
remoteRef:
key: secret-example
property: extraWhich could look like:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: my-api-dev
spec:
refreshInterval: 1h
secretStoreRef:
kind: SecretStore
name: dev-store # name of the SecretStore (or kind specified)
target:
name: my-api # name of the k8s Secret to be created
data:
- secretKey: auth-token
remoteRef:
key: my-api-credentials
property: auth-token-read-write