An Argo CD ApplicationSet Generator Plugin to retrieve values from Kubernete Secrets
  • Python 57.6%
  • Go Template 37.8%
  • Dockerfile 4.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-07 09:15:44 +00:00
.forgejo only do the release on push to main when Chart.yaml is affected 2026-06-16 16:10:21 +00:00
charts/appset-secret-plugin Update to version 2.2.0 and regenerate docs. 2026-08-07 09:15:44 +00:00
docker Update python Docker tag to v3.14 (#75) 2025-10-24 14:22:45 +02:00
example Automatically reload secret (#68) 2025-08-16 17:37:40 +02:00
kustomize fix a couple of secret related issues, namely: secrets are readOnly once mounted and the secret-vars volume mount is now optional for testing 2023-08-05 16:43:08 +02:00
.gitignore Initial commit 2023-08-04 14:30:06 +02:00
.pre-commit-config.yaml add some pre-commit hooks for helm chart 2023-08-05 15:42:55 +02:00
AI_POLICY.md add an AI Policy 2026-05-14 15:42:25 +02:00
LICENSE adding more debug lines for sending json (#32) 2024-07-09 12:09:17 +02:00
README.md update release process to use tags instead of requiring semver bump in chart.yaml 2026-06-16 16:10:21 +00:00
renovate.json update release process to use tags instead of requiring semver bump in chart.yaml 2026-06-16 16:10:21 +00:00

ApplicationSet Secret Plugin Generator

appset-secret-plugin is an Argo CD ApplicationSet Plugin Generator (only available in Argo CD v2.8.0 or newer) to fetch variables from an existing Kubernetes Secret that is mounted as a file in our plugin generator deployment.

🆕 Now we reload your Kubernetes Secret at a configurable interval!

Usage

First, install Argo CD on your cluster.

Install with helm

For helm, see the README for full details of the allowed values in values.yaml, but this is the gist for testing:

# add the helm repo locally using the forgejo release (untested)
helm repo add codeberg.org https://codeberg.org/api/packages/open-engineering/helm
helm repo update

# install the bitwarden provider with credentials via the CLI
# the appID is a random string you set as a unique identifier to bitwarden to avoid too many logged-in notification emails
helm install appset-secret-plugin codeberg.org/appset-secret-plugin

You'll likely want to pass in a value for an existing Kubernetes Secret containing your secret keys you want to be available to the Plugin Generator. To do that, let's say the name of your Kubernetes Secret is my-secret-name, you can try this:

helm install appset-secret-plugin codeberg.org/appset-secret-plugin \
   --set secretVars.existingSecret=my-secret-name

Install with Kustomize

See the README in the kustomize directory. ⚠️This method has not been tested in over a year.

Testing

You can create a Kubernetes Secret for your queriable variables, like this:

apiVersion: v1
kind: Secret
metadata:
  # configurable with secretVars.existingSecret helm parameter
  name: argocd-secret-vars
  # this needs to be where-ever argocd is running
  namespace: argocd
  labels:
    app.kubernetes.io/part-of: argocd
    # can be configured to use a different label and value with by setting
    # configReloader.label and configReloader.labelValue helm parameters
    argocd-appset-secret-plugin: 1
type: stringData
data:
  # configurable with secretVars.secretKey helm parameter
  secret_vars.yaml: |
    app_name: "beepboop"

Here's an example Argo CD ApplicationSet, using the secret plugin 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-var-plugin-generator
        input:
          parameters:
            secret_vars:
              # this grabs a parameter called app_name from the secret above
              - app_name
  template:
    metadata:
      name: "from-appset-{{.app_name}}"
    spec:
      project: default
      source:
        repoURL: https://codeberg.org/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

Status

This is beta project still, but I'm working on getting to stable. Please open a Codeberg Issue with your method of installation, your distro of k8s and the version of your k8s tooling (kustomize, helm, etc), if you're having any trouble. Also, always happy to look at PRs :)

Cheers!