vso-utils

by tobi-or-not

Helm chartv2.4.0App 1.6.0MITVerified publisher

Production-ready Helm chart for managing HashiCorp Vault Secret Operator resources - sync static secrets, generate dynamic credentials, issue PKI certificates, and configure Vault authentication.

About this chart

vso-utils

Production-ready Helm chart for managing HashiCorp Vault Secret Operator resources - sync static secrets, generate dynamic credentials, issue PKI certificates, and configure Vault authentication.

Requirements

RepositoryNameVersion
https://helm.releases.hashicorp.comvso(vault-secrets-operator)>=1.0.0

Overview

This Helm chart provides a comprehensive and production-ready solution for deploying Vault Secret Operator (VSO) resources in Kubernetes. It simplifies the management of secrets from HashiCorp Vault by providing:

  • VaultStaticSecret: Sync static KV secrets from Vault to Kubernetes Secrets
  • VaultDynamicSecret: Generate dynamic credentials (databases, cloud providers, etc.)
  • VaultPKISecret: Issue and renew PKI certificates automatically
  • VaultAuth: Configure Vault authentication methods
  • VaultConnection: Define Vault server connection settings

Supported VSO Resources

Resource TypeDescriptionUse Case
VaultStaticSecretSyncs KV-v1/KV-v2 secretsApplication configuration, API keys
VaultDynamicSecretGenerates short-lived credentialsDatabase passwords, cloud IAM
VaultPKISecretIssues X.509 certificatesTLS/mTLS, service mesh
VaultAuthConfigures authenticationKubernetes, JWT, AppRole auth
VaultConnectionDefines Vault endpointsMulti-cluster, HA Vault setups

Installing the Chart

Prerequisites

  • Kubernetes 1.29+
  • Helm 3.0+
  • Vault Secret Operator installed (can be enabled via this chart)
  • HashiCorp Vault server accessible from your cluster

CLI

Using Traditional Helm Repository:

helm repo add tobi https://this-is-tobi.github.io/helm-charts
helm repo update
helm install <release_name> tobi/vso-utils

Using OCI Registry (Recommended):

helm install <release_name> oci://ghcr.io/this-is-tobi/charts/vso-utils --version 2.4.0

ArgoCD

Using Helm Repository:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: vso-utils
spec:
  project: default
  sources:
  - repoURL: https://this-is-tobi.github.io/helm-charts
    chart: vso-utils
    targetRevision: 2.4.0
    helm:
      releaseName: <release_name>
      values: |
        vaultStaticSecrets:
          appConfig:
            mount: secret
            vaultAuthRef: default
            path: app/config
            destination:
              name: app-config
  destination:
    server: https://kubernetes.default.svc
    namespace: default

Using OCI Registry:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: vso-utils
spec:
  project: default
  sources:
  - repoURL: ghcr.io/this-is-tobi/charts
    chart: vso-utils
    targetRevision: 2.4.0
    helm:
      releaseName: <release_name>
      values: |
        vaultStaticSecrets:
          appConfig:
            mount: secret
            vaultAuthRef: default
            path: app/config
            destination:
              name: app-config
  destination:
    server: https://kubernetes.default.svc
    namespace: default

Helm Dependency

Using Helm Repository:

# Chart.yaml
dependencies:
- name: vso-utils
  version: 2.4.0
  repository: https://this-is-tobi.github.io/helm-charts
  condition: vso-utils.enabled

Using OCI Registry:

# Chart.yaml
dependencies:
- name: vso-utils
  version: 2.4.0
  repository: oci://ghcr.io/this-is-tobi/charts
  condition: vso-utils.enabled

values.yaml:

vso-utils:
  enabled: true
  vaultStaticSecrets:
    appConfig:
      mount: secret
      vaultAuthRef: default
      path: app/config
      destination:
        name: app-config

Configuration

Configuration Structure

