diff --git a/addons-cluster/mysql/templates/cluster.yaml b/addons-cluster/mysql/templates/cluster.yaml index c6679af88..3fc1e2a30 100644 --- a/addons-cluster/mysql/templates/cluster.yaml +++ b/addons-cluster/mysql/templates/cluster.yaml @@ -38,7 +38,6 @@ spec: {{- end }} {{- if eq .Values.topology "server-with-proxy" }} - name: proxysql - componentDef: proxysql replicas: {{.Values.proxysql.replicas}} resources: limits: diff --git a/addons/mysql/config/proxysql.tpl b/addons/mysql/config/proxysql.tpl index a7d5fe0df..fcfcbd6fe 100644 --- a/addons/mysql/config/proxysql.tpl +++ b/addons/mysql/config/proxysql.tpl @@ -14,7 +14,7 @@ {{- $proxysql_component := fromJson "{}" }} {{- range $i, $e := $.cluster.spec.componentSpecs }} {{- if index $e "componentDef" }} - {{- if hasPrefix "proxy" $e.componentDef }} + {{- if hasPrefix "proxysql" $e.componentDef }} {{- $proxysql_component = $e }} {{- end }} {{- end }} @@ -28,24 +28,22 @@ admin_variables= refresh_interval="2000" cluster_proxysql_servers_save_to_disk="true" cluster_mysql_servers_diffs_before_sync="3" - cluster_password="nb2wZpZ9OXXTF2Mv" mysql_ifaces="0.0.0.0:6032" cluster_check_status_frequency="100" cluster_mysql_users_diffs_before_sync="3" cluster_proxysql_servers_diffs_before_sync="3" - admin_credentials="admin:admin;cluster:nb2wZpZ9OXXTF2Mv" + admin_credentials="admin:${PROXYSQL_ADMIN_PASSWORD};cluster:${PROXYSQL_CLUSTER_PASSWORD}" admin-hash_passwords="true" cluster_check_interval_ms="200" cluster_mysql_servers_save_to_disk="true" cluster_mysql_users_save_to_disk="true" cluster_mysql_query_rules_diffs_before_sync="3" cluster_mysql_query_rules_save_to_disk="true" - cluster_username="cluster" } mysql_variables= { threads="4" - monitor_password="proxysql" + monitor_password="${PROXYSQL_MONITOR_PASSWORD}" poll_timeout="2000" ssl_p2s_cert="/var/lib/certs/tls.crt" server_version="8.0.27" @@ -122,17 +120,5 @@ proxysql_servers= mysql_servers= ( -{{- range $i, $e := until $mysql_replicas }} - {{- $mysql_service_host := printf "%s-%s-mysql-%d.%s" $clusterName $mysql_component.name $i $namespace }} - - {{- $hostgroup_id := 3 }} - {{- if eq $i 0 }} - {{- $hostgroup_id = 2 }} - {{- end }} - {{- if eq $i (sub $mysql_replicas 1) }} - { hostgroup_id = {{$hostgroup_id}} , hostname = "{{$mysql_service_host}}", port = 3306, weight = 1, use_ssl = 0 } - {{- else }} - { hostgroup_id = {{$hostgroup_id}} , hostname = "{{$mysql_service_host}}", port = 3306, weight = 1, use_ssl = 0 }, - {{- end }} -{{- end }} +${MYSQL_SERVERS} ) \ No newline at end of file diff --git a/addons/mysql/scripts-ut-spec/proxysql_entry_spec.sh b/addons/mysql/scripts-ut-spec/proxysql_entry_spec.sh index b62f0aac7..402c83436 100644 --- a/addons/mysql/scripts-ut-spec/proxysql_entry_spec.sh +++ b/addons/mysql/scripts-ut-spec/proxysql_entry_spec.sh @@ -22,25 +22,15 @@ Describe "ProxySQL Entry Script Tests" AfterAll 'cleanup' Describe "Run proxysql-entry.sh with FRONTEND_TLS_ENABLED=false" - It "runs successfully" + replace_config_variables() { + return 0 + } When run source ../scripts/proxysql-entry.sh The status should be failure The stdout should include "Configuring proxysql ..." - The stderr should include "/scripts/proxysql/configure-proxysql.sh: No such file or directory" + The stderr should include "../scripts/proxysql-entry.sh" End End - - Describe "Log Function Tests" - Include ../scripts/proxysql-entry.sh - - It "outputs a log message" - When call log "INFO" "Test log message" - The status should be success - The stdout should include "INFO" - The stdout should include "Test log message" - End - End - End \ No newline at end of file diff --git a/addons/mysql/scripts/configure-proxysql.sh b/addons/mysql/scripts/configure-proxysql.sh index 0a1bcbb72..0f6123edc 100644 --- a/addons/mysql/scripts/configure-proxysql.sh +++ b/addons/mysql/scripts/configure-proxysql.sh @@ -91,7 +91,7 @@ CREATE USER 'monitor'@'%' IDENTIFIED BY 'monitor'; GRANT USAGE, REPLICATION CLIENT ON *.* TO 'monitor'@'%'; EOF # wait for proxysql process to run -wait_for_mysql admin admin 127.0.0.1 6032 +wait_for_mysql admin ${PROXYSQL_ADMIN_PASSWORD} 127.0.0.1 6032 log "INFO" "CURRENT CONFIGURATION" @@ -108,9 +108,9 @@ select * from runtime_proxysql_servers; " -mysql -uadmin -padmin -h127.0.0.1 -P6032 -vvve "$configuration_sql" +mysql -uadmin -p${PROXYSQL_ADMIN_PASSWORD} -h127.0.0.1 -P6032 -vvve "$configuration_sql" -mysql -uadmin -padmin -h127.0.0.1 -P6032 -vvve "insert or replace into mysql_users (username,password) values ('$MYSQL_ROOT_USER','$MYSQL_ROOT_PASSWORD');LOAD MYSQL USERS TO RUNTIME;SAVE MYSQL USERS TO DISK;" -mysql -uadmin -padmin -h127.0.0.1 -P6032 -vvve "insert into mysql_replication_hostgroups ( writer_hostgroup, reader_hostgroup, comment) values (2,3,'proxy');load mysql servers to runtime;save mysql servers to disk;" -mysql -uadmin -padmin -h127.0.0.1 -P6032 -vvve "select * from main.runtime_mysql_replication_hostgroups; select * from main.mysql_replication_hostgroups; select * from mysql_replication_hostgroups;" +mysql -uadmin -p${PROXYSQL_ADMIN_PASSWORD} -h127.0.0.1 -P6032 -vvve "insert or replace into mysql_users (username,password) values ('$MYSQL_ROOT_USER','$MYSQL_ROOT_PASSWORD');LOAD MYSQL USERS TO RUNTIME;SAVE MYSQL USERS TO DISK;" +mysql -uadmin -p${PROXYSQL_ADMIN_PASSWORD} -h127.0.0.1 -P6032 -vvve "insert into mysql_replication_hostgroups ( writer_hostgroup, reader_hostgroup, comment) values (2,3,'proxy');load mysql servers to runtime;save mysql servers to disk;" +mysql -uadmin -p${PROXYSQL_ADMIN_PASSWORD} -h127.0.0.1 -P6032 -vvve "select * from main.runtime_mysql_replication_hostgroups; select * from main.mysql_replication_hostgroups; select * from mysql_replication_hostgroups;" diff --git a/addons/mysql/scripts/init-mysql-instance-for-orc.sh b/addons/mysql/scripts/init-mysql-instance-for-orc.sh index a00b66b88..548649dc5 100644 --- a/addons/mysql/scripts/init-mysql-instance-for-orc.sh +++ b/addons/mysql/scripts/init-mysql-instance-for-orc.sh @@ -38,9 +38,6 @@ GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO '$topology_user'@'%'; GRANT SELECT ON mysql.slave_master_info TO '$topology_user'@'%'; GRANT DROP ON _pseudo_gtid_.* to '$topology_user'@'%'; GRANT ALL ON kb_orc_meta_cluster.* TO '$topology_user'@'%'; -CREATE USER IF NOT EXISTS 'proxysql'@'%' IDENTIFIED BY 'proxysql'; -GRANT SELECT ON performance_schema.* TO 'proxysql'@'%'; -GRANT SELECT ON sys.* TO 'proxysql'@'%'; set global slave_net_timeout = 4; EOF diff --git a/addons/mysql/scripts/proxysql-entry.sh b/addons/mysql/scripts/proxysql-entry.sh index 936eb3053..f33896eb1 100644 --- a/addons/mysql/scripts/proxysql-entry.sh +++ b/addons/mysql/scripts/proxysql-entry.sh @@ -1,6 +1,13 @@ #!/bin/bash set -e +# This is magic for shellspec ut framework. +# Sometime, functions are defined in a single shell script. +# You will want to test it. but you do not want to run the script. +# When included from shellspec, __SOURCED__ variable defined and script +# end here. The script path is assigned to the __SOURCED__ variable. +${__SOURCED__:+false} : || return 0 + # use the current scrip name while putting log script_name=${0##*/} @@ -13,14 +20,25 @@ if [ $FRONTEND_TLS_ENABLED == "true" ]; then cp /var/lib/frontend/server/tls.key /var/lib/proxysql/proxysql-key.pem fi -function timestamp() { - date +"%Y/%m/%d %T" -} +function gen_mysql_servers { + IFS=',' read -r -a MYSQL_FQDNS_ARRAY <<< "$MYSQL_FQDNS" + result="" + + for fqdn in "${MYSQL_FQDNS_ARRAY[@]}"; do + index=$(echo "$fqdn" | grep -oP '\d+(?=\.)') + HOSTGROUP_ID=3 + if [ "$index" -eq 0 ]; then + HOSTGROUP_ID=2 + fi + config=" { hostgroup_id = $HOSTGROUP_ID , hostname = \"$fqdn\", port = 3306, weight = 1, use_ssl = 0 }" + if [ -z "$result" ]; then + result="$config" + else + result="$result, \n$config" + fi + done -function log() { - local log_type="$1" - local msg="$2" - echo "$(timestamp) [$script_name] [$log_type] $msg" + echo "$result" } # If command has arguments, prepend proxysql @@ -33,13 +51,23 @@ if [ "${__SOURCED__:+x}" ]; then return 0 fi +function replace_config_variables() { + mysql_servers=$(gen_mysql_servers) + awk -v mysql_servers="$mysql_servers" '{gsub(/\${MYSQL_SERVERS}/, mysql_servers); print}' /config/custom-config/proxysql.tpl > /proxysql.cnf + + sed -i "s|\${PROXYSQL_MONITOR_PASSWORD}|${PROXYSQL_MONITOR_PASSWORD}|g" /proxysql.cnf + sed -i "s|\${PROXYSQL_CLUSTER_PASSWORD}|${PROXYSQL_CLUSTER_PASSWORD}|g" /proxysql.cnf + sed -i "s|\${PROXYSQL_ADMIN_PASSWORD}|${PROXYSQL_ADMIN_PASSWORD}|g" /proxysql.cnf +} + +echo "Configuring proxysql ..." +replace_config_variables # Start ProxySQL with PID 1 -exec proxysql -c /etc/custom-config/proxysql.cnf -f $CMDARG & +exec proxysql -c /proxysql.cnf -f $CMDARG & pid=$! -log "INFO" "Configuring proxysql ..." /scripts/proxysql/configure-proxysql.sh -log "INFO" "Waiting for proxysql ..." +echo "Waiting for proxysql ..." wait $pid diff --git a/addons/mysql/templates/_helpers.tpl b/addons/mysql/templates/_helpers.tpl index bc0058d21..60ed19197 100644 --- a/addons/mysql/templates/_helpers.tpl +++ b/addons/mysql/templates/_helpers.tpl @@ -108,6 +108,8 @@ systemAccounts: numDigits: 5 numSymbols: 0 letterCase: MixedCases + - name: proxysql + statement: CREATE USER IF NOT EXISTS '${KB_ACCOUNT_NAME}' IDENTIFIED BY '${KB_ACCOUNT_PASSWORD}'; GRANT SELECT ON performance_schema.* TO '${KB_ACCOUNT_NAME}'; GRANT SELECT ON sys.* TO '${KB_ACCOUNT_NAME}'; vars: - name: CLUSTER_NAME valueFrom: @@ -138,6 +140,20 @@ vars: name: root password: Required lifecycleActions: + accountProvision: + exec: + container: mysql + image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository }}:8.0.33 + command: + - /bin/sh + - -c + - | + set -ex + eval statement=\"${KB_ACCOUNT_STATEMENT}\" + mysql -u${MYSQL_ROOT_USER} -p${MYSQL_ROOT_PASSWORD} -P3306 -h127.0.0.1 -e "${statement}" + targetPodSelector: Role + matchingKey: primary + roleProbe: periodSeconds: {{ .Values.roleProbe.periodSeconds }} timeoutSeconds: {{ .Values.roleProbe.timeoutSeconds }} @@ -188,8 +204,7 @@ serviceRefDeclarations: - serviceKind: orchestrator serviceVersion: "^*" services: - - name: mysql-server - serviceName: mysql-server + - name: default spec: ports: - name: mysql @@ -220,6 +235,8 @@ systemAccounts: numDigits: 5 numSymbols: 0 letterCase: MixedCases + - name: proxysql + statement: CREATE USER IF NOT EXISTS '${KB_ACCOUNT_NAME}' IDENTIFIED BY '${KB_ACCOUNT_PASSWORD}'; GRANT SELECT ON performance_schema.* TO '${KB_ACCOUNT_NAME}'; GRANT SELECT ON sys.* TO '${KB_ACCOUNT_NAME}'; roles: - name: primary serviceable: true @@ -276,6 +293,19 @@ exporter: {{- define "mysql-orc.spec.lifecycle.common" }} +accountProvision: + exec: + container: mysql + image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository }}:8.0.33 + command: + - /bin/sh + - -c + - | + set -ex + eval statement=\"${KB_ACCOUNT_STATEMENT}\" + mysql -u${MYSQL_ROOT_USER} -p${MYSQL_ROOT_PASSWORD} -P3306 -h127.0.0.1 -e "${statement}" + targetPodSelector: Role + matchingKey: primary roleProbe: exec: env: diff --git a/addons/mysql/templates/_names.tpl b/addons/mysql/templates/_names.tpl index 9a890eb16..d8b94ca08 100644 --- a/addons/mysql/templates/_names.tpl +++ b/addons/mysql/templates/_names.tpl @@ -19,6 +19,13 @@ Define mysql component definition regex regular {{- printf "^%s" (include "mysql.cmpdNamePrefix" .) -}}-\d+\.\d+.*$ {{- end -}} +{{/* +Define mysql component definition common regex regular (semisync and orc) +*/}} +{{- define "mysql.componentDefCommonRegex" -}} +{{- printf "^%s" (include "mysql.cmpdNamePrefix" .) -}}(?:-[\w\d]+)?-\d+\.\d+.*$ +{{- end -}} + {{/* Define mysql component definition name */}} @@ -58,5 +65,5 @@ Define mysql component definition name Define mysql component definition name */}} {{- define "proxysql.componentDefName" -}} -{{- printf "%s-proxysql-%s" (include "mysql.cmpdNamePrefix" .) .Chart.Version -}} +{{- printf "proxysql-%s-%s" (include "mysql.cmpdNamePrefix" .) .Chart.Version -}} {{- end -}} diff --git a/addons/mysql/templates/cmpd-proxysql.yaml b/addons/mysql/templates/cmpd-proxysql.yaml index 9a985e9f1..afca14b7e 100644 --- a/addons/mysql/templates/cmpd-proxysql.yaml +++ b/addons/mysql/templates/cmpd-proxysql.yaml @@ -44,7 +44,40 @@ spec: - name: db port: 6033 targetPort: db + systemAccounts: + - name: admin + initAccount: true + passwordGenerationPolicy: + length: 16 + numDigits: 8 + numSymbols: 0 + letterCase: MixedCases + - name: cluster + initAccount: true + passwordGenerationPolicy: + length: 16 + numDigits: 8 + numSymbols: 0 + letterCase: MixedCases vars: + - name: PROXYSQL_ADMIN_PASSWORD + valueFrom: + credentialVarRef: + name: admin + password: Required + - name: PROXYSQL_CLUSTER_PASSWORD + valueFrom: + credentialVarRef: + name: admin + password: Required + - name: PROXYSQL_MONITOR_PASSWORD + valueFrom: + credentialVarRef: + compDef: {{ include "mysql.componentDefCommonRegex" . }} + name: proxysql + optional: false + password: Required + - name: CLUSTER_NAME valueFrom: clusterVarRef: @@ -61,33 +94,41 @@ spec: - name: BACKEND_SERVER valueFrom: serviceVarRef: - compDef: {{ include "mysql.componentDefRegex" . }} - name: mysql-server + compDef: {{ include "mysql.componentDefCommonRegex" . }} + name: default host: Required optional: false - name: MYSQL_ROOT_USER valueFrom: credentialVarRef: ## reference the current component definition name - compDef: {{ include "mysql.componentDefRegex" . }} + compDef: {{ include "mysql.componentDefCommonRegex" . }} name: root username: Required - name: MYSQL_ROOT_PASSWORD valueFrom: credentialVarRef: ## reference the current component definition name - compDef: {{ include "mysql.componentDefRegex" . }} + compDef: {{ include "mysql.componentDefCommonRegex" . }} name: root password: Required - name: MYSQL_PORT valueFrom: serviceVarRef: - compDef: {{ include "mysql.componentDefRegex" . }} - name: mysql-server + compDef: {{ include "mysql.componentDefCommonRegex" . }} + name: default optional: false port: name: mysql option: Required + - name: MYSQL_FQDNS + valueFrom: + componentVarRef: + compDef: {{ include "mysql.componentDefCommonRegex" . }} + name: default + optional: false + podFQDNs: Required + runtime: volumes: containers: @@ -98,7 +139,7 @@ spec: - /scripts/proxysql/proxysql-entry.sh - --reload volumeMounts: - - mountPath: /etc/custom-config + - mountPath: /config/custom-config name: proxy-config - mountPath: /scripts/proxysql name: proxysql-scripts diff --git a/addons/mysql/templates/configmap-proxysql.yaml b/addons/mysql/templates/configmap-proxysql.yaml index c6ebfa98e..58148550f 100644 --- a/addons/mysql/templates/configmap-proxysql.yaml +++ b/addons/mysql/templates/configmap-proxysql.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - proxysql.cnf: |- + proxysql.tpl: |- {{- .Files.Get "config/proxysql.tpl" | nindent 4 }} kind: ConfigMap metadata: diff --git a/addons/mysql/values.yaml b/addons/mysql/values.yaml index b9b3d7789..2858c2dba 100644 --- a/addons/mysql/values.yaml +++ b/addons/mysql/values.yaml @@ -61,6 +61,13 @@ auth: ## replicationPassword: "" + ## MySQL ProxySQL parameters + proxysql: + ## @param auth.proxysql.username ProxySQL username + username: "proxysql" + ## @param auth.proxysql.password ProxySQL password + password: "proxysql" + configTemplate: ## @param config template name diff --git a/examples/mysql/cluster-orc-proxysql.yaml b/examples/mysql/cluster-orc-proxysql.yaml new file mode 100644 index 000000000..fecc14956 --- /dev/null +++ b/examples/mysql/cluster-orc-proxysql.yaml @@ -0,0 +1,85 @@ +apiVersion: apps.kubeblocks.io/v1 +kind: Cluster +metadata: + name: mysql-orc-proxysql-cluster + namespace: default +spec: + # Specifies the behavior when a Cluster is deleted. + # Valid options are: [DoNotTerminate, Delete, WipeOut] (`Halt` is deprecated since KB 0.9) + # - `DoNotTerminate`: Prevents deletion of the Cluster. This policy ensures that all resources remain intact. + # - `Delete`: Extends the `Halt` policy by also removing PVCs, leading to a thorough cleanup while removing all persistent data. + # - `WipeOut`: An aggressive policy that deletes all Cluster resources, including volume snapshots and backups in external storage. This results in complete data removal and should be used cautiously, primarily in non-production environments to avoid irreversible data loss. + terminationPolicy: Delete + # Specifies the topology of the Cluster. Currently supports `semisync`, `semisync-proxysql`, `orc`, `orc-proxysql` + # - `semisync`: A topology that uses semi-sync replication for MySQL high availability. + # - `semisync-proxysql`: A topology that uses semi-sync replication and Proxysql for load balancing and query routing. + # - `orc`: A topology that uses MySQL Orchestrator for MySQL high availability and management. + # - `orc-proxysql`: A topology that uses MySQL Orchestrator and Proxysql for high availability, management, and load balancing. + topology: orc-proxysql + clusterDef: mysql + # Specifies a list of ClusterComponentSpec objects used to define the + # individual Components that make up a Cluster. + # This field allows for detailed configuration of each Component within the Cluster + componentSpecs: + - name: mysql + # Specifies the ComponentDefinition custom resource (CR) that defines the + # Component's characteristics and behavior. + # Supports three different ways to specify the ComponentDefinition: + # - regular expression - recommended + # - full name - recommended + # - name prefix + serviceVersion: "8.0.35" + # Determines whether metrics exporter information is annotated on the + # Component's headless Service. + # Valid options are [true, false] + disableExporter: true + # Specifies the desired number of replicas in the Component + replicas: 2 + # Specifies the resources required by the Component. + resources: + limits: + cpu: "0.5" + memory: "0.5Gi" + requests: + cpu: "0.5" + memory: "0.5Gi" + # Specifies a list of PersistentVolumeClaim templates that define the storage + # requirements for the Component. + volumeClaimTemplates: + # Refers to the name of a volumeMount defined in + # `componentDefinition.spec.runtime.containers[*].volumeMounts` + - name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + # Set the storage size as needed + storage: 20Gi + serviceRefs: + - name: orchestrator + namespace: default # Set to your orchestrator cluster namespace + clusterServiceSelector: + cluster: myorc # Set to your orchestrator cluster name + service: + component: orchestrator + service: orchestrator + port: orc-http + - name: proxysql + # Specifies the ComponentDefinition custom resource (CR) that defines the + # Component's characteristics and behavior. + # Supports three different ways to specify the ComponentDefinition: + # - regular expression - recommended + # - full name - recommended + # - name prefix + serviceVersion: 2.4.4 + # Specifies the desired number of replicas in the Component + replicas: 1 + # Specifies the resources required by the Component. + resources: + limits: + cpu: '0.5' + memory: 0.5Gi + requests: + cpu: '0.5' + memory: 0.5Gi \ No newline at end of file diff --git a/examples/mysql/cluster-proxysql.yaml b/examples/mysql/cluster-proxysql.yaml new file mode 100644 index 000000000..ba4798011 --- /dev/null +++ b/examples/mysql/cluster-proxysql.yaml @@ -0,0 +1,80 @@ +apiVersion: apps.kubeblocks.io/v1 +kind: Cluster +metadata: + name: mysql-proxysql-cluster + namespace: default +spec: + # Specifies the behavior when a Cluster is deleted. + # Valid options are: [DoNotTerminate, Delete, WipeOut] (`Halt` is deprecated since KB 0.9) + # - `DoNotTerminate`: Prevents deletion of the Cluster. This policy ensures that all resources remain intact. + # - `Delete`: Extends the `Halt` policy by also removing PVCs, leading to a thorough cleanup while removing all persistent data. + # - `WipeOut`: An aggressive policy that deletes all Cluster resources, including volume snapshots and backups in external storage. This results in complete data removal and should be used cautiously, primarily in non-production environments to avoid irreversible data loss. + terminationPolicy: Delete + # Specifies the topology of the Cluster. so far, only `semisync`, `semisync-proxysql`, `orc`, `orc-proxysql` are supported + # - `semisync`: A topology that uses syncer semi-sync replication for MySQL high availability. + # - `semisync-proxysql`: A topology that uses syncer semi-sync replication and Proxysql for load balancing and query routing. + # - `orc`: A topology that uses MySQL Orchestrator for MySQL high availability and management. + # - `orc-proxysql`: A topology that uses MySQL Orchestrator and Proxysql for high availability, management, and load balancing. + topology: semisync-proxysql + clusterDef: mysql + # Specifies a list of ClusterComponentSpec objects used to define the + # individual Components that make up a Cluster. + # This field allows for detailed configuration of each Component within the Cluster + componentSpecs: + - name: mysql + # Specifies the ComponentDefinition custom resource (CR) that defines the + # Component's characteristics and behavior. + # Supports three different ways to specify the ComponentDefinition: + # - the regular expression - recommended + # - the full name - recommended + # - the name prefix + serviceVersion: 8.0.35 + # Determines whether metrics exporter information is annotated on the + # Component's headless Service. + # Valid options are [true, false] + disableExporter: false + # Specifies the desired number of replicas in the Component + replicas: 2 + # Specifies the resources required by the Component. + resources: + limits: + cpu: '0.5' + memory: 0.5Gi + requests: + cpu: '0.5' + memory: 0.5Gi + # Specifies a list of PersistentVolumeClaim templates that define the storage + # requirements for the Component. + volumeClaimTemplates: + # Refers to the name of a volumeMount defined in + # `componentDefinition.spec.runtime.containers[*].volumeMounts + - name: data + spec: + # The name of the StorageClass required by the claim. + # If not specified, the StorageClass annotated with + # `storageclass.kubernetes.io/is-default-class=true` will be used by default + storageClassName: "" + accessModes: + - ReadWriteOnce + resources: + requests: + # Set the storage size as needed + storage: 20Gi + - name: proxysql + # Specifies the ComponentDefinition custom resource (CR) that defines the + # Component's characteristics and behavior. + # Supports three different ways to specify the ComponentDefinition: + # - the regular expression - recommended + # - the full name - recommended + # - the name prefix + serviceVersion: 2.4.4 + # Specifies the desired number of replicas in the Component + replicas: 1 + # Specifies the resources required by the Component. + resources: + limits: + cpu: '0.5' + memory: 0.5Gi + requests: + cpu: '0.5' + memory: 0.5Gi