|
|
@@ -1,4 +1,13 @@
|
|
|
{% raw %}
|
|
|
+---
|
|
|
+# The source secret that will be pushed to the destination secret by ClusterPushSecret.
|
|
|
+apiVersion: v1
|
|
|
+kind: Secret
|
|
|
+metadata:
|
|
|
+ name: source-secret
|
|
|
+stringData:
|
|
|
+ best-pokemon-src: "Pikachu"
|
|
|
+---
|
|
|
apiVersion: external-secrets.io/v1alpha1
|
|
|
kind: ClusterPushSecret
|
|
|
metadata:
|
|
|
@@ -30,7 +39,7 @@ spec:
|
|
|
kind: SecretStore
|
|
|
selector:
|
|
|
secret:
|
|
|
- name: pokedex-credentials # Source Kubernetes secret to be pushed
|
|
|
+ name: source-secret # Source Kubernetes secret to be pushed
|
|
|
# Alternatively, you can point to a generator that produces values to be pushed
|
|
|
generatorRef:
|
|
|
apiVersion: external-secrets.io/v1alpha1
|
|
|
@@ -41,10 +50,12 @@ spec:
|
|
|
annotations: { }
|
|
|
labels: { }
|
|
|
data:
|
|
|
- best-pokemon: "{{ .best-pokemon | toString | upper }} is the really best!"
|
|
|
- # Uses an existing template from configmap
|
|
|
- # Secret is fetched, merged and templated within the referenced configMap data
|
|
|
- # It does not update the configmap, it creates a secret with: data["alertmanager.yml"] = ...result...
|
|
|
+ # If the key source secret key has dashes, then it cannot be accessed directly,
|
|
|
+ # and the "index" function should be used.
|
|
|
+ best-pokemon: "{{ index . \"best-pokemon-src\" | toString | upper }} is the really best!"
|
|
|
+ # Also, it's possible to use an existing template from configmap where Secret is fetched,
|
|
|
+ # merged and templated within the referenced configMap data.
|
|
|
+ # It does not update the configmap, it creates a secret with: data["config.yml"] = ...result...
|
|
|
templateFrom:
|
|
|
- configMap:
|
|
|
name: application-config-tmpl
|
|
|
@@ -53,10 +64,11 @@ spec:
|
|
|
data:
|
|
|
- conversionStrategy: None # Also supports the ReverseUnicode strategy
|
|
|
match:
|
|
|
- secretKey: best-pokemon # Source Kubernetes secret key to be pushed
|
|
|
+ # The secretKey is used within ClusterPushSecret (it should match key under spec.pushSecretSpec.template.data)
|
|
|
+ secretKey: best-pokemon
|
|
|
remoteRef:
|
|
|
- remoteKey: my-first-parameter # Remote reference (where the secret is going to be pushed)
|
|
|
-
|
|
|
+ remoteKey: destination-secret # The destination secret object name (where the secret is going to be pushed)
|
|
|
+ property: best-pokemon-dst # The key within the destination secret object.
|
|
|
status:
|
|
|
# This will list any namespaces where the creation of the ExternalSecret failed
|
|
|
# This will not list any issues with the ExternalSecrets, you will have to check the
|