github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/oracle-mysql/templates/clusterdefinition.yaml (about) 1 apiVersion: apps.kubeblocks.io/v1alpha1 2 kind: ClusterDefinition 3 metadata: 4 name: oracle-mysql 5 labels: 6 {{- include "oracle-mysql.labels" . | nindent 4 }} 7 spec: 8 connectionCredential: 9 username: root 10 password: "$(RANDOM_PASSWD)" 11 endpoint: "$(SVC_FQDN):$(SVC_PORT_mysql)" 12 host: "$(SVC_FQDN)" 13 port: "$(SVC_PORT_mysql)" 14 componentDefs: 15 - name: mysql-compdef 16 characterType: mysql 17 workloadType: Stateful 18 service: 19 ports: 20 - name: mysql 21 port: 3306 22 targetPort: mysql 23 volumeTypes: 24 - name: data 25 type: data 26 configSpecs: 27 - name: mysql-config 28 templateRef: oracle-mysql-config-template 29 constraintRef: oracle-mysql-config-constraints 30 volumeName: configs 31 namespace: {{ .Release.Namespace }} 32 defaultMode: 0755 33 monitor: 34 builtIn: false 35 exporterConfig: 36 scrapePort: 9104 37 scrapePath: "/metrics" 38 podSpec: 39 containers: 40 - name: mysql-container 41 imagePullPolicy: IfNotPresent 42 volumeMounts: 43 - mountPath: {{ .Values.dataMountPath }} 44 name: data 45 - mountPath: /etc/mysql/conf.d 46 name: configs 47 ports: 48 - containerPort: 3306 49 name: mysql 50 env: 51 - name: MYSQL_ROOT_HOST 52 value: {{ .Values.auth.rootHost | default "%" | quote }} 53 - name: MYSQL_ROOT_USER 54 valueFrom: 55 secretKeyRef: 56 name: $(CONN_CREDENTIAL_SECRET_NAME) 57 key: username 58 - name: MYSQL_ROOT_PASSWORD 59 valueFrom: 60 secretKeyRef: 61 name: $(CONN_CREDENTIAL_SECRET_NAME) 62 key: password 63 - name: mysql-exporter 64 imagePullPolicy: IfNotPresent 65 ports: 66 - name: metrics 67 containerPort: 9104 68 protocol: TCP 69 env: 70 - name: "MYSQL_MONITOR_USER" 71 valueFrom: 72 secretKeyRef: 73 name: $(CONN_CREDENTIAL_SECRET_NAME) 74 key: username 75 - name: "MYSQL_MONITOR_PASSWORD" 76 valueFrom: 77 secretKeyRef: 78 name: $(CONN_CREDENTIAL_SECRET_NAME) 79 key: password 80 - name: "DATA_SOURCE_NAME" 81 value: "$(MYSQL_MONITOR_USER):$(MYSQL_MONITOR_PASSWORD)@(localhost:3306)/"