Merge "Fix typo in cadi path"
authorJames MacNider <James.MacNider@amdocs.com>
Thu, 11 Apr 2019 14:15:40 +0000 (14:15 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 11 Apr 2019 14:15:40 +0000 (14:15 +0000)
25 files changed:
kubernetes/appc/charts/appc-ansible-server/templates/pv.yaml [new file with mode: 0644]
kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml [moved from kubernetes/appc/charts/appc-ansible-server/templates/deployment.yaml with 83% similarity]
kubernetes/appc/charts/appc-ansible-server/values.yaml
kubernetes/common/mongo/values.yaml
kubernetes/common/nfs-provisioner/Chart.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/requirements.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/templates/service.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/values.yaml [new file with mode: 0644]
kubernetes/dmaap/components/message-router/charts/message-router-kafka/templates/statefulset.yaml
kubernetes/dmaap/components/message-router/charts/message-router-kafka/values.yaml
kubernetes/dmaap/components/message-router/charts/message-router-mirrormaker/values.yaml
kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml
kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/values.yaml
kubernetes/dmaap/components/message-router/values.yaml
kubernetes/nbi/charts/mariadb/values.yaml
kubernetes/onap/requirements.yaml
kubernetes/onap/templates/storageclass.yaml [new file with mode: 0644]
kubernetes/onap/values.yaml
kubernetes/pomba/charts/pomba-aaictxbuilder/values.yaml
kubernetes/pomba/charts/pomba-contextaggregator/values.yaml
kubernetes/pomba/charts/pomba-networkdiscoveryctxbuilder/values.yaml
kubernetes/pomba/charts/pomba-sdcctxbuilder/values.yaml
kubernetes/pomba/charts/pomba-sdncctxbuilder/values.yaml
kubernetes/readiness/docker/init/ready.py

diff --git a/kubernetes/appc/charts/appc-ansible-server/templates/pv.yaml b/kubernetes/appc/charts/appc-ansible-server/templates/pv.yaml
new file mode 100644 (file)
index 0000000..25257ea
--- /dev/null
@@ -0,0 +1,41 @@
+{{/*
+# Copyright © 2018 Amdocs, AT&T, Bell Canada
+# #
+# # 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.
+*/}}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) -}}
+{{- range $i, $t := until (int $global.Values.replicaCount)}}
+kind: PersistentVolume
+apiVersion: v1
+metadata:
+  name: {{ include "common.fullname" $global }}-data{{$i}}
+  namespace: {{ include "common.namespace" $global }}
+  labels:
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
+spec:
+  capacity:
+    storage: {{ $global.Values.persistence.size}}
+  accessModes:
+    - {{ $global.Values.persistence.accessMode }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  hostPath:
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}{{$i}}
+---
+{{- end -}}
+{{- end -}}
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-apiVersion: extensions/v1beta1
-kind: Deployment
+apiVersion: apps/v1beta1
+kind: StatefulSet
 metadata:
   name: {{ include "common.fullname" . }}
   namespace: {{ include "common.namespace" . }}
@@ -74,6 +74,8 @@ spec:
           - mountPath: {{ .Values.config.configDir }}/RestServer_config
             name: config
             subPath: RestServer_config
+          - mountPath: {{ .Values.persistence.playbookPath }}
+            name: {{ include "common.fullname" . }}-data
           resources:
 {{ include "common.resources" . | indent 12 }}
         {{- if .Values.nodeSelector }}
@@ -92,5 +94,21 @@ spec:
           configMap:
             name: {{ include "common.fullname" . }}
             defaultMode: 0644
-      imagePullSecrets:
+{{ if not .Values.persistence.enabled }}
+        - name: {{ include "common.fullname" . }}-data
+          emptyDir: {}
+{{ else }}
+  volumeClaimTemplates:
+  - metadata:
+      name: {{ include "common.fullname" . }}-data
+      labels:
+        name: {{ include "common.fullname" . }}
+    spec:
+      accessModes: [ {{ .Values.persistence.accessMode }} ]
+      storageClassName: {{ include "common.fullname" . }}-data
+      resources:
+        requests:
+          storage: {{ .Values.persistence.size }}
+{{ end }}
+    imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index b06d70f..1e15919 100644 (file)
@@ -39,7 +39,7 @@ debugEnabled: false
 config:
   appcChartName: appc
   mysqlServiceName: appc-dbhost
