Skip to content

Commit

Permalink
Merge pull request radondb#23 from zhyass/features
Browse files Browse the repository at this point in the history
update the dockerfile and the charts
  • Loading branch information
andyli029 committed Apr 2, 2021
2 parents 8b3d47f + a854e48 commit 28578bb
Show file tree
Hide file tree
Showing 19 changed files with 335 additions and 237 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
40 changes: 21 additions & 19 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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` |
Expand All @@ -99,12 +101,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 |
Expand Down
9 changes: 5 additions & 4 deletions charts/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"}]'
14 changes: 7 additions & 7 deletions charts/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Loading

0 comments on commit 28578bb

Please sign in to comment.