[OOF] Update HAS charts to use etcd 02/121402/9
authorkrishnaa96 <krishna.moorthy6@wipro.com>
Tue, 18 May 2021 13:22:56 +0000 (18:52 +0530)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Fri, 28 May 2021 17:49:10 +0000 (17:49 +0000)
- Add etcd as a subchart
- Add configuration to switch between
  etcd and music
- Remove onboard and healthcheck jobs

Issue-ID: OPTFRA-953
Signed-off-by: Krishna moorthy <krishna.moorthy6@wipro.com>
Change-Id: I44c8b60c3bdb0282329b6f87c5011093055ea91f

18 files changed:
kubernetes/oof/components/oof-has/components/oof-has-api/templates/deployment.yaml
kubernetes/oof/components/oof-has/components/oof-has-api/values.yaml
kubernetes/oof/components/oof-has/components/oof-has-controller/templates/deployment.yaml
kubernetes/oof/components/oof-has/components/oof-has-controller/values.yaml
kubernetes/oof/components/oof-has/components/oof-has-data/templates/deployment.yaml
kubernetes/oof/components/oof-has/components/oof-has-data/values.yaml
kubernetes/oof/components/oof-has/components/oof-has-reservation/templates/deployment.yaml
kubernetes/oof/components/oof-has/components/oof-has-reservation/values.yaml
kubernetes/oof/components/oof-has/components/oof-has-solver/templates/deployment.yaml
kubernetes/oof/components/oof-has/components/oof-has-solver/values.yaml
kubernetes/oof/components/oof-has/requirements.yaml
kubernetes/oof/components/oof-has/resources/config/conductor.conf
kubernetes/oof/components/oof-has/resources/config/healthcheck.json [deleted file]
kubernetes/oof/components/oof-has/resources/config/onboard.json [deleted file]
kubernetes/oof/components/oof-has/templates/job-healthcheck.yaml [deleted file]
kubernetes/oof/components/oof-has/templates/job-onboard.yaml [deleted file]
kubernetes/oof/components/oof-has/values.yaml
kubernetes/oof/components/oof-templates/templates/_secret.tpl [new file with mode: 0644]

index 491250c..ba4a657 100755 (executable)
@@ -55,21 +55,6 @@ spec:
         image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
 
-      - name: {{ include "common.name" . }}-onboard-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-onboard"
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
       - name: {{ include "common.name" . }}-has-sms-readiness
         command:
         - sh
@@ -94,7 +79,7 @@ spec:
         - name: {{ include "common.name" . }}
           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.image.optf_has }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          command: ["/bin/bash","-c"]
+          command: ["/bin/sh","-c"]
           args: ["/usr/local/bin/uwsgi -s /run/conductor/uwsgi.sock --chmod-socket=777 --wsgi-file /etc/nginx/conductor.wsgi --callable application --set port={{ .Values.uwsgi.internalPort }} --die-on-term --exit-on-reload --pidfile /run/conductor/conductor-uwsgi.pid --enable-threads --workers 6 --master --vacuum --single-interpreter --socket-timeout 10 --max-worker-lifetime 300 --max-requests 100 --no-defer-accept --protocol=uwsgi --socket 0.0.0.0:{{ .Values.uwsgi.internalPort }}"]
           ports:
           - containerPort: {{ .Values.uwsgi.internalPort }}
@@ -112,7 +97,7 @@ spec:
               port: {{ .Values.uwsgi.internalPort }}
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
-          env:
+          env: {{ include "oof.etcd.env" . | nindent 10 }}
           volumeMounts:
           - mountPath: /etc/localtime
             name: localtime
index d6743cd..63461d9 100755 (executable)
@@ -16,7 +16,7 @@
 global: # global defaults
   nodePortPrefix: 302
   image:
-    optf_has: onap/optf-has:2.1.5
+    optf_has: onap/optf-has:2.2.0
 
 #################################################################
 # secrets metaconfig
@@ -26,6 +26,18 @@ secrets:
     externalSecret: '{{ tpl (default "" .Values.certSecret) . }}'
     type: generic
     filePaths: '{{ .Values.secretsFilePaths }}'
+  - uid: oof-has-etcd-secret
+    name: &user-creds '{{ include "common.release" . }}-oof-has-etcd-secret'
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.etcd.userCredentialsExternalSecret) . }}'
+    login: '{{ .Values.config.etcd.appUser }}'
+    password: '{{ .Values.config.etcd.appPassword }}'
+    passwordPolicy: required
+
+config:
+  etcd:
+    appUser: user
+    appPassword: pass
 
 service:
   type: NodePort
