blob: d5dc44c8721cf352afe9755471c2c2714d88a4bc [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
{{ if not .Values.redis.external }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-redis
labels:
name: {{ .Release.Name }}-redis
{{ include "openwhisk.label_boilerplate" . | indent 4 }}
spec:
replicas: {{ .Values.redis.replicaCount }}
selector:
matchLabels:
name: {{ .Release.Name }}-redis
template:
metadata:
labels:
name: {{ .Release.Name }}-redis
{{ include "openwhisk.label_boilerplate" . | indent 8 }}
spec:
restartPolicy: {{ .Values.redis.restartPolicy }}
{{- if .Values.affinity.enabled }}
affinity:
{{ include "openwhisk.affinity.core" . | indent 8 }}
{{ include "openwhisk.affinity.selfAntiAffinity" ( printf "%s-redis" .Release.Name | quote ) | indent 8 }}
{{- end }}
{{- if .Values.toleration.enabled }}
tolerations:
{{ include "openwhisk.toleration.core" . | indent 8 }}
{{- end }}
{{- if .Values.k8s.persistence.enabled }}
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-redis-pvc
{{- end }}
{{- if .Values.k8s.persistence.enabled }}
initContainers:
- name: redis-init
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
command:
- chown
- -v
- -R
- 999:999
- /data
volumeMounts:
- mountPath: /data
name: redis-data
readOnly: false
{{- end }}
{{ include "openwhisk.docker.imagePullSecrets" . | indent 6 }}
containers:
- name: redis
image: "{{- .Values.docker.registry.name -}}{{- .Values.redis.imageName -}}:{{- .Values.redis.imageTag -}}"
imagePullPolicy: {{ .Values.redis.imagePullPolicy | quote }}
{{- if .Values.k8s.persistence.enabled }}
volumeMounts:
- mountPath: /data
name: redis-data
readOnly: false
{{- end }}
ports:
- name: redis
containerPort: {{ .Values.redis.port }}
{{ end }}