-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use statefulset deploy greptimedb
- Loading branch information
1 parent
0a53335
commit 0c65012
Showing
7 changed files
with
260 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
137 changes: 137 additions & 0 deletions
137
charts/greptimedb-standalone/templates/statefulset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "greptimedb.fullname" . }} | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
{{- include "greptimedb.labels" . | nindent 4 }} | ||
{{- if not (empty .Values.annotations) }} | ||
annotations: | ||
{{- with .Values.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
replicas: 1 | ||
updateStrategy: | ||
rollingUpdate: | ||
partition: 0 | ||
serviceName: {{ include "greptimedb.fullname" . }} | ||
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.persistence.enableStatefulSetAutoDeletePVC) (.Values.persistence.enabled) }} | ||
persistentVolumeClaimRetentionPolicy: | ||
whenDeleted: Delete | ||
whenScaled: Delete | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "greptimedb.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
{{- with .Values.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "greptimedb.selectorLabels" . | nindent 8 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "greptimedb.serviceAccountName" . }} | ||
{{- if .Values.image.pullSecrets }} | ||
imagePullSecrets: | ||
{{- range .Values.image.pullSecrets }} | ||
- name: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if .Values.securityContext }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 8 }} | ||
{{- end }} | ||
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} | ||
containers: | ||
- name: {{ include "greptimedb.fullname" . }} | ||
image: {{ printf "%s/%s:%s" .Values.image.registry .Values.image.repository .Values.image.tag }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
{{- with .Values.command }} | ||
command: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
{{- with .Values.args }} | ||
args: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
ports: | ||
- containerPort: 4000 | ||
name: http | ||
protocol: TCP | ||
- containerPort: 4001 | ||
name: grpc | ||
protocol: TCP | ||
- containerPort: 4002 | ||
name: mysql | ||
protocol: TCP | ||
- containerPort: 4003 | ||
name: postgres | ||
protocol: TCP | ||
- containerPort: 4004 | ||
name: prom | ||
protocol: TCP | ||
{{- with .Values.env }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.envFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.podSecurityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: tmp | ||
mountPath: /tmp | ||
{{- with .Values.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- tpl . $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.dnsConfig }} | ||
dnsConfig: | ||
{{- tpl . $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: tmp | ||
emptyDir: {} | ||
{{- if .Values.persistence.enabled }} | ||
volumeClaimTemplates: | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: storage | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
{{- with .Values.persistence.storageClass }} | ||
storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.persistence.size | quote }} | ||
{{- with .Values.persistence.selector }} | ||
selector: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.