aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/common')
-rw-r--r--kubernetes/common/common/templates/_serviceMesh.tpl33
-rw-r--r--kubernetes/common/repositoryGenerator/templates/_repository.tpl4
-rw-r--r--kubernetes/common/repositoryGenerator/values.yaml2
3 files changed, 37 insertions, 2 deletions
diff --git a/kubernetes/common/common/templates/_serviceMesh.tpl b/kubernetes/common/common/templates/_serviceMesh.tpl
index d4fc182b34..a685a73627 100644
--- a/kubernetes/common/common/templates/_serviceMesh.tpl
+++ b/kubernetes/common/common/templates/_serviceMesh.tpl
@@ -14,8 +14,7 @@
# limitations under the License.
*/}}
-
-{/*
+{{/*
Calculate if we are on service mesh.
*/}}
{{- define "common.onServiceMesh" -}}
@@ -26,6 +25,9 @@ true
{{- end -}}
{{- end -}}
+{{/*
+ Kills the sidecar proxy associated with a pod.
+*/}}
{{- define "common.serviceMesh.killSidecar" -}}
{{- if (include "common.onServiceMesh" .) }}
RCODE="$?";
@@ -37,3 +39,30 @@ echo "*** exiting with script exit code" ;
exit "$RCODE"
{{- end }}
{{- end -}}
+
+{{/*
+ Wait for job container.
+*/}}
+{{- define "common.waitForJobContainer" -}}
+{{- $dot := default . .dot -}}
+{{- $wait_for_job_container := default $dot.Values.wait_for_job_container .wait_for_job_container -}}
+{{- if (include "common.onServiceMesh" .) }}
+- name: {{ include "common.name" $dot }}{{ ternary "" (printf "-%s" $wait_for_job_container.name) (empty $wait_for_job_container.name) }}-service-mesh-wait-for-job-container
+ image: {{ include "repositoryGenerator.image.quitQuit" $dot }}
+ imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
+ command:
+ - /bin/sh
+ - "-c"
+ args:
+ - echo "waiting 10s for istio side cars to be up"; sleep 10s;
+ {{- range $container := $wait_for_job_container.containers }}
+ /app/ready.py --service-mesh-check {{ tpl $container $dot }} -t 45;
+ {{- end }}
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+{{- end }}
+{{- end }}
diff --git a/kubernetes/common/repositoryGenerator/templates/_repository.tpl b/kubernetes/common/repositoryGenerator/templates/_repository.tpl
index 349bb4072a..f57d390477 100644
--- a/kubernetes/common/repositoryGenerator/templates/_repository.tpl
+++ b/kubernetes/common/repositoryGenerator/templates/_repository.tpl
@@ -141,6 +141,10 @@
{{- include "repositoryGenerator.image._helper" (merge (dict "image" "dbcClientImage") .) }}
{{- end -}}
+{{- define "repositoryGenerator.image.quitQuit" -}}
+ {{- include "repositoryGenerator.image._helper" (merge (dict "image" "quitQuitImage") .) }}
+{{- end -}}
+
{{/*
Resolve the image repository secret token.
The value for .Values.global.repositoryCred is used if provided:
diff --git a/kubernetes/common/repositoryGenerator/values.yaml b/kubernetes/common/repositoryGenerator/values.yaml
index a05bc13ae6..5a43eefc03 100644
--- a/kubernetes/common/repositoryGenerator/values.yaml
+++ b/kubernetes/common/repositoryGenerator/values.yaml
@@ -38,6 +38,7 @@ global:
readinessImage: onap/oom/readiness:3.0.1
dcaePolicySyncImage: onap/org.onap.dcaegen2.deployments.dcae-services-policy-sync:1.0.1
dbcClientImage: onap/dmaap/dbc-client:2.0.7
+ quitQuitImage: onap/oom/readiness:4.1.0
# Default credentials
# they're optional. If the target repository doesn't need them, comment them
@@ -71,3 +72,4 @@ imageRepoMapping:
readinessImage: repository
dcaePolicySyncImage: repository
dbcClientImage: repository
+ quitQuitImage: repository