Mounting secrets as filesΒΆ
Follow the steps below to a mount secrets as a file in your microservice:
Add your file to
hasura secrets
.# Format: # hasura secret update <secret-key> -f <file-path> $ hasura secret update credvalue.json -f ~/creds/credvalue.json
Modify the
k8s.yaml
of your microservice (microservices/<microservice-name>/k8s.yaml
) to mount this secret as a file, instead of as an evironment variable.... spec: containers: - name: app image: my-image volumeMounts: - name: foo mountPath: "/etc/foo" readOnly: true volumes: - name: foo secret: secretName: hasura-secrets items: - key: credvalue.json path: credvalue.json
Your file will be available inside the microservice container as
/etc/foo/credvalue.json
.
Was this page helpful?