X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2Fredis-cluster%2Ftemplates%2Fstatefulset.yaml;fp=helm%2Fredis-cluster%2Ftemplates%2Fstatefulset.yaml;h=afebbaac8853d81bf937fa8fafb9ce20c8ad2202;hb=1b131151d8b1fae636eb6e92e1bf812d9d80584e;hp=0000000000000000000000000000000000000000;hpb=f9c36363b7c9cf8063278f656d392fe47c969418;p=ric-plt%2Fric-dep.git diff --git a/helm/redis-cluster/templates/statefulset.yaml b/helm/redis-cluster/templates/statefulset.yaml new file mode 100644 index 0000000..afebbaa --- /dev/null +++ b/helm/redis-cluster/templates/statefulset.yaml @@ -0,0 +1,85 @@ +################################################################################### +# ============LICENSE_START======================================================= +# +# ================================================================================ +# Copyright (C) 2020 Hcl Technologies Limited. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= +################################################################################### + +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ .Values.rediscluster.name }} +spec: + serviceName: {{ .Values.service.name }} + replicas: {{ .Values.rediscluster.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ .Values.rediscluster.name }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ .Values.rediscluster.name }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: {{ .Values.topology.policyUnstisfiable }} + #whenUnsatisfiable: ScheduleAnyway + #whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app.kubernetes.io/name: {{ .Values.rediscluster.name }} + app.kubernetes.io/instance: {{ .Release.Name }} + containers: + - name: {{ .Values.container.name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: 6379 + name: client + - containerPort: 16379 + name: gossip + command: ["/conf/update-node.sh", "redis-server", "/conf/redis.conf"] + env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + volumeMounts: + - name: conf + mountPath: /conf + readOnly: false + - name: data + mountPath: /data + readOnly: false + volumes: + - name: conf + configMap: + name: {{ .Values.rediscluster.name }}-cm + defaultMode: 0755 + volumeClaimTemplates: + - metadata: + name: data + labels: + app.kubernetes.io/name: {{ .Values.rediscluster.name }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: {{ .Values.volume.storage }}