Changes between Version 1 and Version 2 of k8s/HashiCorpVault
- Timestamp:
- 2024/06/26 10:50:45 (5 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
k8s/HashiCorpVault
v1 v2 24 24 #!/bin/sh 25 25 26 sleep 5 26 # Wwiting if vault server is not started. 27 while true ; 28 do 29 vault status 30 [[ $? -eq 1 ]] || break 31 done 32 33 # Initialize vault 27 34 vault operator init -key-shares=3 > /home/vault/init-tmp 35 36 37 # If Initialize is successed, keep seal-keys. 28 38 if [ $? -eq 0 ] 29 39 then … … 32 42 rm /home/vault/init-tmp 33 43 fi 44 45 # Unseal 34 46 for i in 1 2 3 35 47 do 36 48 vault operator unseal $(grep "Key $i" /vault/data/seal-keys |sed 's/Unseal Key '$i': //i') 37 49 done 38 kubectl create configmap myscript --from-file=init-unseal.sh -nvault39 50 }}} 40 51 … … 42 53 kubectl create ns vault 43 54 kubectl create configmap myscript --from-file=init-unseal.sh -nvault 44 helm install vaul t hashicorp/vault -nvault -f values.yaml55 helm install vaullt hashicorp/vault -nvault -f values.yaml 45 56 }}}