Add basic redis-server.
Showing
5 changed files
with
145 additions
and
0 deletions
redis/config.yaml
0 → 100644
1 | --- | ||
2 | apiVersion: v1 | ||
3 | kind: ConfigMap | ||
4 | metadata: | ||
5 | name: redis-config | ||
6 | data: | ||
7 | --- | ||
8 | apiVersion: v1 | ||
9 | kind: Secret | ||
10 | metadata: | ||
11 | name: redis-secret | ||
12 | stringData: | ||
13 | --- | ||
14 | apiVersion: v1 | ||
15 | kind: PersistentVolumeClaim | ||
16 | metadata: | ||
17 | name: redis-data | ||
18 | spec: | ||
19 | accessModes: | ||
20 | - ReadWriteOnce | ||
21 | resources: | ||
22 | requests: | ||
23 | storage: 10Gi | ||
24 | --- | ||
25 | |||
26 |
redis/helmfile.yaml
0 → 100644
1 | environments: | ||
2 | default: | ||
3 | values: | ||
4 | - namespace: redis | ||
5 | namePrefix: "test-" | ||
6 | redisServer: | ||
7 | jsonPatches: [] | ||
8 | strategicMergePatches: [] | ||
9 | images: | ||
10 | redis: "redis:6.2.6" | ||
11 | |||
12 | --- | ||
13 | releases: | ||
14 | |||
15 | - name: {{ .Values.namePrefix }}redis-server | ||
16 | namespace: {{ .Values.namespace }} | ||
17 | chart: . | ||
18 | values: | ||
19 | - set-common-values.yaml.gotmpl | ||
20 | jsonPatches: | ||
21 | {{- if not (empty (.Values.redisServer.jsonPatches)) }} | ||
22 | {{- .Values.redisServer.jsonPatches | toYaml | indent 6 }} | ||
23 | {{- end }} | ||
24 | strategicMergePatches: | ||
25 | - apiVersion: apps/v1 | ||
26 | kind: Deployment | ||
27 | metadata: | ||
28 | name: {{ .Values.namePrefix }}redis-server | ||
29 | namespace: {{ .Values.namespace }} | ||
30 | spec: | ||
31 | selector: | ||
32 | matchLabels: | ||
33 | app: {{ .Values.namePrefix }}redis-server | ||
34 | template: | ||
35 | metadata: | ||
36 | labels: | ||
37 | app: {{ .Values.namePrefix }}redis-server | ||
38 | spec: | ||
39 | volumes: | ||
40 | - name: redis-data | ||
41 | persistentVolumeClaim: | ||
42 | claimName: {{ .Values.namePrefix }}redis-data | ||
43 | - apiVersion: v1 | ||
44 | kind: Service | ||
45 | metadata: | ||
46 | name: {{ .Values.namePrefix }}redis | ||
47 | namespace: {{ .Values.namespace }} | ||
48 | spec: | ||
49 | selector: | ||
50 | app: {{ .Values.namePrefix }}redis-server | ||
51 | {{- if not (empty (.Values.redisServer.strategicMergePatches)) }} | ||
52 | {{- .Values.redisServer.strategicMergePatches | toYaml | indent 6 }} | ||
53 | {{- end }} | ||
54 |
redis/kustomization.yaml
0 → 100644
redis/redis-server.yaml
0 → 100644
1 | --- | ||
2 | apiVersion: v1 | ||
3 | kind: Service | ||
4 | metadata: | ||
5 | name: redis | ||
6 | spec: | ||
7 | selector: | ||
8 | app: redis-server | ||
9 | ports: | ||
10 | - name: redis | ||
11 | protocol: TCP | ||
12 | port: 6379 | ||
13 | targetPort: 6379 | ||
14 | --- | ||
15 | apiVersion: apps/v1 | ||
16 | kind: Deployment | ||
17 | metadata: | ||
18 | name: redis-server | ||
19 | labels: | ||
20 | app: redis-server | ||
21 | spec: | ||
22 | replicas: 1 | ||
23 | progressDeadlineSeconds: 600 | ||
24 | selector: | ||
25 | matchLabels: | ||
26 | app: redis-server | ||
27 | template: | ||
28 | metadata: | ||
29 | labels: | ||
30 | app: redis-server | ||
31 | spec: | ||
32 | restartPolicy: Always | ||
33 | securityContext: | ||
34 | runAsUser: 0 | ||
35 | runAsGroup: 0 | ||
36 | |||
37 | volumes: | ||
38 | - name: redis-data | ||
39 | persistentVolumeClaim: | ||
40 | claimName: redis-data | ||
41 | |||
42 | containers: | ||
43 | - name: redis | ||
44 | image: redis | ||
45 | #securityContext: | ||
46 | # runAsUser: 1001 | ||
47 | # runAsGroup: 1001 | ||
48 | args: ["--loglevel", "warning"] | ||
49 | volumeMounts: | ||
50 | - name: redis-data | ||
51 | mountPath: /var/lib/redis | ||
52 |
-
Please register or sign in to post a comment