a87b1c0c by Adam Heath

Add basic redis-server.

1 parent a742dade
---
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
data:
---
apiVersion: v1
kind: Secret
metadata:
name: redis-secret
stringData:
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
environments:
default:
values:
- namespace: redis
namePrefix: "test-"
redisServer:
jsonPatches: []
strategicMergePatches: []
images:
redis: "redis:6.2.6"
---
releases:
- name: {{ .Values.namePrefix }}redis-server
namespace: {{ .Values.namespace }}
chart: .
values:
- set-common-values.yaml.gotmpl
jsonPatches:
{{- if not (empty (.Values.redisServer.jsonPatches)) }}
{{- .Values.redisServer.jsonPatches | toYaml | indent 6 }}
{{- end }}
strategicMergePatches:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.namePrefix }}redis-server
namespace: {{ .Values.namespace }}
spec:
selector:
matchLabels:
app: {{ .Values.namePrefix }}redis-server
template:
metadata:
labels:
app: {{ .Values.namePrefix }}redis-server
spec:
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: {{ .Values.namePrefix }}redis-data
- apiVersion: v1
kind: Service
metadata:
name: {{ .Values.namePrefix }}redis
namespace: {{ .Values.namespace }}
spec:
selector:
app: {{ .Values.namePrefix }}redis-server
{{- if not (empty (.Values.redisServer.strategicMergePatches)) }}
{{- .Values.redisServer.strategicMergePatches | toYaml | indent 6 }}
{{- end }}
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./config.yaml
- ./redis-server.yaml
---
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
selector:
app: redis-server
ports:
- name: redis
protocol: TCP
port: 6379
targetPort: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-server
labels:
app: redis-server
spec:
replicas: 1
progressDeadlineSeconds: 600
selector:
matchLabels:
app: redis-server
template:
metadata:
labels:
app: redis-server
spec:
restartPolicy: Always
securityContext:
runAsUser: 0
runAsGroup: 0
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: redis-data
containers:
- name: redis
image: redis
#securityContext:
# runAsUser: 1001
# runAsGroup: 1001
args: ["--loglevel", "warning"]
volumeMounts:
- name: redis-data
mountPath: /var/lib/redis
namePrefix: {{ .Values.namePrefix }}
namespace: {{ .Values.namespace }}
images:
- name: redis
newName: {{ .Values.images.redis }}