Changes between Version 1 and Version 2 of k8s/HashiCorpVault


Ignore:
Timestamp:
2024/06/26 10:50:45 (5 months ago)
Author:
yuna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • k8s/HashiCorpVault

    v1 v2  
    2424#!/bin/sh 
    2525 
    26 sleep 5 
     26# Wwiting if vault server is not started. 
     27while true ; 
     28do 
     29        vault status  
     30        [[ $? -eq 1 ]] || break 
     31done 
     32 
     33# Initialize vault 
    2734vault operator init -key-shares=3 > /home/vault/init-tmp 
     35 
     36 
     37# If Initialize is successed, keep seal-keys. 
    2838if [ $? -eq 0 ] 
    2939then 
     
    3242        rm /home/vault/init-tmp 
    3343fi 
     44 
     45# Unseal 
    3446for i in 1 2 3 
    3547do 
    3648        vault operator unseal $(grep "Key $i" /vault/data/seal-keys |sed 's/Unseal Key '$i': //i')  
    3749done 
    38 kubectl create configmap myscript  --from-file=init-unseal.sh  -nvault 
    3950}}} 
    4051 
     
    4253kubectl create ns vault 
    4354kubectl create configmap myscript  --from-file=init-unseal.sh  -nvault 
    44 helm install vault hashicorp/vault -nvault -f values.yaml 
     55helm install vaullt hashicorp/vault -nvault -f values.yaml 
    4556}}}