Vault agent can't authenticate using k8s 1.22.5

i want to get my secret from vault, this is the first time to integrate vault (vault v1.10.3 ) with k8s in the same cluster and the same namespace.
I’m following this tuto, to get secret to the application but im getting always error

kubectl logs \
>     $(kubectl get pod -l app=orgchart -o jsonpath="{.items[0]}") \
>     --container vault-agent
error: container vault-agent is not valid for pod orgchart-798cbc6c76-szd9q

and in the log vault agent injector I’m getting :

[ERROR] handler: http: TLS handshake error from remote error: tls: bad certificate

for the certificate i get it using

kubectl config view --raw --minify --flatten  
--output 'jsonpath={.clusters[].cluster.certificate-authority-data}'
 | base64 --decode

any idea how to investigate more or how to solve it .

Hi there, please see my response on github: Vault agent can’t authenticate using k8s 1.22.5 · Issue #738 · hashicorp/vault-helm · GitHub

1 Like