123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- {{- if .Values.memcachedIndexQueries.enabled }}
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: {{ include "loki.memcachedIndexQueriesFullname" . }}
- namespace: {{ .Release.Namespace }}
- labels:
- {{- include "loki.memcachedIndexQueriesLabels" . | nindent 4 }}
- {{- with .Values.loki.annotations }}
- annotations:
- {{- toYaml . | nindent 4 }}
- {{- end }}
- spec:
- replicas: {{ .Values.memcachedIndexQueries.replicas }}
- updateStrategy:
- rollingUpdate:
- partition: 0
- serviceName: {{ include "loki.memcachedIndexQueriesFullname" . }}
- revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
- selector:
- matchLabels:
- {{- include "loki.memcachedIndexQueriesSelectorLabels" . | nindent 6 }}
- template:
- metadata:
- {{- if or .Values.loki.podAnnotations .Values.memcachedIndexQueries.podAnnotations }}
- annotations:
- {{- with .Values.loki.podAnnotations }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.memcachedIndexQueries.podAnnotations }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- end }}
- labels:
- {{- include "loki.memcachedIndexQueriesSelectorLabels" . | nindent 8 }}
- {{- with .Values.loki.podLabels }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.memcachedIndexQueries.podLabels }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- spec:
- serviceAccountName: {{ include "loki.serviceAccountName" . }}
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.memcachedIndexQueries.hostAliases }}
- hostAliases:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- include "loki.memcachedIndexQueriesPriorityClassName" . | nindent 6 }}
- securityContext:
- {{- toYaml .Values.memcached.podSecurityContext | nindent 8 }}
- terminationGracePeriodSeconds: {{ .Values.memcachedIndexQueries.terminationGracePeriodSeconds }}
- containers:
- - name: memcached
- {{- if .Values.memcachedIndexQueries.persistence.enabled }}
- lifecycle:
- preStop:
- exec:
- command:
- - /bin/sh
- - -ec
- - |
- /usr/bin/pkill -10 memcached
- sleep 60s
- {{- end }}
- image: {{ include "loki.memcachedImage" . }}
- imagePullPolicy: {{ .Values.memcached.image.pullPolicy }}
- {{- if or .Values.memcachedIndexQueries.extraArgs .Values.memcachedIndexQueries.persistence.enabled }}
- args:
- {{- if .Values.memcachedIndexQueries.persistence.enabled }}
- - --memory-file=/cache-state/memory_file
- {{- end }}
- {{- with .Values.memcachedIndexQueries.extraArgs }}
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- end }}
- ports:
- - name: http
- containerPort: 11211
- protocol: TCP
- {{- with .Values.memcachedIndexQueries.extraEnv }}
- env:
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- with .Values.memcachedIndexQueries.extraEnvFrom }}
- envFrom:
- {{- toYaml . | nindent 12 }}
- {{- end }}
- securityContext:
- {{- toYaml .Values.memcached.containerSecurityContext | nindent 12 }}
- readinessProbe:
- {{- toYaml .Values.memcached.readinessProbe | nindent 12 }}
- livenessProbe:
- {{- toYaml .Values.memcached.livenessProbe | nindent 12 }}
- {{- if .Values.memcachedIndexQueries.persistence.enabled }}
- volumeMounts:
- - name: data
- mountPath: /cache-state
- {{- end }}
- resources:
- {{- toYaml .Values.memcachedIndexQueries.resources | nindent 12 }}
- {{- if .Values.memcachedExporter.enabled }}
- - name: exporter
- args:
- - --memcached.address=localhost:11211
- - --web.listen-address=0.0.0.0:9150
- image: {{ include "loki.memcachedExporterImage" . }}
- imagePullPolicy: {{ .Values.memcachedExporter.image.pullPolicy }}
- ports:
- - name: http-metrics
- containerPort: 9150
- protocol: TCP
- securityContext:
- {{- toYaml .Values.memcachedExporter.containerSecurityContext | nindent 12 }}
- resources:
- {{- toYaml .Values.memcachedExporter.resources | nindent 12 }}
- {{- end }}
- {{- if .Values.memcachedIndexQueries.extraContainers }}
- {{- toYaml .Values.memcachedIndexQueries.extraContainers | nindent 8}}
- {{- end }}
- {{- with .Values.memcachedIndexQueries.affinity }}
- affinity:
- {{- tpl . $ | nindent 8 }}
- {{- end }}
- {{- with .Values.memcachedIndexQueries.nodeSelector }}
- nodeSelector:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.memcachedIndexQueries.tolerations }}
- tolerations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- if .Values.memcachedIndexQueries.persistence.enabled }}
- volumeClaimTemplates:
- - metadata:
- name: data
- spec:
- accessModes:
- - ReadWriteOnce
- {{- with .Values.memcachedIndexQueries.persistence.storageClass }}
- storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }}
- {{- end }}
- resources:
- requests:
- storage: {{ .Values.memcachedIndexQueries.persistence.size | quote }}
- {{- end }}
- {{- end }}
|