diff options
author | efiacor <fiachra.corcoran@est.tech> | 2019-03-11 23:36:05 +0000 |
---|---|---|
committer | efiacor <fiachra.corcoran@est.tech> | 2019-03-11 23:36:05 +0000 |
commit | 4808baa6dae6f3477b00870236defdf838952c34 (patch) | |
tree | 0bc9eecb39e6016e9c92e7765739ed8f88d54aa5 /kubernetes/dmaap/components | |
parent | c4b0b79045a56050f2ed0eee8f13237a90815c3c (diff) |
Convert dmaap-dr-node to StatefuleSet
Change-Id: I540f7f2eb927896eb3f0c03b900f3bf6b9bc7ce5
Issue-ID: DMAAP-866
Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Diffstat (limited to 'kubernetes/dmaap/components')
-rw-r--r-- | kubernetes/dmaap/components/dmaap-dr-node/templates/pv.yaml | 61 | ||||
-rw-r--r-- | kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml (renamed from kubernetes/dmaap/components/dmaap-dr-node/templates/deployment.yaml) | 93 | ||||
-rw-r--r-- | kubernetes/dmaap/components/dmaap-dr-node/values.yaml | 12 | ||||
-rw-r--r-- | kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml | 8 |
4 files changed, 129 insertions, 45 deletions
diff --git a/kubernetes/dmaap/components/dmaap-dr-node/templates/pv.yaml b/kubernetes/dmaap/components/dmaap-dr-node/templates/pv.yaml new file mode 100644 index 0000000000..016a6ea023 --- /dev/null +++ b/kubernetes/dmaap/components/dmaap-dr-node/templates/pv.yaml @@ -0,0 +1,61 @@ +{{/* + # ============LICENSE_START======================================================= + # Copyright (C) 2019 Nordix Foundation. + # ================================================================================ + # 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. + # + # SPDX-License-Identifier: Apache-2.0 + # ============LICENSE_END========================================================= +*/}} + +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}-spool-data-pv + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ include "common.fullname" . }}-spool-data-pv +spec: + capacity: + storage: {{ .Values.persistence.spoolSize }} + accessModes: + - {{ .Values.persistence.accessMode }} + storageClassName: "{{ include "common.fullname" . }}-spool-data-stcl" + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.spoolMountSubPath }} +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}-event-logs-pv + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ include "common.fullname" . }}-event-logs-pv +spec: + capacity: + storage: {{ .Values.persistence.eventLogSize }} + accessModes: + - {{ .Values.persistence.accessMode }} + storageClassName: "{{ include "common.fullname" . }}-event-logs-stcl" + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.eventLogsMountSubPath }}
\ No newline at end of file diff --git a/kubernetes/dmaap/components/dmaap-dr-node/templates/deployment.yaml b/kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml index 83a4975aa5..2c4b0de63b 100644 --- a/kubernetes/dmaap/components/dmaap-dr-node/templates/deployment.yaml +++ b/kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml @@ -11,8 +11,8 @@ # 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 +apiVersion: apps/v1beta1 +kind: StatefulSet metadata: name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} @@ -23,13 +23,13 @@ metadata: heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} + serviceName: {{ .Values.config.dmaapDrNode.name }} template: metadata: labels: app: {{ include "common.name" . }} release: {{ .Release.Name }} spec: - hostname: {{.Values.config.dmaapDrNode.name}} initContainers: - name: {{ include "common.name" . }}-readiness image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" @@ -65,6 +65,10 @@ spec: initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.readiness.periodSeconds }} volumeMounts: + - mountPath: {{ .Values.persistence.spoolPath }} + name: {{ include "common.fullname" . }}-spool-data-pvc + - mountPath: {{ .Values.persistence.eventLogsPath }} + name: {{ include "common.fullname" . }}-event-logs-pvc - mountPath: /etc/localtime name: localtime readOnly: false @@ -77,13 +81,11 @@ spec: - mountPath: /opt/app/datartr/etc/node.properties subPath: node.properties name: node-props - - name: {{ include "common.fullname" . }}-logs - mountPath: {{ .Values.global.loggingDirectory }} lifecycle: postStart: exec: command: - - /opt/app/datartr/etc/createFeed.sh + - /opt/app/datartr/etc/createFeed.sh resources: {{ include "common.resources" . | indent 12 }} {{- if .Values.nodeSelector }} @@ -94,7 +96,6 @@ spec: affinity: {{ toYaml .Values.affinity | indent 10 }} {{- end }} - # Filebeat sidecar container - name: {{ include "common.name" . }}-filebeat-onap image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" @@ -105,35 +106,55 @@ spec: subPath: filebeat.yml - name: {{ include "common.fullname" . }}-data-filebeat mountPath: /usr/share/filebeat/data - - name: {{ include "common.fullname" . }}-logs + - name: {{ include "common.fullname" . }}-event-logs-pvc mountPath: /var/log/onap/datarouter-node - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: create-feed - configMap: - name: {{ include "common.fullname" . }}-create-feed-configmap - defaultMode: 0755 - - name: node-props - configMap: - name: {{ include "common.fullname" . }}-node-props-configmap - - name: dr-node-data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ include "common.fullname" . }} - {{- else }} - emptyDir: {} - {{- end }} - - name: {{ include "common.fullname" . }}-log-conf - configMap: - name: {{ include "common.fullname" . }}-log - - name: {{ include "common.fullname" . }}-filebeat-conf - configMap: - name: {{ .Release.Name }}-dmaap-filebeat-configmap - - name: {{ include "common.fullname" . }}-data-filebeat - emptyDir: {} - - name: {{ include "common.fullname" . }}-logs - emptyDir: {} imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: create-feed + configMap: + name: {{ include "common.fullname" . }}-create-feed-configmap + defaultMode: 0755 + - name: node-props + configMap: + name: {{ include "common.fullname" . }}-node-props-configmap + - name: {{ include "common.fullname" . }}-log-conf + configMap: + name: {{ include "common.fullname" . }}-log + - name: {{ include "common.fullname" . }}-filebeat-conf + configMap: + name: {{ .Release.Name }}-dmaap-filebeat-configmap + - name: {{ include "common.fullname" . }}-data-filebeat + emptyDir: {} + - name: {{ include "common.fullname" . }}-event-logs-pvc + emptyDir: {} + volumeClaimTemplates: + - metadata: + name: {{ include "common.fullname" . }}-spool-data-pvc + labels: + name: {{ include "common.fullname" . }} + spec: + accessModes: [ {{ .Values.persistence.accessMode }} ] + storageClassName: {{ include "common.fullname" . }}-spool-data-stcl + resources: + requests: + storage: {{ .Values.persistence.spoolSize }} + selector: + matchLabels: + name: {{ include "common.fullname" . }}-spool-data-pv + - metadata: + name: {{ include "common.fullname" . }}-event-logs-pvc + labels: + name: {{ include "common.fullname" . }} + spec: + accessModes: [ {{ .Values.persistence.accessMode }} ] + storageClassName: {{ include "common.fullname" . }}-event-logs-stcl + resources: + requests: + storage: {{ .Values.persistence.eventLogSize }} + selector: + matchLabels: + name: {{ include "common.fullname" . }}-event-logs-pv diff --git a/kubernetes/dmaap/components/dmaap-dr-node/values.yaml b/kubernetes/dmaap/components/dmaap-dr-node/values.yaml index b0dcb3c700..f223026357 100644 --- a/kubernetes/dmaap/components/dmaap-dr-node/values.yaml +++ b/kubernetes/dmaap/components/dmaap-dr-node/values.yaml @@ -56,7 +56,17 @@ readiness: ## Persist data to a persitent volume persistence: - enabled: false + volumeReclaimPolicy: Retain + accessMode: ReadWriteMany + mountPath: /dockerdata-nfs + + spoolMountSubPath: data-router/dr-node/spool-data + spoolSize: 1Gi + spoolPath: /opt/app/datartr/spool + + eventLogsMountSubPath: data-router/dr-node/event-logs + eventLogSize: 1Gi + eventLogsPath: /opt/app/datartr/logs ingress: enabled: false diff --git a/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml b/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml index 78321f7590..d2c653eb6f 100644 --- a/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml +++ b/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml @@ -83,7 +83,6 @@ spec: affinity: {{ toYaml .Values.affinity | indent 10 }} {{- end }} - # Filebeat sidecar container - name: {{ include "common.name" . }}-filebeat-onap image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" @@ -103,13 +102,6 @@ spec: - name: prov-props configMap: name: {{ include "common.fullname" . }}-prov-props-configmap - - name: dr-prov-data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ include "common.fullname" . }} - {{- else }} - emptyDir: {} - {{- end }} - name: {{ include "common.fullname" . }}-log-conf configMap: name: {{ include "common.fullname" . }}-log |