-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
helm-counter.yaml
107 lines (107 loc) · 2.15 KB
/
helm-counter.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "{{ .Release.Name }}-redis"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: "{{ .Release.Name }}-redis"
spec:
serviceName: "{{ .Release.Name }}-redis"
selector:
matchLabels:
release: "{{ .Release.Name }}-redis"
replicas: 1
template:
metadata:
labels:
release: "{{ .Release.Name }}-redis"
spec:
containers:
- name: redis
image: redis
resources:
requests:
cpu: 30m
memory: 50Mi
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /data
name: data
volumes:
- name: data
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-redis"
---
apiVersion: v1
kind: Service
metadata:
name: "{{ .Release.Name }}-redis"
spec:
selector:
release: "{{ .Release.Name }}-redis"
ports:
- port: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}-counter"
spec:
selector:
matchLabels:
release: "{{ .Release.Name }}-counter"
replicas: 2
template:
metadata:
labels:
release: "{{ .Release.Name }}-counter"
spec:
containers:
- name: counter
image: "{{ .Values.image }}"
resources:
requests:
cpu: 20m
memory: 10Mi
env:
- name: REDIS
value: "{{ .Release.Name }}-redis"
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: "{{ .Release.Name }}-counter"
spec:
type: NodePort
selector:
release: "{{ .Release.Name }}-counter"
ports:
- port: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "{{ .Release.Name }}"
spec:
rules:
- host: "{{ .Values.host }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: "{{ .Release.Name }}-counter"
port:
number: 80