From c25a5bfb3a36ed7ee3a4c63be34bb6b1f2d80bf1 Mon Sep 17 00:00:00 2001 From: zhyass <34016424+zhyass@users.noreply.github.com> Date: Fri, 2 Apr 2021 15:07:50 +0800 Subject: [PATCH 1/4] dockerfile: update mysql dockerfile [summary] 1. Replace the source list. 2. Specify the installed version of percona. 3. Add MYSQL_ROOT_PASSWORD parameter. 4. Update the docs. --- dockerfile/mysql/Dockerfile | 25 +++++++++++++++++++------ dockerfile/mysql/README.md | 10 ++++++++-- dockerfile/mysql/mysql-entry.sh | 11 ++++++++++- docs/zh-cn/mysql.md | 10 ++++++++-- 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/dockerfile/mysql/Dockerfile b/dockerfile/mysql/Dockerfile index fb1cfb75..f34aefc1 100644 --- a/dockerfile/mysql/Dockerfile +++ b/dockerfile/mysql/Dockerfile @@ -9,6 +9,15 @@ RUN set -ex; \ --no-create-home \ --gid mysql \ mysql; \ + # replace the source list. + echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse" > /etc/apt/sources.list; \ + echo "# deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse" >> /etc/apt/sources.list; \ + echo "deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list; \ + echo "# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list; \ + echo "deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list; \ + echo "# deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list; \ + echo "deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list; \ + echo "#deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list; \ apt-get update; \ if ! which gpg; then \ apt-get install -y --no-install-recommends gnupg; \ @@ -18,6 +27,10 @@ RUN set -ex; \ fi; \ rm -rf /var/lib/apt/lists/* +ENV PS_VERSION 5.7.33-36-1 +ENV OS_VER focal +ENV FULL_PERCONA_VERSION "$PS_VERSION.$OS_VER" + RUN set -ex; \ key='9334A25F8507EFA5'; \ export GNUPGHOME="$(mktemp -d)"; \ @@ -30,17 +43,17 @@ RUN set -ex; \ apt-get update; \ export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true; \ { \ - echo percona-server-server-5.7 percona-server-server-5.7/root-pass password ''; \ - echo percona-server-server-5.7 percona-server-server-5.7/re-root-pass password ''; \ + echo percona-server-server-5.7=${FULL_PERCONA_VERSION} percona-server-server-5.7=${FULL_PERCONA_VERSION}/root-pass password ''; \ + echo percona-server-server-5.7=${FULL_PERCONA_VERSION} percona-server-server-5.7=${FULL_PERCONA_VERSION}/re-root-pass password ''; \ echo tzdata tzdata/Areas select Asia; \ echo tzdata tzdata/Zones/Asia select Shanghai; \ } | debconf-set-selections; \ # install "tzdata" for /usr/share/zoneinfo/ apt-get install -y --no-install-recommends libjemalloc1 libmecab2 tzdata; \ apt-get install -y --no-install-recommends \ - percona-server-server-5.7 \ - percona-server-common-5.7 \ - percona-server-tokudb-5.7; \ + percona-server-server-5.7=${FULL_PERCONA_VERSION} \ + percona-server-common-5.7=${FULL_PERCONA_VERSION} \ + percona-server-tokudb-5.7=${FULL_PERCONA_VERSION}; \ # TokuDB modifications echo "LD_PRELOAD=/usr/lib64/libjemalloc.so.1" >> /etc/default/mysql; \ echo "THP_SETTING=never" >> /etc/default/mysql; \ @@ -60,4 +73,4 @@ COPY --chown=mysql:mysql my.cnf /etc/mysql/my.cnf ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 3306 -CMD ["mysqld"] \ No newline at end of file +CMD ["mysqld"] diff --git a/dockerfile/mysql/README.md b/dockerfile/mysql/README.md index e77dfade..5b6cac77 100644 --- a/dockerfile/mysql/README.md +++ b/dockerfile/mysql/README.md @@ -1,13 +1,19 @@ # Introduction -The [mysql](https://hub.docker.com/repository/docker/zhyass/percona57) image has been pushed into docker hub. The available versions are: +The [MySQL](https://hub.docker.com/repository/docker/kryptondb/percona) image has been pushed into docker hub. The available versions are: - zhyass/percona57 (tag: beta0.1.0) + kryptondb/percona (tag: 5.7.33) Images are updated when new releases are published. # Environment Variables +## `MYSQL_ROOT_PASSWORD` + +This variable specifies a password that will be set for the root superuser account. + +**Notice**: Setting the MySQL root user password on the command line is insecure. + ## `MYSQL_REPL_PASSWORD` This variable specifies a replication password that will be set for the replication account, the default is `Repl_123`. diff --git a/dockerfile/mysql/mysql-entry.sh b/dockerfile/mysql/mysql-entry.sh index becac804..2a527aa5 100755 --- a/dockerfile/mysql/mysql-entry.sh +++ b/dockerfile/mysql/mysql-entry.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e # usage: file_env VAR [DEFAULT] # ie: file_env 'XYZ_DB_PASSWORD' 'example' @@ -57,6 +58,8 @@ fi DATADIR="$(_get_config 'datadir')" if [ ! -d "$DATADIR/mysql" ]; then + file_env 'MYSQL_ROOT_PASSWORD' + mkdir -p "$DATADIR" echo 'Initializing database' @@ -103,12 +106,18 @@ if [ ! -d "$DATADIR/mysql" ]; then -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'root') OR host NOT IN ('localhost') ; - CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY '' ; + SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; + GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ; + CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + fi + file_env 'MYSQL_REPL_PASSWORD' 'Repl_123' echo "GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* to 'qc_repl'@'%' IDENTIFIED BY '$MYSQL_REPL_PASSWORD' ;" | "${mysql[@]}" echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" diff --git a/docs/zh-cn/mysql.md b/docs/zh-cn/mysql.md index b9b03c02..46ef5bfd 100644 --- a/docs/zh-cn/mysql.md +++ b/docs/zh-cn/mysql.md @@ -1,14 +1,20 @@ # 简介 -[MySQL](https://hub.docker.com/repository/docker/zhyass/percona57) 镜像已经发布到 docker hub 中, 当前可用版本为: +[MySQL](https://hub.docker.com/repository/docker/kryptondb/percona) 镜像已经发布到 docker hub 中, 当前可用版本为: - zhyass/percona57 (tag: beta0.1.0) + kryptondb/percona (tag: 5.7.33) 发布新版本时会在此更新。 # 环境变量 +## `MYSQL_ROOT_PASSWORD` + +指定 root 超级账户密码,可以为空。 + +**注意**: 在命令行上设置 MySQL root 用户密码是不安全的。 + ## `MYSQL_REPL_PASSWORD` 指定复制账户密码,默认为 `Repl_123`。 From ea75e9da0c9b6a96b494dd55b1e8e9779b17f6cf Mon Sep 17 00:00:00 2001 From: zhyass <34016424+zhyass@users.noreply.github.com> Date: Fri, 2 Apr 2021 15:18:21 +0800 Subject: [PATCH 2/4] dockerfile: update xenon dockerfile [summary] 1. Change the base image to alpine. 2. Add MYSQL_ROOT_PASSWORD parameter. 3. Change krypton to xenon. 4. Support disable monitor when the xenon start. --- README.md | 6 +-- dockerfile/krypton/Dockerfile | 40 ------------------ dockerfile/krypton/README.md | 23 ----------- dockerfile/xenon/Dockerfile | 41 +++++++++++++++++++ dockerfile/xenon/README.md | 35 ++++++++++++++++ .../krypton-entry.sh => xenon/xenon-entry.sh} | 36 +++++++++------- docs/others/setup-rw-svc.md | 2 +- docs/zh-cn/krypton.md | 26 ------------ docs/zh-cn/xenon.md | 36 ++++++++++++++++ 9 files changed, 138 insertions(+), 107 deletions(-) delete mode 100644 dockerfile/krypton/Dockerfile delete mode 100644 dockerfile/krypton/README.md create mode 100644 dockerfile/xenon/Dockerfile create mode 100644 dockerfile/xenon/README.md rename dockerfile/{krypton/krypton-entry.sh => xenon/xenon-entry.sh} (65%) delete mode 100644 docs/zh-cn/krypton.md create mode 100644 docs/zh-cn/xenon.md diff --git a/README.md b/README.md index 4889a315..4b69032a 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ ## Dockerfile -### Krypton +### Xenon -- [简体中文](docs/zh-cn/krypton.md) -- [English](dockerfile/krypton/README.md) +- [简体中文](docs/zh-cn/xenon.md) +- [English](dockerfile/xenon/README.md) ### MySQL diff --git a/dockerfile/krypton/Dockerfile b/dockerfile/krypton/Dockerfile deleted file mode 100644 index a49f1f11..00000000 --- a/dockerfile/krypton/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -# Builder image -FROM golang:1.13-buster as builder - -ARG KRYPTON_BRANCH=feature_adapt_k8s -RUN set -ex; \ - mkdir -p /go/src/github.com/andyli029; \ - cd /go/src/github.com/andyli029; \ - git clone --branch $KRYPTON_BRANCH https://github.com/andyli029/krypton.git; \ - cd krypton; \ - make build - -FROM ubuntu:focal - -RUN set -ex; \ - groupadd --gid 999 --system mysql; \ - useradd \ - --uid 999 \ - --system \ - --home-dir /var/lib/mysql \ - --no-create-home \ - --gid mysql \ - mysql; \ - apt-get update; \ - apt-get install -y --no-install-recommends curl; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /krypton /etc/krypton /var/log/krypton /var/lib/krypton; \ - echo "/etc/krypton/krypton.json" > /krypton/config.path; \ - # allow to change config files - chown -R mysql:mysql /krypton /etc/krypton /var/log/krypton /var/lib/krypton - -VOLUME ["/var/lib/krypton", "/var/log/krypton"] - -COPY --from=builder --chown=mysql:mysql /go/src/github.com/andyli029/krypton/bin/xenon /krypton/krypton -COPY --from=builder --chown=mysql:mysql /go/src/github.com/andyli029/krypton/bin/xenoncli /krypton/kryptoncli -COPY krypton-entry.sh /docker-entrypoint.sh -ENTRYPOINT ["/docker-entrypoint.sh"] - -USER mysql -EXPOSE 8801 -CMD ["/krypton/krypton", "-c", "/etc/krypton/krypton.json"] diff --git a/dockerfile/krypton/README.md b/dockerfile/krypton/README.md deleted file mode 100644 index 940a76c3..00000000 --- a/dockerfile/krypton/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Introduction - -The [krypton](https://hub.docker.com/repository/docker/zhyass/krypton) image has been pushed into docker hub. The available versions are: - - zhyass/krypton (tag: beta0.1.0) - -Images are updated when new releases are published. - -# Environment Variables - -## `MYSQL_REPL_PASSWORD` - -This variable specifies a replication password that will be set in the configuration file `krypton.json`, the default is `Repl_123`. - -## `HOST_SUFFIX` - -This variable is used to specify the endpoint in the kubenetes cluster, default is nil. - -# Build Image - -``` -docker build -t krypton:v1.0 . -``` diff --git a/dockerfile/xenon/Dockerfile b/dockerfile/xenon/Dockerfile new file mode 100644 index 00000000..e600545b --- /dev/null +++ b/dockerfile/xenon/Dockerfile @@ -0,0 +1,41 @@ +############################################################################## +# Build Xenon +############################################################################### + +FROM golang:1.13-buster as builder + +ARG XENON_BRANCH=feature_adapt_k8s +RUN set -ex; \ + mkdir -p /go/src/github.com/radondb; \ + cd /go/src/github.com/radondb; \ + git clone --branch $XENON_BRANCH https://github.com/radondb/xenon.git; \ + cd xenon; \ + make build + +############################################################################### +# Docker image for Xenon +############################################################################### + +FROM alpine:3.13 + +RUN set -ex \ + # Create a group and user + && addgroup -g 777 mysql && adduser -u 777 -g 777 -S mysql \ + && apk add --no-cache curl bash \ + && mkdir -p /etc/xenon /var/lib/xenon /lib64 \ + && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 \ + && echo "/etc/xenon/xenon.json" > /config.path \ + # allow to change config files + && chown -R 777:777 /etc/xenon /var/lib/xenon + +COPY --from=builder --chown=777:777 /go/src/github.com/radondb/xenon/bin/xenon /usr/local/bin/xenon +COPY --from=builder --chown=777:777 /go/src/github.com/radondb/xenon/bin/xenoncli /usr/local/bin/xenoncli +COPY xenon-entry.sh /usr/local/bin/docker-entrypoint + +USER 777 +WORKDIR / +EXPOSE 8801 +VOLUME ["/var/lib/xenon"] + +ENTRYPOINT ["docker-entrypoint"] +CMD ["xenon", "-c", "/etc/xenon/xenon.json"] diff --git a/dockerfile/xenon/README.md b/dockerfile/xenon/README.md new file mode 100644 index 00000000..5ed7b584 --- /dev/null +++ b/dockerfile/xenon/README.md @@ -0,0 +1,35 @@ +# Introduction + +The [Xenon](https://hub.docker.com/repository/docker/kryptondb/xenon) image has been pushed into docker hub. The available versions are: + + kryptondb/xenon (tag: 1.1.5-alpha) + +Images are updated when new releases are published. + +# Environment Variables + +## `MYSQL_ROOT_PASSWORD` + +This variable specifies a root password that will be set in the configuration file `xenon.json`. + +## `MYSQL_REPL_PASSWORD` + +This variable specifies a replication password that will be set in the configuration file `xenon.json`, the default is `Repl_123`. + +## `HOST` + +This variable is used to specify the endpoint in the kubenetes cluster. + +## `LEADER_START_CMD` + +This variable is the shell command when leader start. + +## `LEADER_STOP_CMD` + +This variable is the shell command when leader stop. + +# Build Image + +``` +docker build -t xenon:v1.0 . +``` diff --git a/dockerfile/krypton/krypton-entry.sh b/dockerfile/xenon/xenon-entry.sh similarity index 65% rename from dockerfile/krypton/krypton-entry.sh rename to dockerfile/xenon/xenon-entry.sh index 138c8648..99db5612 100755 --- a/dockerfile/krypton/krypton-entry.sh +++ b/dockerfile/xenon/xenon-entry.sh @@ -1,4 +1,10 @@ -#!/bin/bash +#!/bin/sh +set -e + +# Indirect expansion (ie) is not supported in bourne shell. That's why we are using this "magic" here. +ie_gv() { + eval "echo \$$1" +} # usage: file_env VAR [DEFAULT] # ie: file_env 'XYZ_DB_PASSWORD' 'example' @@ -8,16 +14,18 @@ file_env() { local var="$1" local fileVar="${var}_FILE" local def="${2:-}" - if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - echo >&2 "error: both $var and $fileVar are set (but are exclusive)" - exit 1 + + if [ "$(ie_gv ${var})" != "" ] && [ "$(ie_gv ${fileVar})" != "" ]; then + in_error "Both $var and $fileVar are set (but are exclusive)" fi + local val="$def" - if [ "${!var:-}" ]; then - val="${!var}" - elif [ "${!fileVar:-}" ]; then - val="$(< "${!fileVar}")" + if [ "$(ie_gv ${var})" != "" ]; then + val=$(ie_gv ${var}) + elif [ "$(ie_gv ${fileVar})" != "" ]; then + val=`cat $(ie_gv ${fileVar})` fi + export "$var"="$val" unset "$fileVar" } @@ -25,6 +33,7 @@ file_env() { file_env 'HOST' $(hostname) file_env 'MYSQL_REPL_PASSWORD' 'Repl_123' +file_env 'MYSQL_ROOT_PASSWORD' '' file_env 'LEADER_START_CMD' ':' file_env 'LEADER_STOP_CMD' ':' @@ -46,26 +55,25 @@ printf '{ "admit-defeat-ping-count": 3, "admin": "root", "ping-timeout": 2000, - "passwd": "", + "passwd": "%s", "host": "localhost", "version": "mysql57", "master-sysvars": "tokudb_fsync_log_period=default;sync_binlog=default;innodb_flush_log_at_trx_commit=default", "slave-sysvars": "tokudb_fsync_log_period=1000;sync_binlog=1000;innodb_flush_log_at_trx_commit=1", - "port": 3306 + "port": 3306, + "monitor-disabled": true }, "raft": { "election-timeout": 10000, "admit-defeat-hearbeat-count": 5, "heartbeat-timeout": 2000, - "meta-datadir": "/var/lib/krypton/", + "meta-datadir": "/var/lib/xenon/", "leader-start-command": "%s", "leader-stop-command": "%s", "semi-sync-degrade": true, "purge-binlog-disabled": true, "super-idle": false } -}' "$HOST" "$MYSQL_REPL_PASSWORD" "$LEADER_START_CMD" "$LEADER_STOP_CMD" > /etc/krypton/krypton.json - -chown -R mysql:mysql /etc/krypton/krypton.json +}' "$HOST" "$MYSQL_REPL_PASSWORD" "$MYSQL_ROOT_PASSWORD" "$LEADER_START_CMD" "$LEADER_STOP_CMD" > /etc/xenon/xenon.json exec "$@" diff --git a/docs/others/setup-rw-svc.md b/docs/others/setup-rw-svc.md index ed4cfa2c..f197f89d 100644 --- a/docs/others/setup-rw-svc.md +++ b/docs/others/setup-rw-svc.md @@ -3,7 +3,7 @@ ## 1. Get the pod about leader ``` -# kubectl exec -ti $pod -c krypton /krypton/kryptoncli raft status | jq .leader | cut -d . -f 1 | tail -c +2 +# kubectl exec -ti $pod -c xenon xenoncli raft status | jq .leader | cut -d . -f 1 | tail -c +2 demo-krypton-1 ``` the leader is the result: `demo-krypton-1` diff --git a/docs/zh-cn/krypton.md b/docs/zh-cn/krypton.md deleted file mode 100644 index 230eaf24..00000000 --- a/docs/zh-cn/krypton.md +++ /dev/null @@ -1,26 +0,0 @@ - -# 简介 - -[krypton](https://hub.docker.com/repository/docker/zhyass/krypton) 镜像已经发布在 docker hub,当前可用版本: - -```bash -zhyass/krypton (tag: beta0.1.0) -``` - -发布新版本时会在此更新。 - -# 环境变量 - -## `MYSQL_REPL_PASSWORD` - -指定将在配置文件 `krypton.json` 中设置的复制账户密码,默认值为 `Repl_123`。 - -## `HOST_SUFFIX` - -指定 kubenetes 集群中的 endpoint ,默认为 nil 。 - -# 构建镜像 - -```bash -docker build -t krypton:v1.0 . -``` diff --git a/docs/zh-cn/xenon.md b/docs/zh-cn/xenon.md new file mode 100644 index 00000000..fea599cb --- /dev/null +++ b/docs/zh-cn/xenon.md @@ -0,0 +1,36 @@ + +# 简介 + +[Xenon](https://hub.docker.com/repository/docker/kryptondb/xenon) 镜像已经发布在 docker hub,当前可用版本: + + kryptondb/xenon (tag: 1.1.5-alpha) + +发布新版本时会在此更新。 + +# 环境变量 + +## `MYSQL_ROOT_PASSWORD` + +指定将在配置文件 `xenon.json` 中设置的 root 账户密码。 + +## `MYSQL_REPL_PASSWORD` + +指定将在配置文件 `xenon.json` 中设置的复制账户密码,默认值为 `Repl_123`。 + +## `HOST` + +指定 kubenetes 集群中的 endpoint。 + +## `LEADER_START_CMD` + +在 leader 节点启动时执行的 shell 命令。 + +## `LEADER_STOP_CMD` + +在 leader 节点停止时执行的 shell 命令。 + +# 构建镜像 + +```bash +docker build -t xenon:v1.0 . +``` From f5c6382064f638baeaed3e8a8c93986b1a19a8bb Mon Sep 17 00:00:00 2001 From: zhyass <34016424+zhyass@users.noreply.github.com> Date: Fri, 2 Apr 2021 15:35:23 +0800 Subject: [PATCH 3/4] charts: update the charts files [summary] 1. Add allowEmptyRootPassword and mysqlRootPassword values. 2. change the container to xenon. 3. Add mysql-root-password. 4. Add scripts volumeMounts. --- charts/README.md | 4 +- charts/templates/configmap.yaml | 9 ++- charts/templates/secrets.yaml | 14 ++-- charts/templates/statefulset.yaml | 121 ++++++++++++++++++------------ charts/values.yaml | 21 +++--- docs/zh-cn/charts.md | 4 +- 6 files changed, 101 insertions(+), 72 deletions(-) diff --git a/charts/README.md b/charts/README.md index 25645ead..828d8a80 100644 --- a/charts/README.md +++ b/charts/README.md @@ -99,12 +99,12 @@ The following table lists the configurable parameters of the krypton chart and t | `metrics.livenessProbe.timeoutSeconds` | When the probe times out | 5 | | `metrics.readinessProbe.initialDelaySeconds` | Delay before metrics readiness probe is initiated | 5 | | `metrics.readinessProbe.timeoutSeconds` | When the probe times out | 1 | -| `metrics.serviceMonitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | +| `metrics.serviceMonitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `true` | | `metrics.serviceMonitor.namespace` | Optional namespace in which to create ServiceMonitor | `nil` | | `metrics.serviceMonitor.interval` | Scrape interval. If not set, the Prometheus default scrape interval is used | 10s | | `metrics.serviceMonitor.scrapeTimeout` | Scrape timeout. If not set, the Prometheus default scrape timeout is used | `nil` | | `metrics.serviceMonitor.selector` | Default to kube-prometheus install, but should be set according to Prometheus install | `{ prometheus: kube-prometheus }` | -| `slowLogTail` | If set to `true` runs a container to tail mysql-slow.log in the pod | `false` | +| `slowLogTail` | If set to `true` runs a container to tail mysql-slow.log in the pod | `true` | | `resources` | Resource requests/limit | Memory: `32Mi`, CPU: `10m` | | `service.annotations` | Kubernetes annotations for service | {} | | `service.type` | Kubernetes service type | NodePort | diff --git a/charts/templates/configmap.yaml b/charts/templates/configmap.yaml index f98e07f3..027331e1 100644 --- a/charts/templates/configmap.yaml +++ b/charts/templates/configmap.yaml @@ -13,7 +13,8 @@ data: [mysqld] server-id=@@SERVER_ID@@ create-peers.sh: | - #!/bin/bash + #!/bin/sh + set -eu i=0 while [ $i -lt {{ .Values.replicaCount }} ] do @@ -23,15 +24,15 @@ data: else echo -n ",{{ template "fullname" . }}-${i}.{{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:8801" fi - let i++ + i=$((i+1)) done leader-start.sh: | - #!/bin/bash + #!/usr/bin/env bash curl -X PATCH -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type: application/json-patch+json" \ --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/{{ .Release.Namespace }}/pods/$HOSTNAME \ -d '[{"op": "replace", "path": "/metadata/labels/role", "value": "master"}]' leader-stop.sh: | - #!/bin/bash + #!/usr/bin/env bash curl -X PATCH -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type: application/json-patch+json" \ --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/{{ .Release.Namespace }}/pods/$HOSTNAME \ -d '[{"op": "replace", "path": "/metadata/labels/role", "value": "slave"}]' diff --git a/charts/templates/secrets.yaml b/charts/templates/secrets.yaml index 78e96d58..5509d52a 100644 --- a/charts/templates/secrets.yaml +++ b/charts/templates/secrets.yaml @@ -9,13 +9,13 @@ metadata: heritage: {{ .Release.Service | quote }} type: Opaque data: -# {{ if not .Values.mysql.allowEmptyRootPassword }} -# {{- if .Values.mysql.mysqlRootPassword }} -# mysql-root-password: {{ .Values.mysql.mysqlRootPassword | b64enc | quote }} -# {{- end }} -# {{- else }} -# mysql-root-password: {{ randAlphaNum 12 | b64enc | quote }} -# {{- end }} + {{- if not .Values.mysql.allowEmptyRootPassword }} + {{- if .Values.mysql.mysqlRootPassword }} + mysql-root-password: {{ .Values.mysql.mysqlRootPassword | b64enc | quote }} + {{- else }} + mysql-root-password: {{ randAlphaNum 12 | b64enc | quote }} + {{- end }} + {{- end }} {{- if and .Values.mysql.mysqlUser (and (ne .Values.mysql.mysqlUser "qc_repl") (ne .Values.mysql.mysqlUser "root")) }} {{- if .Values.mysql.mysqlPassword }} mysql-password: {{ .Values.mysql.mysqlPassword | b64enc | quote }} diff --git a/charts/templates/statefulset.yaml b/charts/templates/statefulset.yaml index 74f658a9..6e28e691 100644 --- a/charts/templates/statefulset.yaml +++ b/charts/templates/statefulset.yaml @@ -54,6 +54,8 @@ spec: cat /mnt/config-map/server-id.cnf | sed s/@@SERVER_ID@@/$((100 + $ordinal))/g > /mnt/conf.d/server-id.cnf # Copy appropriate conf.d files from config-map to config mount. cp -f /mnt/config-map/node.cnf /mnt/conf.d/ + cp -f /mnt/config-map/*.sh /mnt/scripts/ + chmod +x /mnt/scripts/* {{- if .Values.persistence.enabled }} # remove lost+found. rm -rf /mnt/data/lost+found @@ -66,6 +68,8 @@ spec: volumeMounts: - name: conf mountPath: /mnt/conf.d + - name: scripts + mountPath: /mnt/scripts - name: config-map mountPath: /mnt/config-map {{- if .Values.persistence.enabled }} @@ -89,16 +93,13 @@ spec: resources: {{ toYaml .Values.mysql.resources | indent 10 }} env: -# {{- if .Values.mysql.allowEmptyRootPassword }} -# - name: MYSQL_ALLOW_EMPTY_ROOT_PASSWORD -# value: "true" -# {{- else }} -# - name: MYSQL_ROOT_PASSWORD -# valueFrom: -# secretKeyRef: -# name: {{ template "fullname" . }} -# key: mysql-root-password -# {{- end }} + {{- if not .Values.mysql.allowEmptyRootPassword }} + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: mysql-root-password + {{- end }} - name: MYSQL_REPL_PASSWORD valueFrom: secretKeyRef: @@ -137,9 +138,15 @@ spec: livenessProbe: exec: command: - - /bin/sh - - "-c" - - mysqladmin ping -h 127.0.0.1 -u root + {{- if .Values.mysql.allowEmptyRootPassword }} + - sh + - -c + - mysqladmin ping -uroot + {{- else }} + - sh + - -c + - mysqladmin ping -uroot -p${MYSQL_ROOT_PASSWORD} + {{- end }} initialDelaySeconds: {{ .Values.mysql.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.mysql.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.mysql.livenessProbe.timeoutSeconds }} @@ -148,18 +155,24 @@ spec: readinessProbe: exec: command: - - /bin/sh - - "-c" - - mysql -h 127.0.0.1 -u root -e "SELECT 1" + {{- if .Values.mysql.allowEmptyRootPassword }} + - sh + - -c + - mysql -uroot -e "SELECT 1" + {{- else }} + - sh + - -c + - mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "SELECT 1" + {{- end }} initialDelaySeconds: {{ .Values.mysql.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.mysql.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.mysql.readinessProbe.timeoutSeconds }} successThreshold: {{ .Values.mysql.readinessProbe.successThreshold }} failureThreshold: {{ .Values.mysql.readinessProbe.failureThreshold }} - - name: krypton - image: "{{ .Values.krypton.image }}:{{ .Values.krypton.tag }}" + - name: xenon + image: "{{ .Values.xenon.image }}:{{ .Values.xenon.tag }}" imagePullPolicy: {{ .Values.imagePullPolicy | quote }} - {{- with .Values.krypton.args }} + {{- with .Values.xenon.args }} args: {{- range . }} - {{ . | quote }} @@ -169,23 +182,23 @@ spec: postStart: exec: {{- if lt 1 (.Values.replicaCount | int64) }} - command: ['sh', '-c', 'until /krypton/kryptoncli xenon ping > /dev/null 2>&1; do sleep 2; done && /krypton/kryptoncli mysql stopmonitor && /krypton/kryptoncli cluster add "$(/bin/bash /create-peers.sh)"'] + command: ['sh', '-c', 'until xenoncli xenon ping > /dev/null 2>&1; do sleep 2; done && xenoncli cluster add "$(/scripts/create-peers.sh)"'] {{- else }} - command: ['sh', '-c', 'until /krypton/kryptoncli xenon ping > /dev/null 2>&1; do sleep 2; done && /krypton/kryptoncli mysql stopmonitor && /krypton/kryptoncli raft trytoleader'] + command: ['sh', '-c', 'until xenoncli xenon ping > /dev/null 2>&1; do sleep 2; done && xenoncli raft trytoleader'] {{- end }} resources: -{{ toYaml .Values.krypton.resources | indent 10 }} +{{ toYaml .Values.xenon.resources | indent 10 }} volumeMounts: - - name: config-map - mountPath: /create-peers.sh - subPath: create-peers.sh - - name: config-map - mountPath: /leader-start.sh - subPath: leader-start.sh - - name: config-map - mountPath: /leader-stop.sh - subPath: leader-stop.sh + - name: scripts + mountPath: /scripts env: + {{- if not .Values.mysql.allowEmptyRootPassword }} + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: mysql-root-password + {{- end }} - name: MYSQL_REPL_PASSWORD valueFrom: secretKeyRef: @@ -198,43 +211,53 @@ spec: - name: HOST value: $(POD_HOSTNAME).{{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - name: LEADER_START_CMD - value: "/bin/bash /leader-start.sh" + value: "/scripts/leader-start.sh" - name: LEADER_STOP_CMD - value: "/bin/bash /leader-stop.sh" - {{- if .Values.krypton.extraEnvVars }} -{{ tpl .Values.krypton.extraEnvVars . | indent 8 }} + value: "/scripts/leader-stop.sh" + {{- if .Values.xenon.extraEnvVars }} +{{ tpl .Values.xenon.extraEnvVars . | indent 8 }} {{- end }} ports: - - name: krypton + - name: xenon containerPort: 8801 livenessProbe: exec: command: - pgrep - - krypton - initialDelaySeconds: {{ .Values.krypton.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.krypton.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.krypton.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.krypton.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.krypton.livenessProbe.failureThreshold }} + - xenon + initialDelaySeconds: {{ .Values.xenon.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.xenon.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.xenon.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.xenon.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.xenon.livenessProbe.failureThreshold }} readinessProbe: exec: command: - sh - -c - - "/krypton/kryptoncli xenon ping" - initialDelaySeconds: {{ .Values.krypton.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.krypton.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.krypton.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.krypton.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.krypton.readinessProbe.failureThreshold }} + - "xenoncli xenon ping" + initialDelaySeconds: {{ .Values.xenon.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.xenon.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.xenon.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.xenon.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.xenon.readinessProbe.failureThreshold }} {{- if .Values.metrics.enabled }} - name: metrics image: "{{ .Values.metrics.image }}:{{ .Values.metrics.tag }}" imagePullPolicy: {{ .Values.imagePullPolicy | quote }} resources: {{ toYaml .Values.resources | indent 10 }} + {{- if not .Values.mysql.allowEmptyRootPassword }} + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: mysql-root-password + command: ['sh', '-c', 'DATA_SOURCE_NAME="root:$MYSQL_ROOT_PASSWORD@(localhost:3306)/" /bin/mysqld_exporter' ] + {{- else }} command: ['sh', '-c', 'DATA_SOURCE_NAME="root@(localhost:3306)/" /bin/mysqld_exporter' ] + {{- end }} ports: - name: metrics containerPort: 9104 @@ -268,6 +291,8 @@ spec: volumes: - name: conf emptyDir: {} + - name: scripts + emptyDir: {} - name: logs emptyDir: {} - name: config-map diff --git a/charts/values.yaml b/charts/values.yaml index 89f28a4e..c866d25e 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -8,13 +8,14 @@ ## Always IfNotPresent Never imagePullPolicy: IfNotPresent -## String to partially override orangehrm.fullname template (will maintain the release name) +## String to partially override fullname template (will maintain the release name) ## # nameOverride: "" -## String to fully override orangehrm.fullname template +## String to fully override fullname template ## # fullnameOverride: "" +# Please donot modify `replicaCount`, after the cluster is created. replicaCount: 3 busybox: @@ -22,9 +23,11 @@ busybox: tag: 1.32 mysql: - image: zhyass/percona57 - tag: beta0.1.1 + image: kryptondb/percona + tag: 5.7.33 + allowEmptyRootPassword: true + # mysqlRootPassword: mysqlReplicationPassword: Repl_123 mysqlUser: qingcloud @@ -73,9 +76,9 @@ mysql: memory: 1Gi cpu: 500m -krypton: - image: zhyass/krypton - tag: beta0.1.2 +xenon: + image: kryptondb/xenon + tag: 1.1.5-alpha args: [] ## A string to add extra environment variables @@ -123,7 +126,7 @@ metrics: # Enable this if you're using https://github.com/coreos/prometheus-operator serviceMonitor: - enabled: false + enabled: true ## Specify a namespace if needed # namespace: monitoring # fallback to the prometheus default unless specified @@ -136,7 +139,7 @@ metrics: # prometheus: kube-prometheus ## When set to true will create sidecar to tail mysql slow log. -slowLogTail: false +slowLogTail: true resources: limits: diff --git a/docs/zh-cn/charts.md b/docs/zh-cn/charts.md index 30323288..9f596e02 100644 --- a/docs/zh-cn/charts.md +++ b/docs/zh-cn/charts.md @@ -100,12 +100,12 @@ kubectl delete pvc data-my-release-krypton-2 | `metrics.livenessProbe.timeoutSeconds` | 存活探针执行检测请求后,等待响应的超时时间 | 5 | | `metrics.readinessProbe.initialDelaySeconds` | Pod 启动后首次进行就绪检查的等待时间 | 5 | | `metrics.readinessProbe.timeoutSeconds` | 就绪探针执行检测请求后,等待响应的超时时间 | 1 | -| `metrics.serviceMonitor.enabled` | 若设置为 `true`, 将为 Prometheus operator 创建 ServiceMonitor | `false` | +| `metrics.serviceMonitor.enabled` | 若设置为 `true`, 将为 Prometheus operator 创建 ServiceMonitor | `true` | | `metrics.serviceMonitor.namespace` | 创建 ServiceMonitor 时,可指定命名空间 | `nil` | | `metrics.serviceMonitor.interval` | 数据采集间隔,若未指定,将使用 Prometheus 默认设置 | 10s | | `metrics.serviceMonitor.scrapeTimeout` | 数据采集超时时间,若未指定,将使用 Prometheus 默认设置 | `nil` | | `metrics.serviceMonitor.selector` | 默认为 kube-prometheus | `{ prometheus: kube-prometheus }` | -| `slowLogTail` | 若设置为 `true`,将启动一个容器用来查看 mysql-slow.log | `false` | +| `slowLogTail` | 若设置为 `true`,将启动一个容器用来查看 mysql-slow.log | `true` | | `resources` | 资源 请求/限制 | 内存: `32Mi`, CPU: `10m` | | `service.annotations` | Kubernetes 服务注释 | {} | | `service.type` | Kubernetes 服务类型 | NodePort | From a854e484cdc6f1f91604f29f1db6cc78814dd380 Mon Sep 17 00:00:00 2001 From: zhyass <34016424+zhyass@users.noreply.github.com> Date: Fri, 2 Apr 2021 15:55:40 +0800 Subject: [PATCH 4/4] *: update the charts docs --- charts/README.md | 36 +++++++++++++------------ docs/zh-cn/charts.md | 62 +++++++++++++++++++++++--------------------- 2 files changed, 51 insertions(+), 47 deletions(-) diff --git a/charts/README.md b/charts/README.md index 828d8a80..0ff401a5 100644 --- a/charts/README.md +++ b/charts/README.md @@ -55,8 +55,10 @@ The following table lists the configurable parameters of the krypton chart and t | `replicaCount` | The number of pods | `3` | | `busybox.image` | `busybox` image repository. | `busybox` | | `busybox.tag` | `busybox` image tag. | `1.32` | -| `mysql.image` | `mysql` image repository. | `zhyass/percona57` | -| `mysql.tag` | `mysql` image tag. | `beta0.1.0` | +| `mysql.image` | `mysql` image repository. | `kryptondb/percona` | +| `mysql.tag` | `mysql` image tag. | `5.7.33` | +| `mysql.allowEmptyRootPassword` | If set true, allow a empty root password. | `true` | +| `mysql.mysqlRootPassword` | Password for the `root` user. | | | `mysql.mysqlReplicationPassword` | Password for the `qc_repl` user. | `Repl_123`, random 12 characters if not set | | `mysql.mysqlUser` | Username of new user to create. | `qingcloud` | | `mysql.mysqlPassword` | Password for the new user. | `Qing@123`, random 12 characters if not set | @@ -76,21 +78,21 @@ The following table lists the configurable parameters of the krypton chart and t | `mysql.readinessProbe.failureThreshold` | Minimum consecutive failures for the mysql probe to be considered failed after having succeeded. | 3 | | `mysql.extraEnvVars` | Additional environment variables as a string to be passed to the `tpl` function | | | `mysql.resources` | CPU/Memory resource requests/limits for mysql. | Memory: `256Mi`, CPU: `100m` | -| `krypton.image` | `krypton` image repository. | `zhyass/krypton` | -| `krypton.tag` | `krypton` image tag. | `beta0.1.0` | -| `krypton.args` | Additional arguments to pass to the krypton container. | `[]` | -| `krypton.extraEnvVars` | Additional environment variables as a string to be passed to the `tpl` function | | -| `krypton.livenessProbe.initialDelaySeconds` | Delay before krypton liveness probe is initiated | 30 | -| `krypton.livenessProbe.periodSeconds` | How often to perform the krypton probe | 10 | -| `krypton.livenessProbe.timeoutSeconds` | When the krypton probe times out | 5 | -| `krypton.livenessProbe.successThreshold` | Minimum consecutive successes for krypton probe to be considered successful after having failed. | 1 | -| `krypton.livenessProbe.failureThreshold` | Minimum consecutive failures for the krypton probe to be considered failed after having succeeded.| 3 | -| `krypton.readinessProbe.initialDelaySeconds` | Delay before krypton readiness probe is initiated | 10 | -| `krypton.readinessProbe.periodSeconds` | How often to perform the krypton probe | 10 | -| `krypton.readinessProbe.timeoutSeconds` | When the krypton probe times out | 1 | -| `krypton.readinessProbe.successThreshold` | Minimum consecutive successes for krypton probe to be considered successful after having failed. | 1 | -| `krypton.readinessProbe.failureThreshold` | Minimum consecutive failures for the krypton probe to be considered failed after having succeeded.| 3 | -| `krypton.resources` | CPU/Memory resource requests/limits for krypton. | Memory: `128Mi`, CPU: `50m` | +| `xenon.image` | `xenon` image repository. | `kryptondb/xenon` | +| `xenon.tag` | `xenon` image tag. | `1.1.5-alpha` | +| `xenon.args` | Additional arguments to pass to the xenon container. | `[]` | +| `xenon.extraEnvVars` | Additional environment variables as a string to be passed to the `tpl` function | | +| `xenon.livenessProbe.initialDelaySeconds` | Delay before xenon liveness probe is initiated | 30 | +| `xenon.livenessProbe.periodSeconds` | How often to perform the xenon probe | 10 | +| `xenon.livenessProbe.timeoutSeconds` | When the xenon probe times out | 5 | +| `xenon.livenessProbe.successThreshold` | Minimum consecutive successes for xenon probe to be considered successful after having failed. | 1 | +| `xenon.livenessProbe.failureThreshold` | Minimum consecutive failures for the xenon probe to be considered failed after having succeeded. | 3 | +| `xenon.readinessProbe.initialDelaySeconds` | Delay before xenon readiness probe is initiated | 10 | +| `xenon.readinessProbe.periodSeconds` | How often to perform the xenon probe | 10 | +| `xenon.readinessProbe.timeoutSeconds` | When the xenon probe times out | 1 | +| `xenon.readinessProbe.successThreshold` | Minimum consecutive successes for xenon probe to be considered successful after having failed. | 1 | +| `xenon.readinessProbe.failureThreshold` | Minimum consecutive failures for the xenon probe to be considered failed after having succeeded. | 3 | +| `xenon.resources` | CPU/Memory resource requests/limits for xenon. | Memory: `128Mi`, CPU: `50m` | | `metrics.enabled` | Start a side-car prometheus exporter | `true` | | `metrics.image` | Exporter image | `prom/mysqld-exporter` | | `metrics.tag` | Exporter image | `v0.12.1` | diff --git a/docs/zh-cn/charts.md b/docs/zh-cn/charts.md index 9f596e02..945165b8 100644 --- a/docs/zh-cn/charts.md +++ b/docs/zh-cn/charts.md @@ -48,16 +48,18 @@ kubectl delete pvc data-my-release-krypton-2 下表列出了 krypton chart 的配置参数及对应的默认值。 -| 参数 | 描述 | 默认值 | -| -------------------------------------------- | -------------------------------------------------------- | ---------------------------------------- | -| `imagePullPolicy` | 镜像拉取策略 | `IfNotPresent` | -| `fullnameOverride` | 自定义全名覆盖 | | -| `nameOverride` | 自定义名称覆盖 | | -| `replicaCount` | Pod 数目 | `3` | -| `busybox.image` | `busybox` 镜像库地址 | `busybox` | -| `busybox.tag` | `busybox` 镜像标签 | `1.32` | -| `mysql.image` | `mysql` 镜像库地址 | `zhyass/percona57` | -| `mysql.tag` | `mysql` 镜像标签 | `beta0.1.0` | +| 参数 | 描述 | 默认值 | +| -------------------------------------------- | -------------------------------------------------------- | -------------------------------------- | +| `imagePullPolicy` | 镜像拉取策略 | `IfNotPresent` | +| `fullnameOverride` | 自定义全名覆盖 | | +| `nameOverride` | 自定义名称覆盖 | | +| `replicaCount` | Pod 数目 | `3` | +| `busybox.image` | `busybox` 镜像库地址 | `busybox` | +| `busybox.tag` | `busybox` 镜像标签 | `1.32` | +| `mysql.image` | `mysql` 镜像库地址 | `kryptondb/percona` | +| `mysql.tag` | `mysql` 镜像标签 | `5.7.33` | +| `mysql.allowEmptyRootPassword` | 如果为 `true`,允许 root 账号密码为空 | `true` | +| `mysql.mysqlRootPassword` | `root` 用户密码 | | | `mysql.mysqlReplicationPassword` | `qc_repl` 用户密码 | `Repl_123`, 如果没有设置则随机12个字符 | | `mysql.mysqlUser` | 新建用户的用户名 | `qingcloud` | | `mysql.mysqlPassword` | 新建用户的密码 | `Qing@123`, 如果没有设置则随机12个字符 | @@ -68,30 +70,30 @@ kubectl delete pvc data-my-release-krypton-2 | `mysql.livenessProbe.initialDelaySeconds` | Pod 启动后首次进行存活检查的等待时间 | 30 | | `mysql.livenessProbe.periodSeconds` | 存活检查的间隔时间 | 10 | | `mysql.livenessProbe.timeoutSeconds` | 存活探针执行检测请求后,等待响应的超时时间 | 5 | -| `mysql.livenessProbe.successThreshold` | 存活探针检测失败后认为成功的最小连接成功次数 | 1 | +| `mysql.livenessProbe.successThreshold` | 存活探针检测失败后认为成功的最小连接成功次数 | 1 | | `mysql.livenessProbe.failureThreshold` | 存活探测失败的重试次数,重试一定次数后将认为容器不健康 | 3 | -| `mysql.readinessProbe.initialDelaySeconds` | Pod 启动后首次进行就绪检查的等待时间 | 10 | -| `mysql.readinessProbe.periodSeconds` | 就绪检查的间隔时间 | 10 | -| `mysql.readinessProbe.timeoutSeconds` | 就绪探针执行检测请求后,等待响应的超时时间 | 1 | -| `mysql.readinessProbe.successThreshold` | 就绪探针检测失败后认为成功的最小连接成功次数 | 1 | +| `mysql.readinessProbe.initialDelaySeconds` | Pod 启动后首次进行就绪检查的等待时间 | 10 | +| `mysql.readinessProbe.periodSeconds` | 就绪检查的间隔时间 | 10 | +| `mysql.readinessProbe.timeoutSeconds` | 就绪探针执行检测请求后,等待响应的超时时间 | 1 | +| `mysql.readinessProbe.successThreshold` | 就绪探针检测失败后认为成功的最小连接成功次数 | 1 | | `mysql.readinessProbe.failureThreshold` | 就绪探测失败的重试次数,重试一定次数后将认为容器未就绪 | 3 | | `mysql.extraEnvVars` | 其他作为字符串传递给 `tpl` 函数的环境变量 | | | `mysql.resources` | `MySQL` 的资源请求/限制 | 内存: `256Mi`, CPU: `100m` | -| `krypton.image` | `krypton` 镜像库地址 | `zhyass/krypton` | -| `krypton.tag` | `krypton` 镜像标签 | `beta0.1.0` | -| `krypton.args` | 要传递到 krypton 容器的其他参数 | `[]` | -| `krypton.extraEnvVars` | 其他作为字符串传递给 `tpl` 函数的环境变量 | | -| `krypton.livenessProbe.initialDelaySeconds` | Pod 启动后首次进行存活检查的等待时间 | 30 | -| `krypton.livenessProbe.periodSeconds` | 存活检查的间隔时间 | 10 | -| `krypton.livenessProbe.timeoutSeconds` | 存活探针执行检测请求后,等待响应的超时时间 | 5 | -| `krypton.livenessProbe.successThreshold` | 存活探针检测失败后认为成功的最小连接成功次数 | 1 | -| `krypton.livenessProbe.failureThreshold` | 存活探测失败的重试次数,重试一定次数后将认为容器不健康 | 3 | -| `krypton.readinessProbe.initialDelaySeconds` | Pod 启动后首次进行就绪检查的等待时间 | 10 | -| `krypton.readinessProbe.periodSeconds` | 就绪检查的间隔时间 | 10 | -| `krypton.readinessProbe.timeoutSeconds` | 就绪探针执行检测请求后,等待响应的超时时间 | 1 | -| `krypton.readinessProbe.successThreshold` | 就绪探针检测失败后认为成功的最小连接成功次数 | 1 | -| `krypton.readinessProbe.failureThreshold` | 就绪探测失败的重试次数,重试一定次数后将认为容器未就绪 | 3 | -| `krypton.resources` | `krypton` 的资源请求/限制 | 内存: `128Mi`, CPU: `50m` | +| `xenon.image` | `xenon` 镜像库地址 | `kryptondb/xenon` | +| `xenon.tag` | `xenon` 镜像标签 | `1.1.5-alpha` | +| `xenon.args` | 要传递到 xenon 容器的其他参数 | `[]` | +| `xenon.extraEnvVars` | 其他作为字符串传递给 `tpl` 函数的环境变量 | | +| `xenon.livenessProbe.initialDelaySeconds` | Pod 启动后首次进行存活检查的等待时间 | 30 | +| `xenon.livenessProbe.periodSeconds` | 存活检查的间隔时间 | 10 | +| `xenon.livenessProbe.timeoutSeconds` | 存活探针执行检测请求后,等待响应的超时时间 | 5 | +| `xenon.livenessProbe.successThreshold` | 存活探针检测失败后认为成功的最小连接成功次数 | 1 | +| `xenon.livenessProbe.failureThreshold` | 存活探测失败的重试次数,重试一定次数后将认为容器不健康 | 3 | +| `xenon.readinessProbe.initialDelaySeconds` | Pod 启动后首次进行就绪检查的等待时间 | 10 | +| `xenon.readinessProbe.periodSeconds` | 就绪检查的间隔时间 | 10 | +| `xenon.readinessProbe.timeoutSeconds` | 就绪探针执行检测请求后,等待响应的超时时间 | 1 | +| `xenon.readinessProbe.successThreshold` | 就绪探针检测失败后认为成功的最小连接成功次数 | 1 | +| `xenon.readinessProbe.failureThreshold` | 就绪探测失败的重试次数,重试一定次数后将认为容器未就绪 | 3 | +| `xenon.resources` | `xenon` 的资源请求/限制 | 内存: `128Mi`, CPU: `50m` | | `metrics.enabled` | 以 side-car 模式开启 Prometheus Exporter | `true` | | `metrics.image` | Exporter 镜像地址 | `prom/mysqld-exporter` | | `metrics.tag` | Exporter 标签 | `v0.12.1` |