@@ -33,20 +33,28 @@ spec:
3333 matchLabels :
3434 app.kubernetes.io/component : write
3535 topologyKey : kubernetes.io/hostname
36+ securityContext :
37+ fsGroup : 10001
3638 initContainers :
37- - name : init
38- imagePullPolicy : {{ .Values.images.pullPolicy }}
39- image : {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.repository }}:{{ .Values.images.tag }}
40- securityContext :
41- runAsUser : 0
42- privileged : true
39+ - name : wait-index-gateway
40+ imagePullPolicy : {{ .Values.images.curl.pullPolicy }}
4341 command :
4442 - /bin/sh
4543 - -c
46- - chown loki:loki /var/loki
44+ - |
45+ # Copy curl to tools volume for use in probes
46+ cp /bin/curl /kb-tools/curl
47+
48+ # Execute wait script
49+ /kb-scripts/wait-index-gateway-ring.sh
50+ env :
51+ - name : MAX_WAIT
52+ value : " 300"
4753 volumeMounts :
48- - mountPath : /var/loki
49- name : data
54+ - name : scripts
55+ mountPath : /kb-scripts
56+ - name : tools
57+ mountPath : /kb-tools
5058 containers :
5159 - name : write
5260 imagePullPolicy : {{ .Values.images.pullPolicy }}
@@ -76,25 +84,40 @@ spec:
7684 - containerPort : {{ .Values.server.httpMemberlistPort }}
7785 name : http-memberlist
7886 protocol : TCP
87+ startupProbe :
88+ exec :
89+ command :
90+ - /kb-scripts/check-index-gateway-ring.sh
91+ initialDelaySeconds : 10
92+ periodSeconds : 5
93+ timeoutSeconds : 3
94+ successThreshold : 1
95+ failureThreshold : 60
7996 readinessProbe :
80- failureThreshold : 3
81- httpGet :
82- path : /ready
83- port : http-metrics
84- scheme : HTTP
85- initialDelaySeconds : 30
97+ exec :
98+ command :
99+ - /kb-scripts/check-index-gateway-ring.sh
100+ initialDelaySeconds : 15
86101 periodSeconds : 10
102+ timeoutSeconds : 3
87103 successThreshold : 1
88- timeoutSeconds : 1
104+ failureThreshold : 3
89105 volumeMounts :
90- - mountPath : /etc/loki/config
106+ - mountPath : /etc/loki/config
91107 name : config
92108 - mountPath : /etc/loki/runtime-config
93109 name : runtime-config
94110 - mountPath : /tmp
95111 name : tmp
96112 - mountPath : /var/loki
97113 name : data
114+ - mountPath : /kb-scripts
115+ name : scripts
116+ - mountPath : /kb-tools
117+ name : tools
118+ volumes :
119+ - emptyDir : {}
120+ name : tools
98121 configs :
99122 - name : loki-config
100123 templateRef : loki-tpl
@@ -105,7 +128,15 @@ spec:
105128 templateRef : loki-runtime-tpl
106129 volumeName : runtime-config
107130 namespace : {{ .Release.Namespace }}
131+ scripts :
132+ - name : loki-scripts
133+ templateRef : loki-scripts
134+ namespace : {{ .Release.Namespace }}
135+ volumeName : scripts
136+ defaultMode : 0555
108137 vars :
138+ - name : CLUSTER_DOMAIN
139+ value : {{ .Values.global.clusterDomain}}
109140 - name : SERVER_HTTP_PORT
110141 value : {{ .Values.server.httpMetricsPort | quote }}
111142 - name : SERVER_GRPC_PORT
0 commit comments