github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/starrocks/templates/clusterdefinition.yaml (about) 1 apiVersion: apps.kubeblocks.io/v1alpha1 2 kind: ClusterDefinition 3 metadata: 4 name: starrocks 5 labels: 6 {{- include "starrocks.labels" . | nindent 4 }} 7 spec: 8 connectionCredential: 9 username: root 10 password: "" 11 endpoint: "$(SVC_FQDN):$(SVC_PORT_fe)" 12 host: "$(SVC_FQDN)" 13 port: "$(SVC_PORT_fe)" 14 componentDefs: 15 - name: fe 16 characterType: mysql 17 workloadType: Stateful 18 service: 19 ports: 20 - name: fe 21 port: {{ .Values.fe.queryPort }} 22 targetPort: query-port 23 volumeTypes: 24 - name: fe-data 25 type: data 26 - name: fe-log 27 type: log 28 configSpecs: 29 - name: starrocks-fe-cm 30 templateRef: starrocks-fe-cm 31 namespace: {{ .Release.Namespace }} 32 volumeName: starrocks-fe-cm 33 podSpec: 34 containers: 35 - name: fe 36 volumeMounts: 37 - mountPath: /opt/starrocks/fe/meta 38 name: fe-meta 39 - mountPath: /opt/starrocks/fe/log 40 name: fe-log 41 - mountPath: /opt/starrocks/fe/conf 42 name: starrocks-fe-cm 43 args: 44 - $(FE_SERVICE_NAME) 45 command: 46 - /opt/starrocks/fe_entrypoint.sh 47 env: 48 - name: TZ 49 value: {{ .Values.timezone }} 50 - name: POD_NAME 51 valueFrom: 52 fieldRef: 53 apiVersion: v1 54 fieldPath: metadata.name 55 - name: POD_IP 56 valueFrom: 57 fieldRef: 58 apiVersion: v1 59 fieldPath: status.podIP 60 - name: HOST_IP 61 valueFrom: 62 fieldRef: 63 apiVersion: v1 64 fieldPath: status.hostIP 65 - name: POD_NAMESPACE 66 valueFrom: 67 fieldRef: 68 apiVersion: v1 69 fieldPath: metadata.namespace 70 - name: HOST_TYPE 71 value: FQDN 72 - name: COMPONENT_NAME 73 value: fe 74 - name: FE_SERVICE_NAME 75 value: $(KB_CLUSTER_COMP_NAME)-headless 76 - name: CONFIGMAP_MOUNT_PATH 77 value: /etc/starrocks/fe/conf 78 lifecycle: 79 preStop: 80 exec: 81 command: 82 - /opt/starrocks/fe_prestop.sh 83 ports: 84 - containerPort: 8030 85 name: http-port 86 protocol: TCP 87 - containerPort: 9020 88 name: rpc-port 89 protocol: TCP 90 - containerPort: {{ .Values.fe.queryPort }} 91 name: query-port 92 protocol: TCP 93 securityContext: 94 allowPrivilegeEscalation: false 95 readOnlyRootFilesystem: false 96 {{- if .Values.fe.resources }} 97 resources: 98 {{- toYaml .Values.fe.resources | nindent 10 }} 99 {{- end }} 100 {{- if .Values.fe.probe }} 101 livenessProbe: 102 failureThreshold: 3 103 {{- toYaml .Values.fe.probe | nindent 10 }} 104 readinessProbe: 105 failureThreshold: 3 106 {{- toYaml .Values.fe.probe | nindent 10 }} 107 startupProbe: 108 failureThreshold: 60 109 {{- toYaml .Values.fe.probe | nindent 10 }} 110 {{- end }} 111 - name: be 112 characterType: starrocks 113 workloadType: Stateful 114 componentDefRef: 115 - componentDefName: fe 116 componentRefEnv: 117 - name: FE_SERVICE_NAME 118 valueFrom: 119 type: ServiceRef 120 configSpecs: 121 - name: starrocks-be-cm 122 templateRef: starrocks-be-cm 123 namespace: {{ .Release.Namespace }} 124 volumeName: starrocks-be-cm 125 volumeTypes: 126 - name: be-storage 127 type: data 128 - name: be-log 129 type: log 130 podSpec: 131 containers: 132 - name: be 133 args: 134 - $(FE_SERVICE_NAME) 135 command: 136 - /opt/starrocks/be_entrypoint.sh 137 volumeMounts: 138 - mountPath: /opt/starrocks/be/log 139 name: be-log 140 - mountPath: /opt/starrocks/be/storage 141 name: be-storage 142 - mountPath: /opt/starrocks/be/conf 143 name: starrocks-be-cm 144 env: 145 - name: TZ 146 value: Asia/Shanghai 147 - name: POD_NAME 148 valueFrom: 149 fieldRef: 150 apiVersion: v1 151 fieldPath: metadata.name 152 - name: POD_IP 153 valueFrom: 154 fieldRef: 155 apiVersion: v1 156 fieldPath: status.podIP 157 - name: HOST_IP 158 valueFrom: 159 fieldRef: 160 apiVersion: v1 161 fieldPath: status.hostIP 162 - name: POD_NAMESPACE 163 valueFrom: 164 fieldRef: 165 apiVersion: v1 166 fieldPath: metadata.namespace 167 - name: HOST_TYPE 168 value: FQDN 169 - name: COMPONENT_NAME 170 value: be 171 - name: FE_QUERY_PORT 172 value: "{{ .Values.fe.queryPort }}" 173 - name: CONFIGMAP_MOUNT_PATH 174 value: /etc/starrocks/be/conf 175 lifecycle: 176 preStop: 177 exec: 178 command: 179 - /opt/starrocks/be_prestop.sh 180 ports: 181 - containerPort: 9060 182 name: be-port 183 protocol: TCP 184 - containerPort: 8040 185 name: webserver-port 186 protocol: TCP 187 - containerPort: 9050 188 name: heartbeat-port 189 protocol: TCP 190 - containerPort: 8060 191 name: brpc-port 192 protocol: TCP 193 securityContext: 194 allowPrivilegeEscalation: false 195 readOnlyRootFilesystem: false 196 {{- if .Values.be.resources }} 197 resources: 198 {{- toYaml .Values.be.resources | nindent 10 }} 199 {{- end }} 200 {{- if .Values.be.probe }} 201 livenessProbe: 202 failureThreshold: 3 203 {{- toYaml .Values.be.probe | nindent 10 }} 204 readinessProbe: 205 failureThreshold: 3 206 {{- toYaml .Values.be.probe | nindent 10 }} 207 startupProbe: 208 failureThreshold: 60 209 {{- toYaml .Values.be.probe | nindent 10 }} 210 {{- end }}