diff options
author | James MacNider <James.MacNider@amdocs.com> | 2019-03-06 14:52:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-06 14:52:52 +0000 |
commit | e091cefa55f0a7aa9a095a406bc2180e3099a517 (patch) | |
tree | e5e16e08d2f2da0dbade6058ac931ec93739e9f1 /kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml | |
parent | 19351a6dd1f94ff61e572da8e4e9373659cca2ab (diff) | |
parent | 28266fa4b4644061b51b8b1066c385b5db641839 (diff) |
Merge "Extract dmaap components into components dir"
Diffstat (limited to 'kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml')
-rw-r--r-- | kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml | 146 |
1 files changed, 146 insertions, 0 deletions
diff --git a/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml b/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml new file mode 100644 index 0000000000..14f27949a7 --- /dev/null +++ b/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml @@ -0,0 +1,146 @@ +# Copyright © 2017 Amdocs, Bell Canada +# Modifications Copyright © 2018 AT&T +# +# 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: apps/v1beta1 +kind: StatefulSet +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: + serviceName: {{ .Values.service.name }} + replicas: {{ .Values.replicaCount }} + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: {{ .Values.maxUnavailable }} + podManagementPolicy: Parallel + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - {{ include "common.name" . }} + topologyKey: "kubernetes.io/hostname" + initContainers: + - name: {{ include "common.name" . }}-seed-topics-apikeys + command: + - /bin/bash + - -c + - > + if [ -d /tmp/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; + echo "Done."; + fi + image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /tmp/topics + name: zookeeper-data + containers: + - name: {{ include "common.name" . }} + image: "{{ include "common.repository" . }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + resources: +{{ include "common.resources" . | indent 12 }} + ports: + - containerPort: {{ .Values.service.clientPort }} + name: {{ .Values.service.clientPortName }} + - containerPort: {{ .Values.service.serverPort }} + name: {{ .Values.service.serverPortName }} + - containerPort: {{ .Values.service.leaderElectionPort }} + name: {{ .Values.service.leaderElectionPortName }} + {{ if eq .Values.liveness.enabled true }} + livenessProbe: + exec: + command: + - sh + - -c + - "zookeeper-ready.sh 2181" + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end }} + readinessProbe: + exec: + command: + - sh + - -c + - "zookeeper-ready.sh 2181" + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + env: + - name: ZK_REPLICAS + value: "{{ .Values.replicaCount }}" + - name: ZK_INIT_LIMIT + value: "{{ .Values.zk.initLimit }}" + - name: ZK_SYNC_LIMIT + value: "{{ .Values.zk.syncLimit }}" + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /var/lib/zookeeper/data + name: zookeeper-data + volumes: + - name: localtime + hostPath: + path: /etc/localtime +{{ if not .Values.persistence.enabled }} + - name: zookeeper-data + emptyDir: {} +{{ else }} + volumeClaimTemplates: + - metadata: + name: zookeeper-data + labels: + app: {{ include "common.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + selector: + matchLabels: + release: "{{ .Release.Name }}" + app: {{ .Values.service.name }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: "{{ .Release.Service }}" +{{ end }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" + + |