Skip to content

Commit

Permalink
chore: add ob-repl with roles (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanshanying authored Dec 28, 2023
1 parent 63e23d0 commit 44c866d
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 414 deletions.
12 changes: 10 additions & 2 deletions addons/oceanbase-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,16 @@ Create extra envs annotations

{{- define "oceanbase-cluster.compdef" }}
{{- if eq .Values.hostnetwork "enabled" }}
{{- "oceanbase-hostnetwork" | quote}}
{{- if gt (int .Values.obClusters) 1 }}
{{- "oceanbase-repl-host" | quote}}
{{- else }}
{{- "oceanbase-hostnetwork" | quote}}
{{- end }}
{{- else }}
{{- "oceanbase" | quote }}
{{- if gt (int .Values.obClusters) 1 }}
{{- "oceanbase-repl" | quote}}
{{- else }}
{{- "oceanbase" | quote}}
{{- end }}
{{- end -}}
{{- end }}
29 changes: 14 additions & 15 deletions addons/oceanbase/templates/backuppolicytemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,31 @@ spec:
- componentDef: oceanbase
componentDefRef: oceanbase
backoffLimit: 0
backupMethods:
backupMethods: &backupMethods
- name: full
snapshotVolumes: false
actionSetName: oceanbase-physical-backup
targetVolumes:
volumeMounts:
- name: workdir
mountPath: /home/admin/workdir
schedules:
schedules: &backupschedules
- backupMethod: full
enabled: false
cronExpression: "0 18 * * *"
retentionPeriod: 7d
- componentDef: oceanbase-hostnetwork
componentDefRef: oceanbase-hostnetwork
backoffLimit: 0
backupMethods:
- name: full
snapshotVolumes: false
actionSetName: oceanbase-physical-backup
targetVolumes:
volumeMounts:
- name: workdir
mountPath: /home/admin/workdir
schedules:
- backupMethod: full
enabled: false
cronExpression: "0 18 * * *"
retentionPeriod: 7d
backupMethods: *backupMethods
schedules: *backupschedules
- componentDef: oceanbase-repl
componentDefRef: oceanbase-repl
backoffLimit: 0
backupMethods: *backupMethods
schedules: *backupschedules
- componentDef: oceanbase-repl-host
componentDefRef: oceanbase-repl-host
backoffLimit: 0
backupMethods: *backupMethods
schedules: *backupschedules
61 changes: 29 additions & 32 deletions addons/oceanbase/templates/clusterdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ spec:
- name: oceanbase
characterType: oceanbase
workloadType: Stateful
service:
service: &obsvc
ports:
- name: sql
port: 2881
targetPort: sql
- name: rpc
port: 2882
targetPort: rpc
configSpecs:
configSpecs: &obconfigs
# - name: oceanbase-init-config
# templateRef: oceanbase-init-config
# volumeName: oceanbase-init-config
Expand All @@ -41,19 +41,13 @@ spec:
constraintRef: oceanbase-parameters-cc
namespace: {{ .Release.Namespace }}
defaultMode: 0555
scriptSpecs:
scriptSpecs: &obscripts
- name: oceanbase-scripts
templateRef: oceanbase-scripts
namespace: {{ .Release.Namespace }}
volumeName: scripts
defaultMode: 0555
probes:
roleProbeTimeoutAfterPodsReady: 300
roleProbe:
failureThreshold: {{ .Values.roleProbe.failureThreshold }}
periodSeconds: {{ .Values.roleProbe.periodSeconds }}
timeoutSeconds: {{ .Values.roleProbe.timeoutSeconds }}
podSpec:
podSpec: &obpods
terminationGracePeriodSeconds: 60
# initContainers:
# - name: init-tools
Expand Down Expand Up @@ -183,15 +177,8 @@ spec:
- name: oceanbase-hostnetwork
characterType: oceanbase
workloadType: Stateful
service:
ports:
- name: sql
port: 2881
targetPort: sql
- name: rpc
port: 2882
targetPort: rpc
configSpecs:
service: *obsvc
configSpecs: &obhostconfigs
# - name: oceanbase-init-config
# templateRef: oceanbase-init-config
# volumeName: oceanbase-init-config
Expand Down Expand Up @@ -219,19 +206,8 @@ spec:
- observer-container
- metrics
- config-manager
scriptSpecs:
- name: oceanbase-scripts
templateRef: oceanbase-scripts
namespace: {{ .Release.Namespace }}
volumeName: scripts
defaultMode: 0555
probes:
roleProbeTimeoutAfterPodsReady: 300
roleProbe:
failureThreshold: {{ .Values.roleProbe.failureThreshold }}
periodSeconds: {{ .Values.roleProbe.periodSeconds }}
timeoutSeconds: {{ .Values.roleProbe.timeoutSeconds }}
podSpec:
scriptSpecs: *obscripts
podSpec: &obhostpods
terminationGracePeriodSeconds: 60
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Expand Down Expand Up @@ -359,3 +335,24 @@ spec:
# emptyDir: {}
- name: metricslog
emptyDir: {}
- name: oceanbase-repl
characterType: oceanbase
workloadType: Stateful
service: *obsvc
configSpecs: *obconfigs
scriptSpecs: *obscripts
probes: &obprobes
roleProbeTimeoutAfterPodsReady: 300
roleProbe:
failureThreshold: {{ .Values.roleProbe.failureThreshold }}
periodSeconds: {{ .Values.roleProbe.periodSeconds }}
timeoutSeconds: {{ .Values.roleProbe.timeoutSeconds }}
podSpec: *obpods
- name: oceanbase-repl-host
characterType: oceanbase
workloadType: Stateful
service: *obsvc
configSpecs: *obhostconfigs
scriptSpecs: *obscripts
probes: *obprobes
podSpec: *obhostpods
Loading

0 comments on commit 44c866d

Please sign in to comment.