I've created some secrets and I'm trying to import the file in this way:
apiVersion: v1
kind: Secret
metadata:
name: {{ template "amq.broker.fullname" . }}-tls
labels:
app: {{ template "amq.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
component: "{{ .Values.broker.name }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{ (.Files.Glob "secrets/broker.ks").AsSecrets | indent 2 }}
The file is under the secrets dir. When I run the install, the broker.ks secret is not there. However the secret is under the secrets folder. Any idea?
Here the dir struct
├── Chart.yaml
├── README.md
├── secrets
│ ├── broker.ks
│ ├── broker_cert
│ ├── client.ks
│ └── client.ts
├── templates
│ ├── NOTES.txt
│ ├── _helpers.tpl
└── values.yaml
helm upgrade? What does the dir tree of your chart look like? - fishi0x01{{ .Files.Get "secrets/broker.ks" | b64enc | indent 2 }}work? Or do you require a glob pattern to target more secret files? - fishi0x01broker.ks: {{ .Files.Get "secrets/broker.ks" | b64enc }}- should lead to the same result, no matter what the content ofsecrets/broker.ksis. - fishi0x01