Skip to content

Create a Kubernetes Secret from an encrypted dotenv file results in stringData instead of data  #260

@tomklapka

Description

@tomklapka

Create a Kubernetes Secret from an encrypted dotenv file ganerates a secret with stringData content e.g.:

apiVersion: viaduct.ai/v1
kind: ksops
metadata:
  name: secret-generator
  annotations:
    config.kubernetes.io/function: |
      exec:
        path: ksops
secretFrom:
  - metadata:
      name: xyz-secrets
      annotations:
        kustomize.config.k8s.io/behavior: merge
        kustomize.config.k8s.io/needs-hash: "true"
    envs:
      - .secrets.enc.env

But Kustomize SecretGenerator generates secret with data content:
Also in Kustomize doc (https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kustomize/) is a following note: The stringData field for a Secret does not work well with server-side apply.

It makes sense to me keeping up with Kustomize.

kustomize v5.3.0
kops v4.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions