· 6 years ago · Aug 11, 2019, 11:18 AM
1initContainers:
2 es-check: # <- will be used as container name
3 image: "appropriate/curl:latest"
4 imagePullPolicy: "IfNotPresent"
5 command:
6 - "/bin/sh"
7 - "-c"
8 - |
9 is_down=true
10 while "$is_down"; do
11 if curl -X PUT $HOSTNAME:9200/_snapshot/s3_repository -H 'Content-Type:application/json' -d \'{ \"type\": \"s3\", \"settings\": {\"bucket\": \"${bucket_name}\", \"region\": \"${region}\", \"server_side_encryption\": \"true\", \"access_key\": \"${access_key}\", \"secret_key\": \"${secret_key}\" }}'; then
12 is_down=false
13 else
14 sleep 5
15 fi
16 done