-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(interactive): support adding a store pod as a backup (#3703)
- Loading branch information
1 parent
d0e9dca
commit 60e3e31
Showing
16 changed files
with
362 additions
and
32 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 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
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
191 changes: 191 additions & 0 deletions
191
charts/graphscope-store/templates/store/statefulset-backup.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,191 @@ | ||
{{- if .Values.backup.enabled }} | ||
{{- $frontendFullname := include "graphscope-store.frontend.fullname" . }} | ||
{{- $coordinatorFullname := include "graphscope-store.coordinator.fullname" . }} | ||
{{- $storeFullname := include "graphscope-store.store.fullname" . }} | ||
{{- $kafkaFullname := include "graphscope-store.kafka.fullname" . -}} | ||
{{- $releaseNamespace := .Release.Namespace }} | ||
{{- $clusterDomain := .Values.clusterDomain }} | ||
|
||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "graphscope-store.store.fullname" . }}-backup | ||
namespace: {{ .Release.Namespace }} | ||
labels: {{- include "common.labels.standard" . | nindent 4 }} | ||
app.kubernetes.io/component: store | ||
{{- if .Values.commonLabels }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
podManagementPolicy: {{ .Values.podManagementPolicy }} | ||
replicas: {{ .Values.store.replicaCount }} | ||
selector: | ||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} | ||
app.kubernetes.io/component: store | ||
serviceName: {{ printf "%s-store-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} | ||
updateStrategy: {{- include "common.tplvalues.render" (dict "value" .Values.updateStrategy "context" $ ) | nindent 4 }} | ||
template: | ||
metadata: | ||
labels: {{- include "common.labels.standard" . | nindent 8 }} | ||
app.kubernetes.io/component: store | ||
{{- if .Values.store.podLabels }} | ||
{{- include "common.tplvalues.render" (dict "value" .Values.store.podLabels "context" $) | nindent 8 }} | ||
{{- end }} | ||
annotations: | ||
{{- if (include "graphscope-store.createConfigmap" .) }} | ||
checksum/configuration: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
{{- end }} | ||
{{- if .Values.store.podAnnotations }} | ||
{{- include "common.tplvalues.render" (dict "value" .Values.store.podAnnotations "context" $) | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- include "graphscope-store.imagePullSecrets" . | nindent 6 }} | ||
{{- if .Values.store.hostAliases }} | ||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.store.hostAliases "context" $) | nindent 8 }} | ||
{{- end }} | ||
hostNetwork: {{ .Values.store.hostNetwork }} | ||
hostIPC: {{ .Values.store.hostIPC }} | ||
{{- if .Values.store.schedulerName }} | ||
schedulerName: {{ .Values.store.schedulerName | quote }} | ||
{{- end }} | ||
{{- if .Values.affinity }} | ||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} | ||
{{- else }} | ||
affinity: | ||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "store" "context" $) | nindent 10 }} | ||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "store" "context" $) | nindent 10 }} | ||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} | ||
{{- end }} | ||
{{- if .Values.nodeSelector }} | ||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.dnsPolicy }} | ||
dnsPolicy: {{ .Values.dnsPolicy | quote }} | ||
{{- end }} | ||
{{- if .Values.dnsConfig }} | ||
dnsConfig: {{- include "common.tplvalues.render" (dict "value" .Values.dnsConfig "context" $) | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.tolerations }} | ||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.topologySpreadConstraints }} | ||
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" $) | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.terminationGracePeriodSeconds }} | ||
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} | ||
{{- end }} | ||
{{- if .Values.priorityClassName }} | ||
priorityClassName: {{ .Values.priorityClassName }} | ||
{{- end }} | ||
{{- if .Values.podSecurityContext.enabled }} | ||
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "graphscope-store.serviceAccountName" . }} | ||
{{- if .Values.initContainers }} | ||
initContainers: | ||
{{- if .Values.initContainers }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.initContainers "context" $ ) | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
containers: | ||
- name: store | ||
image: {{ include "graphscope-store.image" . }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }} | ||
{{- if .Values.containerSecurityContext.enabled }} | ||
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} | ||
{{- end }} | ||
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} | ||
{{- if .Values.args }} | ||
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} | ||
{{- end }} | ||
env: | ||
- name: GRAPH_NAME | ||
value: {{ .Values.graphName | quote }} | ||
- name: GROOT_JAVA_OPTS | ||
value: {{ .Values.javaOpts | quote }} | ||
- name: ROLE | ||
value: "store" | ||
- name: FRONTEND_COUNT | ||
value: {{ .Values.frontend.replicaCount | quote }} | ||
- name: COORDINATOR_COUNT | ||
value: {{ .Values.coordinator.replicaCount | quote }} | ||
- name: STORE_COUNT | ||
value: {{ .Values.store.replicaCount | quote }} | ||
- name: DNS_NAME_PREFIX_FRONTEND | ||
value: {{ $frontendFullname }}-{}.{{ $frontendFullname }}-headless | ||
- name: DNS_NAME_PREFIX_COORDINATOR | ||
value: {{ $coordinatorFullname }}-{}.{{ $coordinatorFullname }}-headless | ||
- name: DNS_NAME_PREFIX_STORE | ||
value: {{ $storeFullname }}-{}.{{ $storeFullname }}-headless | ||
- name: DNS_NAME_SERVICE_KAFKA | ||
value: {{ $kafkaFullname}}-headless.{{ $releaseNamespace }} | ||
- name: KAFKA_SERVERS | ||
value: {{ include "graphscope-store.kafka.brokerlist" . }} | ||
- name: ZK_CONNECT | ||
value: {{ printf "%s-headless" (include "graphscope-store.zookeeper.fullname" .) | quote }} | ||
ports: | ||
- name: port | ||
containerPort: 55555 | ||
- name: gaia-rpc | ||
containerPort: 60000 | ||
- name: gaia-engine | ||
containerPort: 60001 | ||
{{- if .Values.store.resources }} | ||
resources: {{- toYaml .Values.store.resources | nindent 12 }} | ||
{{- end }} | ||
readinessProbe: | ||
failureThreshold: 5 | ||
tcpSocket: | ||
port: gaia-rpc | ||
initialDelaySeconds: 30 | ||
periodSeconds: 30 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
volumeMounts: | ||
- name: data | ||
mountPath: {{ .Values.storeDataPath }} | ||
- name: config | ||
mountPath: /etc/groot/groot.config.tpl | ||
subPath: groot.config | ||
- name: config | ||
mountPath: /etc/groot/setup.sh | ||
subPath: setup.sh | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: {{ include "graphscope-store.configmapName" . }} | ||
defaultMode: 0755 | ||
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }} | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: {{ tpl .Values.store.persistence.existingClaim . }} | ||
{{- else if not .Values.store.persistence.enabled }} | ||
- name: data | ||
emptyDir: {} | ||
{{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }} | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: data | ||
{{- if .Values.persistence.annotations }} | ||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }} | ||
{{- end }} | ||
{{- if .Values.persistence.labels }} | ||
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }} | ||
{{- end }} | ||
spec: | ||
accessModes: | ||
{{- range .Values.persistence.accessModes }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.store.persistence.size | quote }} | ||
{{ include "graphscope-store.storageClass" . | nindent 8 }} | ||
{{- if .Values.store.persistence.selector }} | ||
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }} | ||
{{- end -}} | ||
{{- end }} | ||
{{- end }} |
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
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
Oops, something went wrong.