-
+  configDir: /opt/onap/ccsdk
 
 # default number of instances
 replicaCount: 1
@@ -66,6 +66,30 @@ service:
   portName: appc-ansible-server
   internalPort: 8000
   externalPort: 8000
+  nfsprovisionerPrefix: appc
+  disableNfsProvisioner: true
+
+## Persist data to a persitent volume
+persistence:
+  enabled: true
+
+  ## A manually managed Persistent Volume and Claim
+  ## Requires persistence.enabled: true
+  ## If defined, PVC must be created manually before volume will be bound
+  # existingClaim:
+  volumeReclaimPolicy: Retain
+
+  ## database data Persistent Volume Storage Class
+  ## If defined, storageClassName: <storageClass>
+  ## If set to "-", storageClassName: "", which disables dynamic provisioning
+  ## If undefined (the default) or set to null, no storageClassName spec is
+  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
+  ##   GKE, AWS & OpenStack)
+  accessMode: ReadWriteMany
+  size: 1Gi
+  mountPath: /dockerdata-nfs
+  mountSubPath: appc/ansible
+  playbookPath: /home/ansible
 
 ingress:
   enabled: false
index 19a0cf4..d6938c1 100644 (file)
@@ -27,7 +27,7 @@ global:
 #################################################################
 
 dockerHubRepository: registry.hub.docker.com
-image: library/mongo:3
+image: library/mongo:4.0.8
 pullPolicy: Always
 
 # application configuration
