-
Notifications
You must be signed in to change notification settings - Fork 209
/
statefulset.yaml
110 lines (110 loc) · 3.72 KB
/
statefulset.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
108
109
110
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "graphite.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "graphite.name" . }}
helm.sh/chart: {{ include "graphite.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/name: {{ include "graphite.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
serviceName: {{ template "graphite.name" . }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "graphite.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- if .Values.serviceAccount.enabled }}
serviceAccountName: {{ include "graphite.serviceAccount.name" . }}
{{- end }}
{{- if .Values.initContainers }}
initContainers:
{{ toYaml .Values.initContainers | indent 8 }}
{{- end }}
containers:
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
name: {{ .Chart.Name }}
ports:
- name: graphite-gui
containerPort: {{ .Values.service.port }}
- name: graphite-plain
containerPort: 2003
- name: graphite-udp
containerPort: 2003
protocol: UDP
- name: graphite-pickle
containerPort: 2004
- name: aggregate-plain
containerPort: 2023
- name: aggregate-pickl
containerPort: 2024
- name: statsd
protocol: {{ .Values.statsd.interface }}
containerPort: 8125
- name: statsd-admin
containerPort: 8126
env:
- name: "STATSD_INTERFACE"
value: {{ .Values.statsd.interface | lower }}
- name: "GRAPHITE_TIME_ZONE"
value: {{ .Values.timeZone }}
{{- if .Values.env }}
{{- range $key, $value := .Values.env }}
- name: {{ $value.name }}
value: {{ $value.value | quote }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /
port: graphite-gui
readinessProbe:
httpGet:
path: /
port: graphite-gui
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: {{ template "graphite.fullname" . }}-configmap
mountPath: /opt/graphite/conf/
- name: {{ template "graphite.fullname" . }}-statsd-configmap
subPath: config_tcp.js
mountPath: /opt/statsd/config/tcp.js
- name: {{ template "graphite.fullname" . }}-statsd-configmap
subPath: config_udp.js
mountPath: /opt/statsd/config/udp.js
- name: {{ template "graphite.fullname" . }}-pvc
mountPath: /opt/graphite/storage/
volumes:
- name: {{ template "graphite.fullname" . }}-configmap
configMap:
name: {{ template "graphite.fullname" . }}-configmap
- name: {{ template "graphite.fullname" . }}-statsd-configmap
configMap:
name: {{ template "graphite.fullname" . }}-statsd-configmap
- name: {{ template "graphite.fullname" . }}-pvc
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "graphite.fullname" . }}-pvc{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}