index 8e0ff1a..895a305 100755 (executable)
@@ -41,8 +41,8 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
-        - music-springboot
+        - --job-name
+        - {{ include "common.release" . }}-{{ .Values.config.etcd.configJobNameOverride }}-job
         - --container-name
         - aaf-sms
         env:
@@ -54,21 +54,6 @@ spec:
         image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
 
-      - name: {{ include "common.name" . }}-onboard-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-onboard"
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
       - name: {{ include "common.name" . }}-cont-sms-readiness
         command:
         - sh
@@ -114,7 +99,7 @@ spec:
               - /usr/local/bin/healthy.sh
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
-          env:
+          env: {{ include "oof.etcd.env" . | nindent 10 }}
           volumeMounts:
           - mountPath: /etc/localtime
             name: localtime
index 3cbf96a..9e799e1 100755 (executable)
@@ -14,7 +14,7 @@
 
 global:
   image:
-    optf_has: onap/optf-has:2.1.5
+    optf_has: onap/optf-has:2.2.0
 
 #################################################################
 # Secrets metaconfig
@@ -24,6 +24,18 @@ secrets:
     externalSecret: '{{ tpl (default "" .Values.certSecret) . }}'
     type: generic
     filePaths: '{{ .Values.secretsFilePaths }}'
+  - uid: oof-has-etcd-secret
+    name: &user-creds '{{ include "common.release" . }}-oof-has-etcd-secret'
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.etcd.userCredentialsExternalSecret) . }}'
+    login: '{{ .Values.config.etcd.appUser }}'
+    password: '{{ .Values.config.etcd.appPassword }}'
+    passwordPolicy: required
+
+config:
+  etcd:
+    appUser: user
+    appPassword: pass
 
 ingress:
   enabled: false
index f4ccd57..cc4eaf0 100755 (executable)
@@ -41,38 +41,8 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
-        - music-springboot
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
-      - name: {{ include "common.name" . }}-onboard-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-onboard"
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
-      - name: {{ include "common.name" . }}-health-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-healthcheck"
+        - --job-name
+        - {{ include "common.release" . }}-{{ .Values.config.etcd.configJobNameOverride }}-job
         env:
         - name: NAMESPACE
           valueFrom:
@@ -128,7 +98,7 @@ spec:
               - /usr/local/bin/healthy.sh
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
-          env:
+          env: {{ include "oof.etcd.env" . | nindent 10 }}
           volumeMounts:
           - mountPath: /etc/localtime
             name: localtime
index 0940a9d..915ffc0 100755 (executable)
@@ -14,7 +14,7 @@
 
 global:
   image:
-    optf_has: onap/optf-has:2.1.5
+    optf_has: onap/optf-has:2.2.0
 
 #################################################################
 # secrets metaconfig
@@ -24,6 +24,18 @@ secrets:
     externalSecret: '{{ tpl (default "" .Values.certSecret) . }}'
     type: generic
     filePaths: '{{ .Values.secretsFilePaths }}'
+  - uid: oof-has-etcd-secret
+    name: &user-creds '{{ include "common.release" . }}-oof-has-etcd-secret'
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.etcd.userCredentialsExternalSecret) . }}'
+    login: '{{ .Values.config.etcd.appUser }}'
+    password: '{{ .Values.config.etcd.appPassword }}'
+    passwordPolicy: required
+
+config:
+  etcd:
+    appUser: user
+    appPassword: pass
 
 ingress:
   enabled: false
index 4d04b6f..095162b 100755 (executable)
@@ -41,38 +41,8 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
-        - music-springboot
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
-      - name: {{ include "common.name" . }}-onboard-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-onboard"
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
-      - name: {{ include "common.name" . }}-health-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-healthcheck"
+        - --job-name
+        - {{ include "common.release" . }}-{{ .Values.config.etcd.configJobNameOverride }}-job
         env:
         - name: NAMESPACE
           valueFrom:
@@ -128,7 +98,7 @@ spec:
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           {{ end -}}
-          env:
+          env: {{ include "oof.etcd.env" . | nindent 10 }}
           volumeMounts:
           - mountPath: /etc/localtime
             name: localtime
index 0940a9d..915ffc0 100755 (executable)
@@ -14,7 +14,7 @@
 
 global:
   image:
-    optf_has: onap/optf-has:2.1.5
+    optf_has: onap/optf-has:2.2.0
 
 #################################################################
 # secrets metaconfig
@@ -24,6 +24,18 @@ secrets:
     externalSecret: '{{ tpl (default "" .Values.certSecret) . }}'
     type: generic
     filePaths: '{{ .Values.secretsFilePaths }}'
