123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: {{ include "kuiper.fullname" . }}
- namespace: {{ .Release.Namespace }}
- labels:
- {{- include "kuiper.labels" . | nindent 4 }}
- spec:
- replicas: {{ .Values.replicaCount }}
- serviceName: {{ include "kuiper.fullname" . }}-headless
- {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
- volumeClaimTemplates:
- - metadata:
- name: kuiper-data
- namespace: {{ .Release.Namespace }}
- labels:
- {{- include "kuiper.labels" . | nindent 4 }}
- annotations:
- {{- if .Values.persistence.storageClass }}
- volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
- {{- else }}
- volume.alpha.kubernetes.io/storage-class: default
- {{- end }}
- spec:
- accessModes:
- - {{ .Values.persistence.accessMode | quote }}
- resources:
- requests:
- storage: {{ .Values.persistence.size | quote }}
- {{- end }}
- selector:
- matchLabels:
- {{- include "kuiper.selectorLabels" . | nindent 6 }}
- template:
- metadata:
- labels:
- {{- include "kuiper.selectorLabels" . | nindent 8 }}
- spec:
- # securityContext:
- # fsGroup: 1000
- volumes:
- {{- if not .Values.persistence.enabled }}
- - name: kuiper-data
- emptyDir: {}
- {{- else if .Values.persistence.existingClaim }}
- - name: kuiper-data
- persistentVolumeClaim:
- {{- with .Values.persistence.existingClaim }}
- claimName: {{ tpl . $ }}
- {{- end }}
- {{- end }}
- - name: mqtt
- configMap:
- name: {{ include "kuiper.fullname" . }}
- items:
- - key: mqtt.yaml
- path: mqtt.yaml
- {{- if .Values.mqtt.certificationSecretName }}
- - name: kuiper-certification
- secret:
- secretName: {{ .Values.mqtt.certificationSecretName }}
- {{- end }}
- {{- if .Values.mqtt.privateKeySecretName }}
- - name: kuiper-private-key
- secret:
- secretName: {{ .Values.mqtt.privateKeySecretName }}
- {{- end }}
- containers:
- - name: kuiper
- image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- volumeMounts:
- - name: kuiper-data
- mountPath: "/kuiper/data"
- - name: mqtt
- mountPath: "/kuiper/etc/sources/mqtt.yaml"
- subPath: "mqtt.yaml"
- {{ if .Values.mqtt.certificationSecretName }}
- - name: kuiper-certification
- mountPath: {{ .Values.mqtt.certificationPath | default "/var/kuiper/certificate.pem" }}
- readOnly: true
- {{ end }}
- {{ if .Values.mqtt.privateKeySecretName }}
- - name: kuiper-private-key
- mountPath: {{ .Values.mqtt.privateKeyPath | default "/var/kuiper/private.pem.key" }}
- readOnly: true
- {{ end }}
- resources:
- {{- toYaml .Values.resources | nindent 12 }}
- {{- with .Values.nodeSelector }}
- nodeSelector:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.affinity }}
- affinity:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.tolerations }}
- tolerations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
|