diff options
author | Alexis de Talhouƫt <alexis.de_talhouet@bell.ca> | 2017-09-13 15:27:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-13 15:27:51 +0000 |
commit | e6b8c84f451473fa2edc6dc44c39c055fca392d5 (patch) | |
tree | 829f2f9050e83c9da2d88cf0bb1c7ac60c48c826 /kubernetes/oneclick | |
parent | d99d1d2956c3f5afac1dfc569a3389a445b179e9 (diff) | |
parent | 59ffd500ea34c201fbb3edc39e64655fa8381be0 (diff) |
Merge "moving certs and keys to k8s secrets"
Diffstat (limited to 'kubernetes/oneclick')
-rwxr-xr-x | kubernetes/oneclick/createAll.bash | 10 | ||||
-rwxr-xr-x | kubernetes/oneclick/deleteAll.bash | 14 |
2 files changed, 23 insertions, 1 deletions
diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash index 7be2e6a7de..5012a52d20 100755 --- a/kubernetes/oneclick/createAll.bash +++ b/kubernetes/oneclick/createAll.bash @@ -39,6 +39,14 @@ create_registry_key() { check_return_code $cmd } +create_certs_secret() { + if [ -d $LOCATION/config/certs/$i/ ]; then + printf "\nCreating certs and keys secret **********\n" + _CERTS_FILES=$(find $LOCATION/config/certs/$2/ -type f | awk '$0="--from-file="$0' ORS=' ') + kubectl create secret generic secret-$1-$2 $_CERTS_FILES -n $1-$2 + fi +} + create_onap_helm() { HELM_VALUES_ADDITION="" if [[ ! -z $HELM_VALUES_FILEPATH ]]; then @@ -132,6 +140,8 @@ for i in ${HELM_APPS[@]}; do printf "\nCreating registry secret **********\n" create_registry_key $NS $i ${NS}-docker-registry-key $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL + create_certs_secret $NS $i + printf "\nCreating deployments and services **********\n" create_onap_helm $NS $i $start diff --git a/kubernetes/oneclick/deleteAll.bash b/kubernetes/oneclick/deleteAll.bash index 40d070124a..f7c48fd18d 100755 --- a/kubernetes/oneclick/deleteAll.bash +++ b/kubernetes/oneclick/deleteAll.bash @@ -16,6 +16,13 @@ delete_registry_key() { kubectl --namespace $1-$2 delete secret ${1}-docker-registry-key } +delete_certs_secret() { + if [ -d $LOCATION/config/certs/$i/ ]; then + kubectl delete secret secret-$1-$2 -n $1-$2 + fi +} + + delete_app_helm() { helm delete $1-$2 --purge } @@ -36,8 +43,9 @@ EOF NS= INCL_SVC=false APP= +LOCATION="../" -while getopts ":n:u:s:a:" PARAM; do +while getopts ":n:u:s:a:l:" PARAM; do case $PARAM in u) usage @@ -53,6 +61,9 @@ while getopts ":n:u:s:a:" PARAM; do exit 1 fi ;; + l) + LOCATION=${OPTARG} + ;; ?) usage exit @@ -74,6 +85,7 @@ printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n" for i in ${HELM_APPS[@]}; do + delete_certs_secret $NS $i delete_app_helm $NS $i delete_namespace $NS $i |