diff --git a/kubernetes/common/nfs-provisioner/Chart.yaml b/kubernetes/common/nfs-provisioner/Chart.yaml
new file mode 100644 (file)
index 0000000..fcb69b3
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# 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: v1
+description: NFS provisioner
+name: nfs-provisioner
+version: 4.0.0
diff --git a/kubernetes/common/nfs-provisioner/requirements.yaml b/kubernetes/common/nfs-provisioner/requirements.yaml
new file mode 100644 (file)
index 0000000..d175386
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# 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.
+
+dependencies:
+  - name: common
+    version: ~4.x-0
+    repository: '@local'
diff --git a/kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml b/kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml
new file mode 100644 (file)
index 0000000..58cf7a3
--- /dev/null
@@ -0,0 +1,78 @@
+{{/*
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# 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: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: {{ include "common.fullname" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  strategy:
+    type: Recreate
+  template:
+    metadata:
+      labels:
+        app: {{ include "common.fullname" . }}
+        release: {{ .Release.Name }}
+    spec:
+      containers:
+        - name: {{ include "common.fullname" . }}
+          image: "{{ .Values.global.nfsprovisionerRepository | default .Values.nfsprovisionerRepository }}/{{ .Values.nfsprovisionerImage }}"
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          ports:
+            - name: nfs
+              containerPort: {{ .Values.service.nfsPort }}
+            - name: mountd
+              containerPort: {{ .Values.service.mountdPort }}
+            - name: rpcbind
+              containerPort: {{ .Values.service.rpcbindPort }}
+            - name: rpcbind-udp
+              containerPort: {{ .Values.service.rpcbindUdpPort }}
+              protocol: UDP
+          securityContext:
+            capabilities:
+              add:
+                - DAC_READ_SEARCH
+                - SYS_RESOURCE
+          args:
+            - "-provisioner={{ include "common.namespace" . }}/nfs"
+          env:
+            - name: POD_IP
+              valueFrom:
+                fieldRef:
+                  fieldPath: status.podIP
+            - name: SERVICE_NAME
+              value: {{ include "common.servicename" . }}
+            - name: POD_NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+          volumeMounts:
+            - name: export-volume
+              mountPath: /export
+      {{- if .Values.affinity }}
+      affinity:
+      {{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
+      volumes:
+        - name: export-volume
+          hostPath:
+            path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}
diff --git a/kubernetes/common/nfs-provisioner/templates/service.yaml b/kubernetes/common/nfs-provisioner/templates/service.yaml
new file mode 100644 (file)
index 0000000..f9bba0f
--- /dev/null
@@ -0,0 +1,39 @@
+{{/*
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# 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.
+*/}}
+
+kind: Service
+apiVersion: v1
+metadata:
+  name: {{ include "common.servicename" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.fullname" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  ports:
+    - name: nfs
+      port: {{ .Values.service.nfsPort }}
+    - name: mountd
+      port: {{ .Values.service.mountdPort }}
+    - name: rpcbind
+      port: {{ .Values.service.rpcbindPort }}
+    - name: rpcbind-udp
+      port: {{ .Values.service.rpcbindUdpPort }}
+      protocol: UDP
+  selector:
+    app: {{ include "common.fullname" . }}
\ No newline at end of file
diff --git a/kubernetes/common/nfs-provisioner/values.yaml b/kubernetes/common/nfs-provisioner/values.yaml
new file mode 100644 (file)
index 0000000..687219d
--- /dev/null
@@ -0,0 +1,50 @@
+# Copyright © 2019 Amdocs, Bell Canada\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+#################################################################\r
+# Global configuration defaults.\r
+#################################################################\r
+global:\r
+  persistence:\r
+    mountPath: /dockerdata-nfs\r
+\r
+#################################################################\r
+# Application configuration defaults.\r
+#################################################################\r
+\r
+dockerHubRepository: registry.hub.docker.com\r
+pullPolicy: Always\r
+\r
+# default number of instances\r
+\r
+nodeSelector: {}\r
+\r
+affinity: {}\r
+\r
+service:\r
+  name: nfs-provisioner\r
+  nfsPort: 2049\r
+  mountdPort: 20048\r
+  rpcbindPort: 111\r
+  rpcbindUdpPort: 111\r
+\r
+## Persist data to a persitent volume\r
+persistence:\r
+  enabled: true\r
+  mountPath: /dockerdata-nfs\r
+\r
+## NFS provisioner image properties\r
+nfsprovisionerRepository: quay.io\r
+nfsprovisionerImage: kubernetes_incubator/nfs-provisioner:v1.0.8\r
+\r
index cc8fd5a..5e96423 100644 (file)
@@ -70,6 +70,17 @@ spec:
         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
+      - command:
+        -  sh
+        - -exec
+        - |
+          chown -R 1000:1000 /opt/kafka/data;
+        image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        volumeMounts:
+        - mountPath: /opt/kafka/data
+          name: kafka-data
+        name: {{ include "common.name" . }}-permission-fixer
       containers:
       - name: {{ include "common.name" .  }}
         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
@@ -124,7 +135,7 @@ spec:
         - name: aaf_locate_url
           value: "https://aaf-locate:8095"
         - name: KAFKA_LOG_DIRS
-          value: "kafka/logs"
+          value: "/opt/kafka/data"
         - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
           value: "{{ .Values.replicaCount }}"
         - name: KAFKA_DEFAULT_REPLICATION_FACTOR
@@ -137,7 +148,7 @@ spec:
           readOnly: true
         - mountPath: /var/run/docker.sock
           name: docker-socket
-        - mountPath: /kafka
+        - mountPath: /opt/kafka/data
           name: kafka-data
       {{- if .Values.tolerations }}
       tolerations:
index 5b83bb0..9f92610 100644 (file)
@@ -30,9 +30,12 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/dmaap/kafka111:0.0.5
+image: onap/dmaap/kafka111:0.0.6
 pullPolicy: Always
 ubuntuInitImage: oomk8s/ubuntu-init:2.0.0
+busyBoxImage: busybox:1.30
+busyBoxRepository: docker.io
+
 
 zookeeper:
   name: message-router-zookeeper
index 2fbd884..f630e94 100644 (file)
@@ -30,7 +30,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/dmaap/kafka111:0.0.5
+image: onap/dmaap/kafka111:0.0.6
 pullPolicy: Always
 ubuntuInitImage: oomk8s/ubuntu-init:2.0.0
 
index b2f9f13..6c15783 100644 (file)
@@ -58,18 +58,19 @@ spec:
         - /bin/bash
         - -c
         - >
-          if [ -d /tmp/topics/version-2 ]; then
+          if [ -d /tmp/zookeeper/topics/version-2 ]; then
           echo "nothing to do";
           else
-          git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
-          echo "Clone complete. Copying from /tmp/gerrit/oom-projects/data-zookeeper/* to /tmp/topics";
-          cp -var /tmp/gerrit/oom-topics/data-zookeeper/* /tmp/topics;
+          git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/zookeeper/gerrit;
+          echo "Clone complete. Copying from /tmp/zookeeper/gerrit/oom-projects/data-zookeeper/* to /tmp/zookeeper/topics";
+          cp -var /tmp/zookeeper/gerrit/oom-topics/data-zookeeper/* /tmp/zookeeper/topics;
+          chown -R 1000:1000 /tmp/zookeeper/topics;
           echo "Done.";
           fi
         image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         volumeMounts:
-        - mountPath: /tmp/topics
+        - mountPath: /tmp/zookeeper/topics
           name: zookeeper-data
       containers:
       - name: {{ include "common.name" . }}
index 37a1bab..22daf94 100644 (file)
@@ -30,7 +30,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/dmaap/zookeeper:3.0.0
+image: onap/dmaap/zookeeper:4.0.0
 pullPolicy: Always
 ubuntuInitImage: oomk8s/ubuntu-init:2.0.0
 
index 10ce59c..b141207 100644 (file)
@@ -28,7 +28,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/dmaap/dmaap-mr:1.1.11
+image: onap/dmaap/dmaap-mr:1.1.12
 pullPolicy: Always
 
 kafka:
index dc5aa89..bd79853 100644 (file)
@@ -24,7 +24,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: mariadb:10.2.14
+image: mariadb:10.3.14
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 43794d2..ad6aada 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -88,6 +88,10 @@ dependencies:
     version: ~4.x-0
     repository: '@local'
     condition: nbi.enabled
+  - name: nfs-provisioner
+    version: ~4.x-0
+    repository: '@local'
+    condition: nfs-provisioner.enabled
   - name: pnda
     version: ~4.x-0
     repository: '@local'
diff --git a/kubernetes/onap/templates/storageclass.yaml b/kubernetes/onap/templates/storageclass.yaml
new file mode 100644 (file)
index 0000000..5418da7
--- /dev/null
@@ -0,0 +1,34 @@
+{{/*
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# 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.
+*/}}
+
+{{ if .Values.global.persistence.enableDefaultStorageclass }}
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+  name: "{{ include "common.namespace" . }}-default-storageclass"
+  namespace: {{ include "common.namespace" . }}
+  annotations:
+    storageclass.kubernetes.io/is-default-class: "true"
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+provisioner: {{ .Values.global.persistence.storageclassProvisioner }}
+reclaimPolicy: {{ .Values.global.persistence.volumeReclaimPolicy }}
+parameters:
+{{ toYaml .Values.global.persistence.parameters | indent 2 }}
+{{ end }}
index 6b283db..b62606e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2018 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -46,6 +46,10 @@ global:
   # by persistent volumes and log files
   persistence:
     mountPath: /dockerdata-nfs
