diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2021-09-06 07:51:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-09-06 07:51:23 +0000 |
commit | f94a5f639cb670fbc4d3902f80d3b5b6714b1ec6 (patch) | |
tree | 43d5a7d0093abd1faada8977f0e2e32c1959b9ff /kubernetes/aai/components/aai-traversal/templates | |
parent | 4d0d31a8bb4415d3a3c4a1600bc0476ff8a4ac2d (diff) | |
parent | 15fea93648c462594f4e6b3908fde10049a41ea0 (diff) |
Merge "[AAI] Added Rolling Update Strategy to traversal"
Diffstat (limited to 'kubernetes/aai/components/aai-traversal/templates')
-rw-r--r-- | kubernetes/aai/components/aai-traversal/templates/deployment.yaml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kubernetes/aai/components/aai-traversal/templates/deployment.yaml b/kubernetes/aai/components/aai-traversal/templates/deployment.yaml index 037f811f44..277fb4bfbb 100644 --- a/kubernetes/aai/components/aai-traversal/templates/deployment.yaml +++ b/kubernetes/aai/components/aai-traversal/templates/deployment.yaml @@ -29,6 +29,12 @@ metadata: heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} + minReadySeconds: {{ .Values.minReadySeconds }} + strategy: + type: {{ .Values.updateStrategy.type }} + rollingUpdate: + maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }} + maxSurge: {{ .Values.updateStrategy.maxSurge }} selector: matchLabels: app: {{ include "common.name" . }} @@ -91,6 +97,7 @@ spec: {{- end }} spec: hostname: aai-traversal + terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }} initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} - command: - /app/ready.py @@ -144,6 +151,10 @@ spec: value: {{ .Values.global.config.userId | quote }} - name: LOCAL_GROUP_ID value: {{ .Values.global.config.groupId | quote }} + - name: INTERNAL_PORT_1 + value: {{ .Values.service.internalPort | quote }} + - name: INTERNAL_PORT_2 + value: {{ .Values.service.internalPort2 | quote }} volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} - mountPath: /etc/localtime name: localtime @@ -194,6 +205,18 @@ spec: ports: - containerPort: {{ .Values.service.internalPort }} - containerPort: {{ .Values.service.internalPort2 }} + lifecycle: + # wait for active requests (long-running tasks) to be finished + # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod. + preStop: + exec: + command: + - sh + - -c + - | + while (netstat -an | grep ESTABLISHED | grep -e $INTERNAL_PORT_1 -e $INTERNAL_PORT_2) + do sleep 10 + done # disable liveness probe when breakpoints set in debugger # so K8s doesn't restart unresponsive container {{ if .Values.liveness.enabled }} |