Each VSO resource type (vaultStaticSecrets, vaultDynamicSecrets, etc.) is configured as a map where:

  • Each top-level key represents one resource instance
  • The key name becomes part of the Kubernetes resource name (converted to kebab-case)
  • The value contains the resource-specific configuration
  • enabled, optional: false, or a template that renders false or empty (rendered through tpl with the chart's root context, so it can follow a global), leaves the entry out; without it the entry renders

Example:

vaultStaticSecrets:
  myAppConfig:      # Creates: <release-name>-vso-utils-my-app-config
    mount: secret
    path: app/config
    # ... configuration
  anotherSecret:    # Creates: <release-name>-vso-utils-another-secret
    mount: secret
    path: another/path
    # ... configuration

Basic Usage Examples

1. Static KV Secret (Application Configuration)

vaultStaticSecrets:
  appConfig:
    mount: secret
    vaultAuthRef: default
    path: myapp/config
    type: kv-v2
    refreshAfter: 1h
    hmacSecretData: true
    destination:
      name: app-config
      create: true

This creates a Kubernetes Secret named app-config that syncs from secret/myapp/config in Vault.

2. Dynamic Database Credentials

vaultDynamicSecrets:
  postgresCredentials:
    mount: database
    vaultAuthRef: default
    path: creds/my-role
    renewalPercent: 67
    revoke: true
    rolloutRestartTargets:
    - kind: Deployment
      name: my-app
    destination:
      name: postgres-creds
      create: true

Generates fresh database credentials and restarts the deployment when rotated.

3. TLS Certificate

vaultPKISecrets:
  serviceTLS:
    mount: pki
    vaultAuthRef: default
    role: service-role
    commonName: myservice.example.com
    altNames:
    - "*.myservice.example.com"
    ttl: 720h
    expiryOffset: 24h
    destination:
      name: service-tls
      type: kubernetes.io/tls
      create: true

Issues a TLS certificate that auto-renews 24 hours before expiration.

4. Complete Setup with Auth and Connection

vaultConnection:
  default:
    address: https://vault.example.com:8200
    skipTLSVerify: false
    caCertSecretRef: vault-ca-cert

vaultAuth:
  default:
    method: kubernetes
    mount: kubernetes
    params:
      role: my-app-role
      serviceAccount: default
      audiences: ["vault"]
    vaultConnectionRef: default

vaultStaticSecrets:
  appSecrets:
    mount: secret
    vaultAuthRef: default
    path: app/secrets
    destination:
      name: app-secrets

Complete configuration including Vault connection, authentication, and secret sync.

5. Login Method from a Global

vaultAuthDefaults:
  method: '{{ dig "vaultAuthMethod" "kubernetes" (.Values.global | default dict) }}'
  mount: '{{ dig "vaultAuthMount" "kubernetes" (.Values.global | default dict) }}'

vaultAuth:
  default:
    login:
      role: my-app-role
      serviceAccount: default
      audiences: ["vault"]

method and mount go through tpl, so one global switches every VaultAuth between the kubernetes and jwt methods; (.Values.global | default dict) keeps them working when the chart is installed on its own, without a parent chart's global. The defaults' mount goes only to an entry of their method: an entry that names another method names its mount too. login is rendered under the method they resolve to; each key of a block of that method's own name, when set, replaces login's, even an empty one.

Advanced Features

Secret Transformation

Transform secret data before storing in Kubernetes:

vaultStaticSecrets:
  appConfig:
    mount: secret
    path: app/config
    destination:
      name: app-config
      transformation:
        templates:
          config.json:
            text: |
              {
                "database": {
                  "host": "{{ .Secrets.db_host }}",
                  "port": {{ .Secrets.db_port }},
                  "username": "{{ .Secrets.db_user }}"
                }
              }
        includes:
        - "^api_.*"
        excludes:
        - ".*_internal$"

Rollout Restarts

Automatically restart workloads when secrets change:

vaultDynamicSecrets:
  dbCreds:
    mount: database
    path: creds/my-role
    rolloutRestartTargets:
    - kind: Deployment
      name: backend
    - kind: StatefulSet
      name: worker
    destination:
      name: db-credentials

Multi-Namespace Deployments

Deploy VSO resources across namespaces:

vaultStaticSecrets:
  prodConfig:
    namespace: production
    mount: secret
    path: prod/config
    destination:
      name: app-config
 
  devConfig:
    namespace: development
    mount: secret
    path: dev/config
    destination:
      name: app-config

Security Best Practices

  1. Enable HMAC Secret Data: Keep hmacSecretData: true on static secrets for drift detection (dynamic and PKI secrets have no such field)
  2. Use Specific Roles: Create dedicated Vault roles with least-privilege policies
  3. Enable TLS: Never set skipTLSVerify: true in production
  4. Rotate Credentials: Use VaultDynamicSecret for auto-rotating credentials
  5. Namespace Isolation: Deploy VSO resources in appropriate namespaces
  6. Secret Transformation: Use excludes patterns to filter sensitive data
  7. Audit Logging: Enable Vault audit logs to track secret access

Troubleshooting

Common Issues

Secret Not Syncing:

  • Verify VaultAuth is configured correctly
  • Check Vault policies allow read access to the secret path
  • Review VSO operator logs: kubectl logs -n vault-secrets-operator-system deployment/vault-secrets-operator-controller-manager

Authentication Failures:

  • Ensure Kubernetes auth is enabled in Vault: vault auth enable kubernetes
  • Verify the service account has proper RBAC permissions
  • Check the VaultAuth resource status: kubectl describe vaultauth <name>

Certificate Renewal Issues:

  • Verify expiryOffset is less than certificate TTL
  • Check PKI role configuration in Vault
  • Ensure network connectivity to Vault

Values

KeyTypeDefaultDescription
extraObjectslist[]Add extra specs dynamically to this chart.
fullnameOverridestring""String to fully override the default application name.
nameOverridestring""Provide a name in place of the default application name.
vaultAuthobject{}
vaultAuthDefaults.methodstring""Method of every VaultAuth that leaves its own method empty. Rendered through tpl with the chart's root context, so it can follow a global (see "Login Method from a Global").
vaultAuthDefaults.mountstring""Mount of every VaultAuth that leaves its own mount empty and resolves to the method above; an entry that names another method names its mount too. Rendered through tpl with the chart's root context.
vaultConnectionobject{}
vaultDynamicSecretsobject{}
vaultPKISecretsobject{}
vaultStaticSecretDefaults.mountstring""Mount of every static secret that leaves its own mount empty. Rendered through tpl with the chart's root context, like the entries' own mount.
vaultStaticSecretDefaults.pathstring""Path of every static secret that leaves its own path empty. Rendered through tpl with the chart's root context, like the entries' own path; a template that renders empty leaves the secret without a path, which fails the render.
vaultStaticSecretsobject{}
vso.enabledboolfalseEnable deployment of Vault Secrets Operator.

Maintainers

NameEmailUrl
this-is-tobi[email protected]https://this-is-tobi.com

Sources

Official Documentation:

Source Code:


Autogenerated from chart metadata using helm-docs v1.14.2

Deploy vso-utils with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has vso-utils on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartvso-utils is pinned at v2.4.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply