diff --git a/addons/oceanbase-cluster/templates/_helpers.tpl b/addons/oceanbase-cluster/templates/_helpers.tpl index 401e4da74..a41752bc6 100644 --- a/addons/oceanbase-cluster/templates/_helpers.tpl +++ b/addons/oceanbase-cluster/templates/_helpers.tpl @@ -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 }} \ No newline at end of file diff --git a/addons/oceanbase/templates/backuppolicytemplate.yaml b/addons/oceanbase/templates/backuppolicytemplate.yaml index 34e906a20..ac47feaac 100644 --- a/addons/oceanbase/templates/backuppolicytemplate.yaml +++ b/addons/oceanbase/templates/backuppolicytemplate.yaml @@ -12,7 +12,7 @@ spec: - componentDef: oceanbase componentDefRef: oceanbase backoffLimit: 0 - backupMethods: + backupMethods: &backupMethods - name: full snapshotVolumes: false actionSetName: oceanbase-physical-backup @@ -20,7 +20,7 @@ spec: volumeMounts: - name: workdir mountPath: /home/admin/workdir - schedules: + schedules: &backupschedules - backupMethod: full enabled: false cronExpression: "0 18 * * *" @@ -28,16 +28,15 @@ spec: - 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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/addons/oceanbase/templates/clusterdefinition.yaml b/addons/oceanbase/templates/clusterdefinition.yaml index 26ac90379..6d11a9f50 100644 --- a/addons/oceanbase/templates/clusterdefinition.yaml +++ b/addons/oceanbase/templates/clusterdefinition.yaml @@ -15,7 +15,7 @@ spec: - name: oceanbase characterType: oceanbase workloadType: Stateful - service: + service: &obsvc ports: - name: sql port: 2881 @@ -23,7 +23,7 @@ spec: - name: rpc port: 2882 targetPort: rpc - configSpecs: + configSpecs: &obconfigs # - name: oceanbase-init-config # templateRef: oceanbase-init-config # volumeName: oceanbase-init-config @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/addons/oceanbase/templates/componentdefinition.yaml b/addons/oceanbase/templates/componentdefinition.yaml index d43f4ab65..6dcaa940d 100644 --- a/addons/oceanbase/templates/componentdefinition.yaml +++ b/addons/oceanbase/templates/componentdefinition.yaml @@ -1,366 +1,372 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ComponentDefinition +apiVersion: v1 +kind: List metadata: - name: oceanbase - labels: - {{- include "oceanbase.labels" . | nindent 4 }} -spec: - provider: community - serviceKind: oceanbase - serviceVersion: 4.2.0 - description: "Unlimited scalable distributed database for data-intensive transactional and real-time operational analytics workloads, with ultra-fast performance that has once achieved world records in the TPC-C benchmark test." - services: - - name: oceanbase - serviceName: oceanbase - spec: - ports: - - name: sql - port: 2881 - targetPort: sql - - name: rpc - port: 2882 - targetPort: rpc - updateStrategy: Serial - configs: -# - name: oceanbase-init-config -# templateRef: oceanbase-init-config -# volumeName: oceanbase-init-config -# namespace: {{ .Release.Namespace }} -# defaultMode: 0555 - - name: oceanbase-sysvars - templateRef: oceanbase-sysvars - volumeName: oceanbase-sysvars - constraintRef: oceanbase-sysvars-cc - namespace: {{ .Release.Namespace }} - defaultMode: 0555 - - name: oceanbase-config - templateRef: oceanbase-config - volumeName: oceanbase-config - constraintRef: oceanbase-parameters-cc - namespace: {{ .Release.Namespace }} - defaultMode: 0555 - scripts: - - name: oceanbase-scripts - templateRef: oceanbase-scripts - namespace: {{ .Release.Namespace }} - volumeName: scripts - defaultMode: 0555 - roles: - - name: primary - serviceable: true - writable: true - votable: true - - name: standby - serviceable: true - writable: false - votable: true - lifecycleActions: - roleProbe: - builtinHandler: oceanbase - failureThreshold: {{ .Values.roleProbe.failureThreshold }} - periodSeconds: {{ .Values.roleProbe.periodSeconds }} - timeoutSeconds: {{ .Values.roleProbe.timeoutSeconds }} - labels: - kubeblocks.io/ready-without-primary: "false" - runtime: - terminationGracePeriodSeconds: 60 - containers: - - name: observer-container - command: - - bash - - -c - - | - /scripts/entrypoint.sh - image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.observer.repository }}:{{ .Values.images.observer.tag }} - imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} - ports: - - containerPort: 2881 - name: sql - protocol: TCP - - containerPort: 2882 - name: rpc - protocol: TCP - readinessProbe: - failureThreshold: 10 - initialDelaySeconds: 10 - successThreshold: 1 - timeoutSeconds: 5 - exec: - command: - - cat - - /tmp/ready - volumeMounts: - - mountPath: /home/admin/data-file - name: data-file - - mountPath: /home/admin/data-log - name: data-log - - mountPath: /home/admin/log - name: log - - mountPath: /home/admin/workdir - name: workdir - - name: scripts - mountPath: /scripts - - name: oceanbase-config - mountPath: /kb-config - - name: oceanbase-sysvars - mountPath: /opt/oceanbase/sysvars - workingDir: /home/admin/workdir - env: - - name: LD_LIBRARY_PATH - value: /home/admin/oceanbase/lib - - name: CLUSTER_NAME - value: "$(KB_CLUSTER_COMP_NAME)" - - name: OB_HOME_DIR - value: "/home/admin/workdir" - - name: OB_SERVICE_PORT - value: "2881" - - name: metrics - image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }} - imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} - command: - - bash - - -c - - | - /scripts/setupmetrics.sh - env: - - name: OB_MONITOR_STATUS - value: active - - name: CLUSTER_NAME - value: "$(KB_CLUSTER_COMP_NAME)" - - name: CLUSTER_ID - value: "1" - - name: MONITOR_USER - value: "root" - - name: MONITOR_PASSWORD - value: "" - - name: SERVICE_PORT - value: "8088" - - name: OB_SERVICE_PORT - value: "2881" - ports: - - containerPort: 8088 - name: http - protocol: TCP - - containerPort: 8089 - name: pprof - protocol: TCP -# readinessProbe: -# failureThreshold: 3 -# httpGet: -# path: /metrics/stat -# port: 8088 -# scheme: HTTP -# initialDelaySeconds: 5 -# periodSeconds: 2 -# successThreshold: 1 -# timeoutSeconds: 1 - resources: - limits: - cpu: "1" - memory: 1Gi - requests: - cpu: "200m" - memory: 256Mi - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - name: scripts - mountPath: /scripts - - name: kb-tools - mountPath: /kb_tools - - name: metricslog - mountPath: /home/admin/obagent/log - workingDir: /home/admin/obagento - volumes: - - name: metricslog - emptyDir: {} ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ComponentDefinition -metadata: - name: oceanbase-hostnetwork - labels: - {{- include "oceanbase-hostnetwork.labels" . | nindent 4 }} -spec: - provider: community - serviceKind: oceanbase - serviceVersion: 4.2.0 - description: "Unlimited scalable distributed database for data-intensive transactional and real-time operational analytics workloads, with ultra-fast performance that has once achieved world records in the TPC-C benchmark test." - services: - - name: oceanbase - serviceName: oceanbase - spec: - ports: - - name: sql - port: 2881 - targetPort: sql - - name: rpc - port: 2882 - targetPort: rpc - updateStrategy: Serial - configs: -# - name: oceanbase-init-config -# templateRef: oceanbase-init-config -# volumeName: oceanbase-init-config -# namespace: {{ .Release.Namespace }} -# defaultMode: 0555 - - name: oceanbase-sysvars - templateRef: oceanbase-sysvars - volumeName: oceanbase-sysvars - constraintRef: oceanbase-sysvars-cc - namespace: {{ .Release.Namespace }} - defaultMode: 0555 - - name: oceanbase-config - templateRef: oceanbase-config - volumeName: oceanbase-config - constraintRef: oceanbase-parameters-cc - namespace: {{ .Release.Namespace }} - defaultMode: 0555 - - name: oceanbase-inject-env - templateRef: oceanbase-inject-env - volumeName: oceanbase-inject-env - constraintRef: oceanbase-env-cc - namespace: {{ .Release.Namespace }} - defaultMode: 0555 - asEnvFrom: - - observer-container - - metrics - - config-manager - scripts: - - name: oceanbase-scripts - templateRef: oceanbase-scripts - namespace: {{ .Release.Namespace }} - volumeName: scripts - defaultMode: 0555 - roles: - - name: primary - serviceable: true - writable: true - votable: true - - name: standby - serviceable: true - writable: false - votable: true - lifecycleActions: - roleProbe: - builtinHandler: oceanbase - failureThreshold: {{ .Values.roleProbe.failureThreshold }} - periodSeconds: {{ .Values.roleProbe.periodSeconds }} - timeoutSeconds: {{ .Values.roleProbe.timeoutSeconds }} - labels: - kubeblocks.io/ready-without-primary: "false" - runtime: - hostNetwork: true - dnsPolicy: ClusterFirstWithHostNet - terminationGracePeriodSeconds: 60 - containers: - - name: observer-container - command: - - bash - - -c - - | - /scripts/entrypoint.sh - image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.observer.repository }}:{{ .Values.images.observer.tag }} - imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} - ports: - - containerPort: 88 - name: sql - protocol: TCP - - containerPort: 99 - name: rpc - protocol: TCP - readinessProbe: - failureThreshold: 10 - initialDelaySeconds: 10 - successThreshold: 1 - timeoutSeconds: 5 - exec: - command: - - cat - - /tmp/ready - volumeMounts: - - mountPath: /home/admin/data-file - name: data-file - - mountPath: /home/admin/data-log - name: data-log - - mountPath: /home/admin/log - name: log - - mountPath: /home/admin/workdir - name: workdir - - name: scripts - mountPath: /scripts - - name: oceanbase-config - mountPath: /kb-config - - name: oceanbase-sysvars - mountPath: /opt/oceanbase/sysvars - workingDir: /home/admin/workdir - env: - - name: LD_LIBRARY_PATH - value: /home/admin/oceanbase/lib - - name: CLUSTER_NAME - value: "$(KB_CLUSTER_COMP_NAME)" - - name: OB_HOME_DIR - value: "/home/admin/workdir" - - name: metrics - image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }} - imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} - command: - - bash - - -c - - | - /scripts/setupmetrics.sh - env: - - name: OB_MONITOR_STATUS - value: active - - name: CLUSTER_NAME - value: "$(KB_CLUSTER_COMP_NAME)" - - name: CLUSTER_ID - value: "1" - - name: MONITOR_USER - value: "root" - - name: MONITOR_PASSWORD - value: "" -# - name: SERVICE_PORT -# value: "8088" -# - name: OB_SERVICE_PORT -# value: "2881" - ports: - - containerPort: 60 - name: http - protocol: TCP - - containerPort: 61 - name: pprof - protocol: TCP - - containerPort: 62 - name: config-manager - protocol: TCP -# readinessProbe: -# failureThreshold: 3 -# httpGet: -# path: /metrics/stat -# port: http -# scheme: HTTP -# initialDelaySeconds: 5 -# periodSeconds: 2 -# successThreshold: 1 -# timeoutSeconds: 1 - resources: - limits: - cpu: "1" - memory: 1Gi - requests: - cpu: "200m" - memory: 256Mi - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - name: scripts - mountPath: /scripts - - name: kb-tools - mountPath: /kb_tools - - name: metricslog - mountPath: /home/admin/obagent/log - workingDir: /home/admin/obagento - volumes: - - name: metricslog - emptyDir: {} +items: +- apiVersion: apps.kubeblocks.io/v1alpha1 + kind: ComponentDefinition + metadata: + name: oceanbase + labels: + {{- include "oceanbase.labels" . | nindent 6 }} + spec: + provider: &obprovider community + serviceKind: &obsvckind oceanbase + serviceVersion: &obver 4.2.0 + description: &obdesc "Unlimited scalable distributed database for data-intensive transactional and real-time operational analytics workloads, with ultra-fast performance that has once achieved world records in the TPC-C benchmark test." + services: &observices + - name: oceanbase + serviceName: oceanbase + spec: + ports: + - name: sql + port: 2881 + targetPort: sql + - name: rpc + port: 2882 + targetPort: rpc + updateStrategy: Serial + configs: &obconfigs + # - name: oceanbase-init-config + # templateRef: oceanbase-init-config + # volumeName: oceanbase-init-config + # namespace: {{ .Release.Namespace }} + # defaultMode: 0555 + - name: oceanbase-sysvars + templateRef: oceanbase-sysvars + volumeName: oceanbase-sysvars + constraintRef: oceanbase-sysvars-cc + namespace: {{ .Release.Namespace }} + defaultMode: 0555 + - name: oceanbase-config + templateRef: oceanbase-config + volumeName: oceanbase-config + constraintRef: oceanbase-parameters-cc + namespace: {{ .Release.Namespace }} + defaultMode: 0555 + scripts: &obscripts + - name: oceanbase-scripts + templateRef: oceanbase-scripts + namespace: {{ .Release.Namespace }} + volumeName: scripts + defaultMode: 0555 + runtime: &obruntime + terminationGracePeriodSeconds: 60 + containers: + - name: observer-container + command: + - bash + - -c + - | + /scripts/entrypoint.sh + image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.observer.repository }}:{{ .Values.images.observer.tag }} + imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} + ports: + - containerPort: 2881 + name: sql + protocol: TCP + - containerPort: 2882 + name: rpc + protocol: TCP + readinessProbe: + failureThreshold: 10 + initialDelaySeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + exec: + command: + - cat + - /tmp/ready + volumeMounts: + - mountPath: /home/admin/data-file + name: data-file + - mountPath: /home/admin/data-log + name: data-log + - mountPath: /home/admin/log + name: log + - mountPath: /home/admin/workdir + name: workdir + - name: scripts + mountPath: /scripts + - name: oceanbase-config + mountPath: /kb-config + - name: oceanbase-sysvars + mountPath: /opt/oceanbase/sysvars + workingDir: /home/admin/workdir + env: + - name: LD_LIBRARY_PATH + value: /home/admin/oceanbase/lib + - name: CLUSTER_NAME + value: "$(KB_CLUSTER_COMP_NAME)" + - name: OB_HOME_DIR + value: "/home/admin/workdir" + - name: OB_SERVICE_PORT + value: "2881" + - name: metrics + image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }} + imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} + command: + - bash + - -c + - | + /scripts/setupmetrics.sh + env: + - name: OB_MONITOR_STATUS + value: active + - name: CLUSTER_NAME + value: "$(KB_CLUSTER_COMP_NAME)" + - name: CLUSTER_ID + value: "1" + - name: MONITOR_USER + value: "root" + - name: MONITOR_PASSWORD + value: "" + - name: SERVICE_PORT + value: "8088" + - name: OB_SERVICE_PORT + value: "2881" + ports: + - containerPort: 8088 + name: http + protocol: TCP + - containerPort: 8089 + name: pprof + protocol: TCP + # readinessProbe: + # failureThreshold: 3 + # httpGet: + # path: /metrics/stat + # port: 8088 + # scheme: HTTP + # initialDelaySeconds: 5 + # periodSeconds: 2 + # successThreshold: 1 + # timeoutSeconds: 1 + resources: + limits: + cpu: "1" + memory: 1Gi + requests: + cpu: "200m" + memory: 256Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - name: scripts + mountPath: /scripts + - name: kb-tools + mountPath: /kb_tools + - name: metricslog + mountPath: /home/admin/obagent/log + workingDir: /home/admin/obagento + volumes: + - name: metricslog + emptyDir: {} +- apiVersion: apps.kubeblocks.io/v1alpha1 + kind: ComponentDefinition + metadata: + name: oceanbase-hostnetwork + labels: + {{- include "oceanbase-hostnetwork.labels" . | nindent 6 }} + spec: + provider: *obprovider + serviceKind: *obsvckind + serviceVersion: *obver + description: *obdesc + services: *observices + updateStrategy: Serial + configs: &obhostconfigs + # - name: oceanbase-init-config + # templateRef: oceanbase-init-config + # volumeName: oceanbase-init-config + # namespace: {{ .Release.Namespace }} + # defaultMode: 0555 + - name: oceanbase-sysvars + templateRef: oceanbase-sysvars + volumeName: oceanbase-sysvars + constraintRef: oceanbase-sysvars-cc + namespace: {{ .Release.Namespace }} + defaultMode: 0555 + - name: oceanbase-config + templateRef: oceanbase-config + volumeName: oceanbase-config + constraintRef: oceanbase-parameters-cc + namespace: {{ .Release.Namespace }} + defaultMode: 0555 + - name: oceanbase-inject-env + templateRef: oceanbase-inject-env + volumeName: oceanbase-inject-env + constraintRef: oceanbase-env-cc + namespace: {{ .Release.Namespace }} + defaultMode: 0555 + asEnvFrom: + - observer-container + - metrics + - config-manager + scripts: *obscripts + runtime: &obhostruntime + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + terminationGracePeriodSeconds: 60 + containers: + - name: observer-container + command: + - bash + - -c + - | + /scripts/entrypoint.sh + image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.observer.repository }}:{{ .Values.images.observer.tag }} + imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} + ports: + - containerPort: 88 + name: sql + protocol: TCP + - containerPort: 99 + name: rpc + protocol: TCP + readinessProbe: + failureThreshold: 10 + initialDelaySeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + exec: + command: + - cat + - /tmp/ready + volumeMounts: + - mountPath: /home/admin/data-file + name: data-file + - mountPath: /home/admin/data-log + name: data-log + - mountPath: /home/admin/log + name: log + - mountPath: /home/admin/workdir + name: workdir + - name: scripts + mountPath: /scripts + - name: oceanbase-config + mountPath: /kb-config + - name: oceanbase-sysvars + mountPath: /opt/oceanbase/sysvars + workingDir: /home/admin/workdir + env: + - name: LD_LIBRARY_PATH + value: /home/admin/oceanbase/lib + - name: CLUSTER_NAME + value: "$(KB_CLUSTER_COMP_NAME)" + - name: OB_HOME_DIR + value: "/home/admin/workdir" + - name: metrics + image: {{ .Values.images.registry | default "docker.io" }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }} + imagePullPolicy: {{ default .Values.images.pullPolicy "IfNotPresent" }} + command: + - bash + - -c + - | + /scripts/setupmetrics.sh + env: + - name: OB_MONITOR_STATUS + value: active + - name: CLUSTER_NAME + value: "$(KB_CLUSTER_COMP_NAME)" + - name: CLUSTER_ID + value: "1" + - name: MONITOR_USER + value: "root" + - name: MONITOR_PASSWORD + value: "" + # - name: SERVICE_PORT + # value: "8088" + # - name: OB_SERVICE_PORT + # value: "2881" + ports: + - containerPort: 60 + name: http + protocol: TCP + - containerPort: 61 + name: pprof + protocol: TCP + - containerPort: 62 + name: config-manager + protocol: TCP + # readinessProbe: + # failureThreshold: 3 + # httpGet: + # path: /metrics/stat + # port: http + # scheme: HTTP + # initialDelaySeconds: 5 + # periodSeconds: 2 + # successThreshold: 1 + # timeoutSeconds: 1 + resources: + limits: + cpu: "1" + memory: 1Gi + requests: + cpu: "200m" + memory: 256Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - name: scripts + mountPath: /scripts + - name: kb-tools + mountPath: /kb_tools + - name: metricslog + mountPath: /home/admin/obagent/log + workingDir: /home/admin/obagento + volumes: + - name: metricslog + emptyDir: {} +- apiVersion: apps.kubeblocks.io/v1alpha1 + kind: ComponentDefinition + metadata: + name: oceanbase-repl + labels: + {{- include "oceanbase.labels" . | nindent 6 }} + spec: + provider: *obprovider + serviceKind: *obsvckind + serviceVersion: *obver + description: *obdesc + services: *observices + updateStrategy: Serial + configs: *obconfigs + scripts: *obscripts + roles: &obroles + - name: primary + serviceable: true + writable: true + votable: true + - name: standby + serviceable: true + writable: false + votable: true + lifecycleActions: &oblifecycle + roleProbe: + builtinHandler: oceanbase + failureThreshold: {{ .Values.roleProbe.failureThreshold }} + periodSeconds: {{ .Values.roleProbe.periodSeconds }} + timeoutSeconds: {{ .Values.roleProbe.timeoutSeconds }} + labels: &oblabels + kubeblocks.io/ready-without-primary: "true" + runtime: *obruntime +- apiVersion: apps.kubeblocks.io/v1alpha1 + kind: ComponentDefinition + metadata: + name: oceanbase-repl-host + labels: + {{- include "oceanbase-hostnetwork.labels" . | nindent 6 }} + spec: + provider: *obprovider + serviceKind: *obsvckind + serviceVersion: *obver + description: *obdesc + services: *observices + updateStrategy: Serial + configs: *obhostconfigs + scripts: *obscripts + roles: *obroles + lifecycleActions: *oblifecycle + labels: *oblabels + runtime: *obhostruntime \ No newline at end of file