+    enableDefaultStorageclass: false
+    parameters: {}
+    storageclassProvisioner: kubernetes.io/no-provisioner
+    volumeReclaimPolicy: Retain
 
   # override default resource limit flavor for all charts
   flavor: unlimited
@@ -107,6 +111,8 @@ nbi:
     # openstack configuration
     openStackRegion: "Yolo"
     openStackVNFTenantId: "1234"
+nfs-provisioner:
+  enabled: true
 policy:
   enabled: false
 pomba:
index f6e13eb..97c6974 100644 (file)
@@ -24,7 +24,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image:  onap/pomba-aai-context-builder:1.4.0-SNAPSHOT-latest
+image:  onap/pomba-aai-context-builder:1.4.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 40d40b3..014323f 100755 (executable)
@@ -25,7 +25,7 @@ global:
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/pomba-context-aggregator:1.4.0-SNAPSHOT-latest
+image: onap/pomba-context-aggregator:1.4.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 6afe768..c706442 100644 (file)
@@ -24,7 +24,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image:  onap/pomba-network-discovery-context-builder:1.4.0-SNAPSHOT-latest
+image:  onap/pomba-network-discovery-context-builder:1.4.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index bddc349..eb1b646 100644 (file)
@@ -28,7 +28,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image:  onap/pomba-sdc-context-builder:1.4.0-SNAPSHOT-latest
+image:  onap/pomba-sdc-context-builder:1.4.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 7947b18..140aa33 100644 (file)
@@ -24,7 +24,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image:  onap/pomba-sdnc-context-builder:1.4.0-SNAPSHOT-latest
+image:  onap/pomba-sdnc-context-builder:1.4.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index f4a5e5d..87c09a4 100644 (file)
@@ -30,6 +30,62 @@ configuration.ssl_ca_cert = cert
 configuration.api_key['authorization'] = token
 configuration.api_key_prefix['authorization'] = 'Bearer'
 coreV1Api = client.CoreV1Api(client.ApiClient(configuration))
