diff options
author | kerenj <keren.joseph@amdocs.com> | 2017-08-24 13:54:21 +0000 |
---|---|---|
committer | kerenj <keren.joseph@amdocs.com> | 2017-08-24 13:54:35 +0000 |
commit | 80102849bc4a8920f84fb4798d19d28e2a91da1b (patch) | |
tree | 0a1ca19a049ac53dfe5591262ff9a4617e3a6eae | |
parent | fdc176253250ac0100a15b0d08fe752e2b5cb701 (diff) |
sdc K8S-Helm Parameterization
changed sdc k8s deployment to support helm parameterization. updated create/delete for helm only
Issue-ID: OOM-52
Change-Id: Ic7fb17fcf5be5813b0a0c54299cdf0d0417e8a76
Signed-off-by: kerenj <keren.joseph@amdocs.com>
-rwxr-xr-x | kubernetes/oneclick/createAll.bash | 52 | ||||
-rwxr-xr-x | kubernetes/oneclick/deleteAll.bash | 22 | ||||
-rw-r--r-- | kubernetes/oneclick/setenv.bash | 3 | ||||
-rw-r--r-- | kubernetes/sdc/Chart.yaml | 4 | ||||
-rw-r--r-- | kubernetes/sdc/templates/all-services.yaml (renamed from kubernetes/sdc/all-services.yaml) | 5 | ||||
-rw-r--r-- | kubernetes/sdc/templates/sdc-be.yaml (renamed from kubernetes/sdc/sdc-be.yaml) | 20 | ||||
-rw-r--r-- | kubernetes/sdc/templates/sdc-cs.yaml (renamed from kubernetes/sdc/sdc-cs.yaml) | 14 | ||||
-rw-r--r-- | kubernetes/sdc/templates/sdc-es.yaml (renamed from kubernetes/sdc/sdc-es.yaml) | 10 | ||||
-rw-r--r-- | kubernetes/sdc/templates/sdc-fe.yaml (renamed from kubernetes/sdc/sdc-fe.yaml) | 18 | ||||
-rw-r--r-- | kubernetes/sdc/templates/sdc-kb.yaml (renamed from kubernetes/sdc/sdc-kb.yaml) | 12 | ||||
-rw-r--r-- | kubernetes/sdc/values.yaml | 9 |
11 files changed, 72 insertions, 97 deletions
diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash index 7e2969760a..95dd809027 100755 --- a/kubernetes/oneclick/createAll.bash +++ b/kubernetes/oneclick/createAll.bash @@ -8,7 +8,6 @@ usage() { Usage: $0 [PARAMs] -u : Display usage -n [NAMESPACE] : Kubernetes namespace (required) --s false : Exclude services (default: true) -i [INSTANCE] : ONAP deployment instance # (default: 1) -a [APP] : Specify a specific ONAP component (default: all) from the following choices: @@ -25,14 +24,6 @@ create_registry_key() { kubectl --namespace $1-$2 create secret docker-registry $3 --docker-server=$4 --docker-username=$5 --docker-password=$6 --docker-email=$7 } -create_service() { - sed -i-- 's/nodePort: [0-9]\{2\}[02468]\{1\}/nodePort: '"$3"'/g' ../$2/all-services.yaml - sed -i-- 's/nodePort: [0-9]\{2\}[13579]\{1\}/nodePort: '"$4"'/g' ../$2/all-services.yaml - kubectl --namespace $1-$2 create -f ../$2/all-services.yaml - mv ../$2/all-services.yaml-- ../$2/all-services.yaml -} - - create_onap_helm() { helm install ../$2/ --name $2 } @@ -84,9 +75,6 @@ while getopts ":n:u:s:i:a:du:dp:" PARAM; do n) NS=${OPTARG} ;; - s) - INCL_SVC=${OPTARG} - ;; i) INSTANCE=${OPTARG} ;; @@ -116,46 +104,26 @@ if [[ -z $NS ]]; then fi if [[ ! -z "$APP" ]]; then - ONAP_APPS=($APP) + HELM_APPS=($APP) fi -if [[ "$INCL_SVC" == true ]]; then - - if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then - printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n" - printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n" - exit 1 - fi - - start=$((300+2*INSTANCE)) - end=$((start+1)) - printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n" +if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then + printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n" + printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n" + exit 1 fi -printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n" +start=$((300+2*INSTANCE)) +end=$((start+1)) -for i in ${ONAP_APPS[@]}; do - printf "\nCreating namespace **********\n" - create_namespace $NS $i +printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n" - printf "\nCreating registry secret **********\n" - create_registry_key $NS $i $ONAP_DOCKER_REGISTRY_KEY $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL - if [[ "$INCL_SVC" == true ]]; then - printf "\nCreating service **********\n" - create_service $NS $i $start $end - fi +printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n" - printf "\n" -done -printf "\n\n********** Creating deployments for ${ONAP_APPS[*]} ********** \n" -for i in ${ONAP_APPS[@]}; do - _FILES_PATH=$(echo ../$i) - configure_app $NS $i $_FILES_PATH $start $end - /bin/bash $i.sh $NS $i 'create' -done +printf "\n\n********** Creating deployments for ${HELM_APPS[*]} ********** \n" for i in ${HELM_APPS[@]}; do printf "\nCreating namespace **********\n" diff --git a/kubernetes/oneclick/deleteAll.bash b/kubernetes/oneclick/deleteAll.bash index ad7f060d12..dfa75b59c4 100755 --- a/kubernetes/oneclick/deleteAll.bash +++ b/kubernetes/oneclick/deleteAll.bash @@ -16,10 +16,6 @@ delete_registry_key() { kubectl --namespace $1-$2 delete secret onap-docker-registry-key } -delete_service() { - kubectl --namespace $1-$2 delete -f ../$2/all-services.yaml -} - delete_app_helm() { helm delete $1 --purge } @@ -29,7 +25,6 @@ usage() { Usage: $0 [PARAMs] -u : Display usage -n [NAMESPACE] : Kubernetes namespace (required) --s true : Include services (default: false) -a [APP] : Specify a specific ONAP component (default: all) from the following choices: sdc, aai ,mso, message-router, robot, @@ -51,9 +46,6 @@ while getopts ":n:u:s:a:" PARAM; do n) NS=${OPTARG} ;; - s) - INCL_SVC=${OPTARG} - ;; a) APP=${OPTARG} if [[ -z $APP ]]; then @@ -74,23 +66,11 @@ if [[ -z $NS ]]; then fi if [[ ! -z "$APP" ]]; then - ONAP_APPS=($APP) + HELM_APPS=($APP) fi printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n" -for i in ${ONAP_APPS[@]}; do - - # delete the deployments - /bin/bash $i.sh $NS $i 'delete' - - if [[ "$INCL_SVC" == true ]]; then - printf "\nDeleting services **********\n" - delete_service $NS $i - delete_namespace $NS $i - fi - -done for i in ${HELM_APPS[@]}; do diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash index 996a8755b5..c7f3aba024 100644 --- a/kubernetes/oneclick/setenv.bash +++ b/kubernetes/oneclick/setenv.bash @@ -1,7 +1,6 @@ #!/bin/bash -HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'appc' 'aai') -ONAP_APPS=('sdc') +HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'appc' 'aai' 'sdc') ONAP_DOCKER_REGISTRY_KEY=${ONAP_DOCKER_REGISTRY_KEY:-onap-docker-registry-key} ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001} ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker} diff --git a/kubernetes/sdc/Chart.yaml b/kubernetes/sdc/Chart.yaml new file mode 100644 index 0000000000..668a9a641e --- /dev/null +++ b/kubernetes/sdc/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: A Helm chart for Kubernetes +name: sdc +version: 0.1.0 diff --git a/kubernetes/sdc/all-services.yaml b/kubernetes/sdc/templates/all-services.yaml index 1d832f0c4f..25ca65e0da 100644 --- a/kubernetes/sdc/all-services.yaml +++ b/kubernetes/sdc/templates/all-services.yaml @@ -4,6 +4,7 @@ metadata: labels: app: sdc-es name: sdc-es + namespace: {{ .Values.NS }} spec: ports: - name: sdc-es-port-9200 @@ -20,6 +21,7 @@ metadata: labels: app: sdc-cs name: sdc-cs + namespace: {{ .Values.NS }} spec: ports: - name: sdc-cs-port-9042 @@ -36,6 +38,7 @@ metadata: labels: app: sdc-kb name: sdc-kb + namespace: {{ .Values.NS }} spec: ports: - name: sdc-kb-port-5601 @@ -50,6 +53,7 @@ metadata: labels: app: sdc-be name: sdc-be + namespace: {{ .Values.NS }} spec: ports: - name: sdc-be-port-8443 @@ -68,6 +72,7 @@ metadata: labels: app: sdc-fe name: sdc-fe + namespace: {{ .Values.NS }} spec: ports: - name: sdc-fe-port-9443 diff --git a/kubernetes/sdc/sdc-be.yaml b/kubernetes/sdc/templates/sdc-be.yaml index ac2378cb60..96fee818da 100644 --- a/kubernetes/sdc/sdc-be.yaml +++ b/kubernetes/sdc/templates/sdc-be.yaml @@ -4,6 +4,7 @@ metadata: labels: app: sdc-be name: sdc-be + namespace: {{ .Values.NS }} spec: selector: matchLabels: @@ -38,8 +39,8 @@ spec: } } ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", "name": "sdc-be-readiness" }, { @@ -56,8 +57,8 @@ spec: "value": "onap-message-router" } ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", "name": "sdc-dmaap-readiness" } ]' @@ -70,7 +71,8 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - image: nexus3.onap.org:10001/openecomp/sdc-backend:1.1-STAGING-latest + image: {{ .Values.image.sdcBackend }} + imagePullPolicy: {{ .Values.pullPolicy }} name: sdc-be volumeMounts: - mountPath: /usr/share/elasticsearch/data/ @@ -94,18 +96,18 @@ spec: volumes: - name: sdc-sdc-es-es hostPath: - path: /dockerdata-nfs/onapdemo/sdc/sdc-es/ES + path: /dockerdata-nfs/onap/sdc/sdc-es/ES - name: sdc-environments hostPath: - path: /dockerdata-nfs/onapdemo/sdc/environments + path: /dockerdata-nfs/onap/sdc/environments - name: sdc-jetty-keystore hostPath: - path: /dockerdata-nfs/onapdemo/sdc/jetty/keystore + path: /dockerdata-nfs/onap/sdc/jetty/keystore - name: sdc-localtime hostPath: path: /etc/localtime - name: sdc-logs hostPath: - path: /dockerdata-nfs/onapdemo/sdc/logs + path: /dockerdata-nfs/onap/sdc/logs imagePullSecrets: - name: onap-docker-registry-key diff --git a/kubernetes/sdc/sdc-cs.yaml b/kubernetes/sdc/templates/sdc-cs.yaml index 081bae459d..55a5613609 100644 --- a/kubernetes/sdc/sdc-cs.yaml +++ b/kubernetes/sdc/templates/sdc-cs.yaml @@ -4,6 +4,7 @@ metadata: labels: app: sdc-cs name: sdc-cs + namespace: {{ .Values.NS }} spec: selector: matchLabels: @@ -34,8 +35,8 @@ spec: } } ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", "name": "sdc-cs-readiness" } ]' @@ -50,7 +51,8 @@ spec: fieldPath: status.podIP - name: ES_HEAP_SIZE value: "1024M" - image: nexus3.onap.org:10001/openecomp/sdc-cassandra:1.1-STAGING-latest + image: {{ .Values.image.sdcCassandra }} + imagePullPolicy: {{ .Values.pullPolicy }} name: sdc-cs volumeMounts: - mountPath: /var/lib/cassandra/ @@ -72,15 +74,15 @@ spec: volumes: - name: sdc-sdc-cs-cs hostPath: - path: /dockerdata-nfs/onapdemo/sdc/sdc-cs/CS + path: /dockerdata-nfs/onap/sdc/sdc-cs/CS - name: sdc-environments hostPath: - path: /dockerdata-nfs/onapdemo/sdc/environments + path: /dockerdata-nfs/onap/sdc/environments - name: sdc-localtime hostPath: path: /etc/localtime - name: sdc-logs hostPath: - path: /dockerdata-nfs/onapdemo/sdc/logs + path: /dockerdata-nfs/onap/sdc/logs imagePullSecrets: - name: onap-docker-registry-key diff --git a/kubernetes/sdc/sdc-es.yaml b/kubernetes/sdc/templates/sdc-es.yaml index cfb5242141..f1dfb43f0b 100644 --- a/kubernetes/sdc/sdc-es.yaml +++ b/kubernetes/sdc/templates/sdc-es.yaml @@ -4,6 +4,7 @@ metadata: labels: app: sdc-es name: sdc-es + namespace: {{ .Values.NS }} spec: selector: matchLabels: @@ -15,7 +16,8 @@ spec: name: sdc-es spec: containers: - - image: nexus3.onap.org:10001/openecomp/sdc-elasticsearch:1.1-STAGING-latest + - image: {{ .Values.image.sdcElasticsearch }} + imagePullPolicy: {{ .Values.pullPolicy }} name: sdc-es env: - name: ENVNAME @@ -46,15 +48,15 @@ spec: volumes: - name: sdc-sdc-es-es hostPath: - path: /dockerdata-nfs/onapdemo/sdc/sdc-es/ES + path: /dockerdata-nfs/onap/sdc/sdc-es/ES - name: sdc-environments hostPath: - path: /dockerdata-nfs/onapdemo/sdc/environments + path: /dockerdata-nfs/onap/sdc/environments - name: sdc-localtime hostPath: path: /etc/localtime - name: sdc-logs hostPath: - path: /dockerdata-nfs/onapdemo/sdc/logs + path: /dockerdata-nfs/onap/sdc/logs imagePullSecrets: - name: onap-docker-registry-key diff --git a/kubernetes/sdc/sdc-fe.yaml b/kubernetes/sdc/templates/sdc-fe.yaml index 0711aa9dfd..a566b15a02 100644 --- a/kubernetes/sdc/sdc-fe.yaml +++ b/kubernetes/sdc/templates/sdc-fe.yaml @@ -4,6 +4,7 @@ metadata: labels: app: sdc-fe name: sdc-fe + namespace: {{ .Values.NS }} spec: selector: matchLabels: @@ -40,8 +41,8 @@ spec: } } ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", "name": "sdc-fe-readiness" } ]' @@ -55,7 +56,8 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - image: nexus3.onap.org:10001/openecomp/sdc-frontend:1.1-STAGING-latest + image: {{ .Values.image.sdcFrontend }} + imagePullPolicy: {{ .Values.pullPolicy }} volumeMounts: - mountPath: /usr/share/elasticsearch/data/ name: sdc-sdc-es-es @@ -80,21 +82,21 @@ spec: volumes: - name: sdc-sdc-es-es hostPath: - path: /dockerdata-nfs/onapdemo/sdc/sdc-es/ES + path: /dockerdata-nfs/onap/sdc/sdc-es/ES - name: sdc-environments hostPath: - path: /dockerdata-nfs/onapdemo/sdc/environments + path: /dockerdata-nfs/onap/sdc/environments - name: sdc-jetty-keystore hostPath: - path: /dockerdata-nfs/onapdemo/sdc/jetty/keystore + path: /dockerdata-nfs/onap/sdc/jetty/keystore - name: sdc-localtime hostPath: path: /etc/localtime - name: sdc-logs hostPath: - path: /dockerdata-nfs/onapdemo/sdc/logs + path: /dockerdata-nfs/onap/sdc/logs - name: sdc-fe-config hostPath: - path: /dockerdata-nfs/onapdemo/sdc/sdc-fe/FE_2_setup_configuration.rb + path: /dockerdata-nfs/onap/sdc/sdc-fe/FE_2_setup_configuration.rb imagePullSecrets: - name: onap-docker-registry-key diff --git a/kubernetes/sdc/sdc-kb.yaml b/kubernetes/sdc/templates/sdc-kb.yaml index 83483f7af3..0dca7e45a2 100644 --- a/kubernetes/sdc/sdc-kb.yaml +++ b/kubernetes/sdc/templates/sdc-kb.yaml @@ -4,6 +4,7 @@ metadata: labels: app: sdc-kb name: sdc-kb + namespace: {{ .Values.NS }} spec: selector: matchLabels: @@ -36,8 +37,8 @@ spec: } } ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", "name": "sdc-kb-readiness" } ]' @@ -48,7 +49,8 @@ spec: value: AUTO - name: ELASTICSEARCH_URL value: http://sdc-es:9200 - image: nexus3.onap.org:10001/openecomp/sdc-kibana:1.1-STAGING-latest + image: {{ .Values.image.sdcKibana }} + imagePullPolicy: {{ .Values.pullPolicy }} name: sdc-kb volumeMounts: - mountPath: /root/chef-solo/environments/ @@ -67,12 +69,12 @@ spec: volumes: - name: sdc-environments hostPath: - path: /dockerdata-nfs/onapdemo/sdc/environments + path: /dockerdata-nfs/onap/sdc/environments - name: sdc-localtime hostPath: path: /etc/localtime - name: sdc-logs hostPath: - path: /dockerdata-nfs/onapdemo/sdc/logs + path: /dockerdata-nfs/onap/sdc/logs imagePullSecrets: - name: onap-docker-registry-key diff --git a/kubernetes/sdc/values.yaml b/kubernetes/sdc/values.yaml new file mode 100644 index 0000000000..066f0d0afb --- /dev/null +++ b/kubernetes/sdc/values.yaml @@ -0,0 +1,9 @@ +NS: onap-sdc +pullPolicy: Always +image: + readiness: oomk8s/readiness-check:1.0.0 + sdcKibana: nexus3.onap.org:10001/openecomp/sdc-kibana:1.1-STAGING-latest + sdcFrontend: nexus3.onap.org:10001/openecomp/sdc-frontend:1.1-STAGING-latest + sdcElasticsearch: nexus3.onap.org:10001/openecomp/sdc-elasticsearch:1.1-STAGING-latest + sdcCassandra: nexus3.onap.org:10001/openecomp/sdc-cassandra:1.1-STAGING-latest + sdcBackend: nexus3.onap.org:10001/openecomp/sdc-backend:1.1-STAGING-latest |