apiVersion: v1
kind: Pod
metadata:
name: secret-example-pod
spec:
containers:
- name: secret-test-container
image: busybox
command: [ "/bin/sh", "-c", "cat /etc/secret-volume/*" ]
volumeMounts:
# name must match the volume name below
- name: secret-volume
mountPath: /etc/secret-volume
readOnly: true
volumes:
- name: secret-volume
secret:
secretName: test-secret
restartPolicy: Never
apiVersion: v1
kind: Pod
metadata:name: secret-example-pod
spec:containers:-name: secret-test-container
image: busybox
command:["/bin/sh","-c","cat /etc/secret-volume/*"]volumeMounts:# name must match the volume name below-name: secret-volume
mountPath: /etc/secret-volume
readOnly:truevolumes:-name: secret-volume
secret:secretName: test-secret
restartPolicy: Never
Copy to ClipboardCopied!Toggle word wrapToggle overflow