+api_instance=client.ExtensionsV1beta1Api(client.ApiClient(configuration))
+api = client.AppsV1beta1Api(client.ApiClient(configuration))
+batchV1Api = client.BatchV1Api(client.ApiClient(configuration))
+
+def is_job_complete(job_name):
+    complete = False
+    log.info("Checking if " + job_name + "  is complete")
+    response = ""
+    try:
+        response = batchV1Api.read_namespaced_job_status(job_name, namespace)
+        if response.status.succeeded == 1:
+            job_status_type = response.status.conditions[0].type
+            if job_status_type == "Complete":
+                complete = True
+                log.info(job_name + " is complete")
+            else:
+                log.info(job_name + " is not complete")
+        else:
+            log.info(job_name + " has not succeeded yet")
+        return complete
+    except Exception as e:
+        log.error("Exception when calling read_namespaced_job_status: %s\n" % e)
+
+def wait_for_statefulset_complete(statefulset_name):
+    try:
+        response = api.read_namespaced_stateful_set(statefulset_name, namespace)
+        s = response.status
+        if ( s.updated_replicas == response.spec.replicas and
+                s.replicas == response.spec.replicas and
+                s.ready_replicas == response.spec.replicas and
+                s.current_replicas == response.spec.replicas and
+                s.observed_generation == response.metadata.generation):
+            log.info("Statefulset " + statefulset_name + "  is ready")
+            return True
+        else:
+            log.info("Statefulset " + statefulset_name + "  is not ready")
+        return False
+    except Exception as e:
+        log.error("Exception when waiting for Statefulset status: %s\n" % e)
+
+def wait_for_deployment_complete(deployment_name):
+    try:
+        response = api.read_namespaced_deployment(deployment_name, namespace)
+        s = response.status
+        if ( s.unavailable_replicas == None and
+                s.updated_replicas == response.spec.replicas and
+                s.replicas == response.spec.replicas and
+                s.ready_replicas == response.spec.replicas and
+                s.observed_generation == response.metadata.generation):
+            log.info("Deployment " + deployment_name + "  is ready")
+            return True
+        else:
+            log.info("Deployment " + deployment_name + "  is not ready")
+        return False
+    except Exception as e:
+        log.error("Exception when waiting for deployment status: %s\n" % e)
 
 def is_ready(container_name):
     ready = False
@@ -41,28 +97,23 @@ def is_ready(container_name):
             if i.status.container_statuses is None:
                 continue
             for s in i.status.container_statuses:
-                if i.metadata.owner_references[0].kind  == "StatefulSet":
-                    if i.metadata.name == container_name:
-                        ready = s.ready
-                        if not ready:
-                            log.info(container_name + " is not ready.")
-                        else:
-                            log.info(container_name + " is ready!")
-                    else:
-                        continue
-                elif s.name == container_name:
-                    ready = s.ready
-                    if not ready:
-                        log.info(container_name + " is not ready.")
-                    else:
-                        log.info(container_name + " is ready!")
+                if s.name == container_name:
+                    if i.metadata.owner_references[0].kind  == "StatefulSet":
+                        ready = wait_for_statefulset_complete(i.metadata.owner_references[0].name)
+                    elif i.metadata.owner_references[0].kind == "ReplicaSet":
+                        api_response = api_instance.read_namespaced_replica_set_status(i.metadata.owner_references[0].name, namespace)
+                        ready = wait_for_deployment_complete(api_response.metadata.owner_references[0].name)
+                    elif i.metadata.owner_references[0].kind == "Job":
+                        ready = is_job_complete(i.metadata.owner_references[0].name)
+
+                    return ready
+
                 else:
                     continue
         return ready
     except Exception as e:
         log.error("Exception when calling list_namespaced_pod: %s\n" % e)
 
-
 DEF_TIMEOUT = 10
 DESCRIPTION = "Kubernetes container readiness check utility"
 USAGE = "Usage: ready.py [-t <timeout>] -c <container_name> [-c <container_name> ...]\n" \
@@ -105,7 +156,6 @@ def main(argv):
             else:
                 time.sleep(5)
 
-
 if __name__ == "__main__":
     main(sys.argv[1:])