Second, clone the repo and modify the kustomize.yaml secretGenerator section to be a better token than supersecret
:
secretGenerator:
- name: arogocd-generator-plugin-token
literals:
- token=supersecret
kustomize build | kubectl apply -f -
Finally, you can create a Kubernetes Secret for your queriable variables, like this:
apiVersion: v1
kind: Secret
metadata:
name: argocd-secret-vars
namespace: argocd
labels:
app.kubernetes.io/part-of: argocd
type: Opaque
data:
# The secret value must be base64 encoded **once**.
# This value corresponds to: `printf "beepboop" | base64`.
app_name: "YmVlcGJvb3A="
Here’s an example ApplicationSet, using the generator, to apply:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: my-application-set
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- plugin:
configMapRef:
name: secret-plugin-generator
input:
parameters:
secret_vars: ["app_name"]
template:
metadata:
name: "from-appset-"
spec:
project: default
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
path: guestbook
destination:
server: https://kubernetes.default.svc
namespace: default
You can apply the example ApplicationSet and Secret with:
kubectl apply -f example/appset_and_secret.yaml