+  - uid: oof-has-etcd-secret
+    name: &user-creds '{{ include "common.release" . }}-oof-has-etcd-secret'
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.etcd.userCredentialsExternalSecret) . }}'
+    login: '{{ .Values.config.etcd.appUser }}'
+    password: '{{ .Values.config.etcd.appPassword }}'
+    passwordPolicy: required
+
+config:
+  etcd:
+    appUser: user
+    appPassword: pass
 
 ingress:
   enabled: false
index 6079dcf..d664ca0 100755 (executable)
@@ -41,38 +41,8 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
-        - music-springboot
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
-      - name: {{ include "common.name" . }}-onboard-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-onboard"
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-
-      - name: {{ include "common.name" . }}-health-readiness
-        command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-oof-has-healthcheck"
+        - --job-name
+        - {{ include "common.release" . }}-{{ .Values.config.etcd.configJobNameOverride }}-job
         env:
         - name: NAMESPACE
           valueFrom:
@@ -128,7 +98,7 @@ spec:
               - /usr/local/bin/healthy.sh
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
-          env:
+          env: {{ include "oof.etcd.env" . | nindent 10 }}
           volumeMounts:
           - mountPath: /etc/localtime
             name: localtime
index 0940a9d..915ffc0 100755 (executable)
@@ -14,7 +14,7 @@
 
 global:
   image:
-    optf_has: onap/optf-has:2.1.5
+    optf_has: onap/optf-has:2.2.0
 
 #################################################################
 # secrets metaconfig
@@ -24,6 +24,18 @@ secrets:
     externalSecret: '{{ tpl (default "" .Values.certSecret) . }}'
     type: generic
     filePaths: '{{ .Values.secretsFilePaths }}'
+  - uid: oof-has-etcd-secret
+    name: &user-creds '{{ include "common.release" . }}-oof-has-etcd-secret'
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.etcd.userCredentialsExternalSecret) . }}'
+    login: '{{ .Values.config.etcd.appUser }}'
+    password: '{{ .Values.config.etcd.appPassword }}'
+    passwordPolicy: required
+
+config:
+  etcd:
+    appUser: user
+    appPassword: pass
 
 ingress:
   enabled: false
index 851211a..7310aac 100755 (executable)
@@ -20,6 +20,15 @@ dependencies:
   - name: music
     version: ~8.x-0
     repository: '@local'
+    condition: music.enabled
+  - name: etcd
+    version: ~8.x-0
+    repository: '@local'
+    condition: etcd.enabled
+  - name: etcd-init
+    version: ~8.x-0
+    repository: '@local'
+    condition: etcd-init.enabled
   - name: oof-has-api
     version: ~8.x-0
     repository: 'file://components/oof-has-api'
index ded979c..18b60bb 100755 (executable)
@@ -424,6 +424,30 @@ server_url = http://{{.Values.config.msb.serviceName}}.{{ include "common.namesp
 #server_url_version = v0
 
 
+[db_options]
+
+# db_backend to use
+db_backend = {{.Values.config.dbBackend}}
+
+# Use music mock api
+music_mock = False
+
+
+[etcd_api]
+
+# host/ip address of etcd server
+host = {{.Values.config.etcd.serviceName}}.{{ include "common.namespace" . }}
+
+# port of etcd server
+port = {{.Values.config.etcd.port}}
+
+# username for etcd authentication
+username =
+
+# password for etcd authentication
+password =
+
+
 [music_api]
 
 #
