0

I have written a annotation using istio sidecar and have captured secret stored in vault location in an environment variable redis_auth. Question : How I print this value of redis_auth variable which got exported in helm chart or inside pod?

template:

metadata:
  annotations:
    sidecar.istio.io/inject: 'false'
    sidecar.istio.io/proxyCPU: 25m
    sidecar.istio.io/proxyMemory: 80Mi
    {{- if eq "azure" (lower .Values.cloudType) }}
    vault.hashicorp.com/agent-inject: "true"
    vault.hashicorp.com/role: {{ .Values.vaultRole | quote}}
    vault.hashicorp.com/agent-pre-populate-only: "false"
    vault.hashicorp.com/agent-init-first: "true"
    vault.hashicorp.com/secret-volume-path-redis-auth: "/etc/redis/certs"
    vault.hashicorp.com/agent-inject-file-redis-auth: "redis-auth"
    vault.hashicorp.com/agent-inject-secret-redis-auth: "kv/{{ .Values.vaultBasePath }}{{ .Values.redisCache }}"
    vault.hashicorp.com/agent-inject-template-redis-auth: |
      {{ "{{" }} with secret "kv/{{ .Values.vaultBasePath }}{{ .Values.redisCache }}" {{ "}}" }}
      export redis_auth={{ "{{" }} .Data.data.password {{ "}}" }}
      {{ "{{" }} end {{ "}}" }}
    {{ end }}

I tried doing shell command in container which is created for getting password from hashicorp vault but was not able to do it as container get into complete state very fast and cannot do shell on it further

0 Answers0