Add k8s auth endpoint to vault
This commit is contained in:
parent
42de9f3358
commit
15cfa5b48e
1 changed files with 10 additions and 0 deletions
10
000-scripts/vault-k8s-auth-endpoint.sh
Executable file
10
000-scripts/vault-k8s-auth-endpoint.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOST_IP=$(ip addr show eth0 | grep -Po 'inet \K[\d.]+')
|
||||
|
||||
kubectl config view --raw --minify --flatten --output='jsonpath={.clusters[].cluster.certificate-authority-data}' | base64 --decode > ca.crt
|
||||
|
||||
vault write auth/kubernetes/config \
|
||||
kubernetes_host=https://${HOST_IP}:6443 \
|
||||
kubernetes_ca_cert=@ca.crt
|
||||
rm ca.crt
|
Loading…
Reference in a new issue