diff --git a/kubernetes/oof/components/oof-has/resources/config/healthcheck.json b/kubernetes/oof/components/oof-has/resources/config/healthcheck.json
deleted file mode 100755 (executable)
index 833fa0f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "consistencyInfo": {
-    "type": "eventual"
-  },
-  "values": {
-    "id": "healthcheck",
-    "created": 1479482603641,
-    "message": "",
-    "name": "foo",
-    "recommend_max": 1,
-    "solution": "{\"healthcheck\": \" healthcheck\"}",
-    "status": "solved",
-    "template": "{\"healthcheck\": \"healthcheck\"}",
-    "timeout": 3600,
-    "translation": "{\"healthcheck\": \" healthcheck\"}",
-    "updated": 1484324150629
-  }
-}
diff --git a/kubernetes/oof/components/oof-has/resources/config/onboard.json b/kubernetes/oof/components/oof-has/resources/config/onboard.json
deleted file mode 100755 (executable)
index 2c3d69b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "appname": "conductor",
-  "userId": "conductor",
-  "isAAF": "false",
-  "password": "c0nduct0r"
-}
diff --git a/kubernetes/oof/components/oof-has/templates/job-healthcheck.yaml b/kubernetes/oof/components/oof-has/templates/job-healthcheck.yaml
deleted file mode 100755 (executable)
index 49406ba..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-{{/*
-# Copyright 2018 Intel Corporation, Inc
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-*/}}
-
-apiVersion: batch/v1
-kind: Job
-metadata:
-  name: {{ include "common.fullname" . }}-healthcheck
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
-spec:
-  replicas: {{ .Values.replicaCount }}
-  template:
-    metadata:
-      labels:
-        app: {{ include "common.name" . }}
-        release: {{ include "common.release" . }}
-    spec:
-      initContainers:
-      - image:  {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}-readiness
-        command:
-        - /app/ready.py
-        args:
-        - --container-name
-        - oof-has-api
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-      containers:
-      - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.image.optf_has }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}-healthcheck
-        command:
-          - "/bin/sh"
-          - "-c"
-          - |
-             echo "INSERT HEALTHCHECK PLAN";
-             sleep 15;
-             resp="FAILURE";
-             until [ $resp = "200" ]; do
-             resp=$(curl -k -s -o /dev/null --write-out %{http_code} -X POST https://{{.Values.config.music.serviceName}}.{{ include "common.namespace" . }}:{{.Values.config.music.port}}/MUSIC/rest/v2/keyspaces/conductor/tables/plans/rows?id=healthcheck \
-             -H "Content-Type: application/json" \
-             -H "ns: conductor" \
-             -H "Authorization: Basic Y29uZHVjdG9yOmMwbmR1Y3Qwcg==" \
-             --data @healthcheck.json);
-             echo $resp;
-             sleep 2;
-             done;
-        workingDir: /has
-        volumeMounts:
-          - mountPath: /etc/localtime
-            name: localtime
-            readOnly: true
-          - mountPath: /has/healthcheck.json
-            name: {{ .Values.global.commonConfigPrefix }}-config
-            subPath: healthcheck.json
-        resources:
-{{ include "common.resources" . | indent 10 }}
-      nodeSelector:
-        {{- if .Values.nodeSelector }}
-{{ toYaml .Values.nodeSelector | indent 8 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-      affinity:
-{{ toYaml .Values.affinity | indent 8 }}
-        {{- end }}
-      volumes:
-      - name: localtime
-        hostPath:
-          path: /etc/localtime
-      - name: {{ .Values.global.commonConfigPrefix }}-config
-        configMap:
-          name: {{ .Values.global.commonConfigPrefix }}-configmap
-          items:
-          - key: healthcheck.json
-            path: healthcheck.json
-      restartPolicy: OnFailure
-      imagePullSecrets:
-      - name: "{{ include "common.namespace" . }}-docker-registry-key"
diff --git a/kubernetes/oof/components/oof-has/templates/job-onboard.yaml b/kubernetes/oof/components/oof-has/templates/job-onboard.yaml
deleted file mode 100755 (executable)
index e63aeb3..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-{{/*
-# Copyright 2018 Intel Corporation, Inc
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-*/}}
-
-apiVersion: batch/v1
-kind: Job
-metadata:
-  name: {{ include "common.fullname" . }}-onboard
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
-spec:
-  replicas: {{ .Values.replicaCount }}
-  template:
-    metadata:
-      labels:
-        app: {{ include "common.name" . }}
-        release: {{ include "common.release" . }}
-    spec:
-      initContainers:
-      - image:  {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}-readiness
-        command:
-        - /app/ready.py
-        args:
-        - --container-name
-        - "music-springboot"
-        - --container-name
-        - "music-cassandra"
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-      - command:
-        - /app/ready.py
-        args:
-        - -j
-        - "{{ include "common.release" . }}-music-cassandra-config"
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: {{ include "repositoryGenerator.image.readiness" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}-music-db-readiness
-      containers:
-      - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.image.optf_has }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}-onboard
-        command:
-          - "/bin/sh"
-          - "-c"
-          - |
-             echo "job-onboard"
-        workingDir: /has
-        volumeMounts:
-          - mountPath: /etc/localtime
-            name: localtime
-            readOnly: true
-          - mountPath: /has/onboard.json
-            name: {{ .Values.global.commonConfigPrefix }}-config
-            subPath: onboard.json
-        resources:
-{{ include "common.resources" . | indent 10 }}
-      nodeSelector:
-        {{- if .Values.nodeSelector }}
-{{ toYaml .Values.nodeSelector | indent 8 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-      affinity:
-{{ toYaml .Values.affinity | indent 8 }}
-        {{- end }}
-      volumes:
-      - name: localtime
-        hostPath:
-          path: /etc/localtime
-      - name: {{ .Values.global.commonConfigPrefix }}-config
-        configMap:
-          name: {{ .Values.global.commonConfigPrefix }}-configmap
-          items:
-          - key: onboard.json
-            path: onboard.json
-      restartPolicy: OnFailure
-      imagePullSecrets:
-      - name: "{{ include "common.namespace" . }}-docker-registry-key"
index 3615a3b..9a8b605 100755 (executable)
@@ -19,7 +19,7 @@
 global:
   commonConfigPrefix: onap-oof-has
   image:
-    optf_has: onap/optf-has:2.1.5
+    optf_has: onap/optf-has:2.2.0
   persistence:
     enabled: true
 
@@ -32,11 +32,24 @@ secrets:
     externalSecret: '{{ tpl (default "" .Values.certSecret) . }}'
     type: generic
     filePaths: '{{ .Values.secretsFilePaths }}'
+  - uid: oof-has-etcd-root-password
+    name: &root-password '{{ include "common.release" . }}-has-etcd-root-password'
+    type: password
+    password: '{{ .Values.config.etcd.rootPassword }}'
+    policy: generate
+  - uid: oof-has-etcd-secret
+    name: &user-creds '{{ include "common.release" . }}-oof-has-etcd-secret'
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.etcd.userCredentialsExternalSecret) . }}'
+    login: '{{ .Values.config.etcd.appUser }}'
+    password: '{{ .Values.config.etcd.appPassword }}'
+    passwordPolicy: generate
 
 pullPolicy: Always
 nodePortPrefix: 302
 dataRootDir: /dockerdata-nfs
 config:
+  dbBackend: etcd
   aaf:
     serviceName: aaf-service
     port: 8100
@@ -58,6 +71,13 @@ config:
   cps:
     service: cps-tbdmt
     port: 8080
+  etcd:
+    serviceName: &etcd-service oof-has-etcd
+    port: 2379
+    appUser: conductor
+#    rootPassword:
+#    appPassword:
+#    userCredentialsExternalSecret:
 # Resource Limit flavor -By Default using small
 flavor: small
 # Segregation for Different environment (Small and Large)
@@ -79,19 +99,59 @@ resources:
   unlimited: {}
 
 #component overrides
-oof-has-api:
+oof-has-api: &has-config
   enabled: true
   certSecret: *oof-certs
-oof-has-controller:
-  enabled: true
-  certSecret: *oof-certs
-oof-has-data:
-  enabled: true
-  certSecret: *oof-certs
-oof-has-reservation:
-  enabled: true
-  certSecret: *oof-certs
-oof-has-solver:
+  config:
+    etcd:
+      userCredentialsExternalSecret: *user-creds
+      configJobNameOverride: &job-name oof-has-etcd-config
+oof-has-controller: *has-config
+oof-has-data: *has-config
+oof-has-reservation: *has-config
+oof-has-solver: *has-config
+music:
+  enabled: false
+
+#etcd subchart configurations
+etcd:
   enabled: true
-  certSecret: *oof-certs
+  replicaCount: 3
+  nameOverride: &etcd-container oof-has-etcd
+  service:
+    name: *etcd-service
+  persistence:
+    mountSubPath: oof/etcd/data
+    enabled: true
+  flavor: &etcd-flavor large
+  resources: &etcd-resources
+    small:
+      limits:
+        cpu: 100m
+        memory: 300Mi
+      requests:
+        cpu: 10m
+        memory: 75Mi
+    large:
+      limits:
+        cpu: 200m
+        memory: 1Gi
+      requests:
+        cpu: 50m
+        memory: 300Mi
+    unlimited: {}
 
+etcd-init:
+  enabled: true
+  nameOverride: *job-name
+  etcd:
+    serviceName: *etcd-service
+    port : 2379
+    containerName: *etcd-container
+  config:
+    userRootSecret: *root-password
+    userCredentialsExternalSecret: *user-creds
+    appRole: conductor
+    keyPrefix: conductor
+  flavor: *etcd-flavor
+  resources: *etcd-resources
diff --git a/kubernetes/oof/components/oof-templates/templates/_secret.tpl b/kubernetes/oof/components/oof-templates/templates/_secret.tpl
new file mode 100644 (file)
index 0000000..0b04f71
--- /dev/null
@@ -0,0 +1,6 @@
+{{- define "oof.etcd.env" -}}
+- name: OS_ETCD_API__USERNAME
+  {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "oof-has-etcd-secret" "key" "login") | indent 2 }}
+- name: OS_ETCD_API__PASSWORD
+  {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "oof-has-etcd-secret" "key" "password") | indent 2 }}
+{{- end -}}
\ No newline at end of file