Skip to content

Commit

Permalink
Merge branch 'apecloud:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
yabinji authored Apr 7, 2024
2 parents ad2292e + 2f7d6e9 commit 358abaf
Show file tree
Hide file tree
Showing 159 changed files with 2,332 additions and 1,655 deletions.
1 change: 1 addition & 0 deletions .github/workflows/auto-sync-addons-cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "addons/**"
branches:
- 'main'
- 'release-*'

env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion addons/apecloud-mysql/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ sources:
- https://github.com/apecloud/kubeblocks/

annotations:
addon.kubeblocks.io/kubeblocks-version: ">=0.7.0"
addon.kubeblocks.io/kubeblocks-version: ">=0.9.0"
addon.kubeblocks.io/model: "RDBMS"
addon.kubeblocks.io/provider: "apecloud"
26 changes: 10 additions & 16 deletions addons/apecloud-mysql/config/mysql8-auditlog-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,15 @@ general_log_file=/data/mysql/log/mysqld.log
{{- end }}
{{ end }}

## for auditlog
loose_audit_log_dir=/data/mysql/auditlog
loose_audit_log_enabled=ON
#loose_audit_log_buffer_size=8388608
#loose_audit_log_connection_policy=ALL
#loose_audit_log_event_buffer_size=2048
#loose_audit_log_flush=OFF
loose_audit_log_policy=ALL
loose_audit_log_format=PLAIN # PLAIN or JSON
#loose_audit_log_row_limit=100000
loose_audit_log_skip=OFF
loose_audit_log_statement_policy=ALL
#loose_audit_log_strategy=ASYNCHRONOUS
## TODO select which format by env when creating a cluster?
loose_audit_log_version=MYSQL_V1 # MYSQL_V1 or MYSQL_V3
# audit log
plugin-load-add=audit_log=audit_log.so
loose_audit_log_handler=FILE # FILE, SYSLOG
loose_audit_log_file={{ $data_root }}/auditlog/audit.log
loose_audit_log_buffer_size=1Mb
loose_audit_log_policy=ALL # ALL, LOGINS, QUERIES, NONE
loose_audit_log_strategy=ASYNCHRONOUS
loose_audit_log_rotate_on_size=10485760
loose_audit_log_rotations=5

#innodb
innodb_doublewrite_batch_size=16
Expand Down Expand Up @@ -176,7 +170,7 @@ key_buffer_size=16777216
# From mysql8.0.23 is deprecated.
binlog_cache_size={{ $binlog_cache_size }}
# AWS binlog_format=MIXED, Aliyun is ROW
binlog_format=MIXED
binlog_format=ROW
binlog_row_image=FULL
# Aliyun AWS binlog_order_commits=ON
binlog_order_commits=ON
Expand Down
2 changes: 1 addition & 1 deletion addons/apecloud-mysql/config/mysql8-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ key_buffer_size=16777216
# From mysql8.0.23 is deprecated.
binlog_cache_size={{ $binlog_cache_size }}
# AWS binlog_format=MIXED, Aliyun is ROW
binlog_format=MIXED
binlog_format=ROW
binlog_row_image=FULL
# Aliyun AWS binlog_order_commits=ON
binlog_order_commits=ON
Expand Down
6 changes: 6 additions & 0 deletions addons/apecloud-mysql/dataprotection/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ trap handle_exit EXIT

export PATH="$PATH:$DP_DATASAFED_BIN_PATH"
export DATASAFED_BACKEND_BASE_PATH="$DP_BACKUP_BASE_PATH"

# compatible with version 0.6
if [ -f ${DATA_DIR}/mysql-bin.index ]; then
echo "" | datasafed push - "apecloud-mysql.old"
fi
# do xtrabackup
START_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
xtrabackup --compress=zstd --backup --safe-slave-backup --slave-info --stream=xbstream \
--host=${DP_DB_HOST} --port=${DP_DB_PORT} \
Expand Down
9 changes: 8 additions & 1 deletion addons/apecloud-mysql/dataprotection/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ export DATASAFED_BACKEND_BASE_PATH="$DP_BACKUP_BASE_PATH"
mkdir -p ${DATA_DIR}
TMP_DIR=${DATA_MOUNT_DIR}/temp
mkdir -p ${TMP_DIR} && cd ${TMP_DIR}

old_signal="apecloud-mysql.old"
log_bin=${LOG_BIN}
if [ "$(datasafed list ${old_signal})" == "${old_signal}" ]; then
log_bin="${DATA_DIR}/mysql-bin"
fi

datasafed pull "${DP_BACKUP_NAME}.xbstream" - | xbstream -x
xtrabackup --decompress --remove-original --target-dir=${TMP_DIR}
xtrabackup --prepare --target-dir=${TMP_DIR}
xtrabackup --move-back --target-dir=${TMP_DIR} --datadir=${DATA_DIR}/ --log-bin=${LOG_BIN}
xtrabackup --move-back --target-dir=${TMP_DIR} --datadir=${DATA_DIR}/ --log-bin=${log_bin}
touch ${DATA_DIR}/${SIGNAL_FILE}
rm -rf ${TMP_DIR}
chmod -R 0777 ${DATA_DIR}
21 changes: 20 additions & 1 deletion addons/apecloud-mysql/templates/clusterversion-auditlog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,29 @@ spec:
volumeName: mysql-config
namespace: {{ .Release.Namespace }}
versionsContext:
initContainers:
- command:
- bash
- -c
- |
cp /usr/lib/mysql/plugin/ {{ .Values.mysqlConfigs.dataMountPath }}/plugin -r
imagePullPolicy: Always
image: {{ .Values.image.registry | default "docker.io" }}/apecloud/mysql_audit_log:8.0.33
name: init-data
volumeMounts:
- mountPath: {{ .Values.mysqlConfigs.dataMountPath }}
name: data
containers:
- name: mysql
image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository }}:{{ .Values.image.audit.tag }}
image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ default "IfNotPresent" .Values.image.pullPolicy }}
command:
- bash
- -c
- |
mv {{ .Values.mysqlConfigs.dataMountPath }}/plugin/audit_log.so /usr/lib64/mysql/plugin/
rm -rf {{ .Values.mysqlConfigs.dataMountPath }}/plugin/
/scripts/setup.sh
- name: vttablet
image: {{ .Values.wesqlscale.image.registry | default .Values.image.registry }}/{{ .Values.wesqlscale.image.repository }}:{{ .Values.wesqlscale.image.tag }}
imagePullPolicy: {{ default "IfNotPresent" .Values.wesqlscale.image.pullPolicy }}
Expand Down
32 changes: 16 additions & 16 deletions addons/apecloud-mysql/templates/configconstraint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $cc := .Files.Get "config/mysql8-config-effect-scope.yaml" | fromYaml }}
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: {{ include "apecloud-mysql.configConstraintName" . }}
Expand All @@ -8,18 +8,18 @@ metadata:
spec:
# configmap reference
# tplRef: mysql-3node-tpl-8.0
reloadOptions:
dynamicReloadAction:
tplScriptTrigger:
sync: true
scriptConfigMapRef: {{ include "apecloud-mysql.cmReloadScriptName" .}}
namespace: {{ .Release.Namespace }}

# top level mysql configuration type
cfgSchemaTopLevelName: MysqlParameter
configSchemaTopLevelKey: MysqlParameter

# ConfigurationSchema that impose restrictions on engine parameter's rule
configurationSchema:
# schema: auto generate from mmmcue scripts
configSchema:
# schemaInJSON: auto generate from cue scripts
# example: ../../pkg/configuration/testdata/mysql_openapi.json
cue: |-
{{- .Files.Get "config/mysql8-config-constraint.cue" | nindent 6 }}
Expand Down Expand Up @@ -59,21 +59,21 @@ spec:
sectionName: mysqld
---
{{- $vttabletcc := .Files.Get "config/mysql-scale-vttablet-config-effect-scope.yaml" | fromYaml }}
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: {{ include "apecloud-mysql.configConstraintVttabletName" . }}

labels:
{{- include "apecloud-mysql.labels" . | nindent 4 }}
spec:
reloadOptions:
dynamicReloadAction:
autoTrigger:
processName: vttablet

cfgSchemaTopLevelName: VtTabletParameter
configSchemaTopLevelKey: VtTabletParameter

configurationSchema:
configSchema:
cue: |-
{{- .Files.Get "config/mysql-scale-vttablet-config-constraint.cue" | nindent 6 }}
Expand Down Expand Up @@ -110,16 +110,16 @@ spec:
iniConfig:
sectionName: vttablet
---
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: {{ include "apecloud-mysql.configConstraintVtconsensusName" . }}
labels:
{{- include "apecloud-mysql.labels" . | nindent 4 }}
spec:
cfgSchemaTopLevelName: VtConsensusParameter
configSchemaTopLevelKey: VtConsensusParameter

configurationSchema:
configSchema:
cue: |-
{{- .Files.Get "config/mysql-scale-vtconsensus-config-constraint.cue" | nindent 6 }}
# mysql-scale configuration file format
Expand All @@ -129,20 +129,20 @@ spec:
sectionName: vtconsensus
---
{{- $vtgatecc := .Files.Get "config/mysql-scale-vtgate-config-effect-scope.yaml" | fromYaml }}
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: {{ include "apecloud-mysql.configConstraintVtgateName" . }}
labels:
{{- include "apecloud-mysql.labels" . | nindent 4 }}
spec:
reloadOptions:
dynamicReloadAction:
autoTrigger:
processName: vtgate

cfgSchemaTopLevelName: VtGateParameter
configSchemaTopLevelKey: VtGateParameter

configurationSchema:
configSchema:
cue: |-
{{- .Files.Get "config/mysql-scale-vtgate-config-constraint.cue" | nindent 6 }}
Expand Down
2 changes: 1 addition & 1 deletion addons/apecloud-mysql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ wesqlscale:
# if the value of wesqlscale.image.registry is not specified using `--set`, it will be set to the value of 'image.registry' by default
registry: ""
repository: apecloud/apecloud-mysql-scale
tag: "0.2.6"
tag: "0.2.7"
pullPolicy: IfNotPresent

## @param resourceNamePrefix Prefix for all resources name created by this chart, that can avoid name conflict
Expand Down
2 changes: 1 addition & 1 deletion addons/apecloud-postgresql/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ sources:
- https://github.com/apecloud/kubeblocks/

annotations:
addon.kubeblocks.io/kubeblocks-version: ">=0.7.0"
addon.kubeblocks.io/kubeblocks-version: ">=0.9.0"
addon.kubeblocks.io/model: "RDBMS"
addon.kubeblocks.io/provider: "apecloud"
8 changes: 4 additions & 4 deletions addons/apecloud-postgresql/templates/configconstraint.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{{- $cc := .Files.Get "config/pg14-config-effect-scope.yaml" | fromYaml }}
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: apecloud-postgresql14-cc
labels:
{{- include "apecloud-postgresql.labels" . | nindent 4 }}
spec:
# top level mysql configuration type
cfgSchemaTopLevelName: PGParameter
configSchemaTopLevelKey: PGParameter

# ConfigurationSchema that impose restrictions on engine parameter's rule
configurationSchema:
# schema: auto generate from mmmcue scripts
configSchema:
# schemaInJSON: auto generate from cue scripts
# example: ../../pkg/configuration/testdata/mysql_openapi.json
cue: |-
{{- .Files.Get "config/pg14-config-constraint.cue" | nindent 6 }}
Expand Down
2 changes: 1 addition & 1 deletion addons/camellia-redis-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ maintainers:
url: https://github.com/apecloud/kubeblocks/deploy

annotations:
addon.kubeblocks.io/kubeblocks-version: ">=0.8.2"
addon.kubeblocks.io/kubeblocks-version: ">=0.9.0"
addon.kubeblocks.io/model: "key-value"
addon.kubeblocks.io/provider: "apecloud"
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: camellia-redis-proxy-application-config-constraints
labels:
{{- include "camellia-redis-proxy.labels" . | nindent 4 }}
spec:
reloadOptions:
dynamicReloadAction:
autoTrigger:
processName: camellia-redis-proxy-application

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: camellia-redis-proxy-properties-constraints
labels:
{{- include "camellia-redis-proxy.labels" . | nindent 4 }}
spec:
reloadOptions:
dynamicReloadAction:
autoTrigger:
processName: camellia-redis-proxy-properties

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: camellia-redis-proxy-properties-json-constraints
labels:
{{- include "camellia-redis-proxy.labels" . | nindent 4 }}
spec:
reloadOptions:
dynamicReloadAction:
autoTrigger:
processName: camellia-redis-proxy-properties-json

Expand Down
4 changes: 2 additions & 2 deletions addons/clickhouse/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: ClickHouse is an open-source column-oriented OLAP database manageme

type: application

version: 0.8.0
version: 0.9.0

appVersion: 22.9.4

Expand All @@ -28,6 +28,6 @@ maintainers:
url: https://github.com/apecloud/kubeblocks/deploy

annotations:
addon.kubeblocks.io/kubeblocks-version: ">=0.7.0"
addon.kubeblocks.io/kubeblocks-version: ">=0.9.0"
addon.kubeblocks.io/model: "RDBMS"
addon.kubeblocks.io/provider: "apecloud"
8 changes: 4 additions & 4 deletions addons/clickhouse/templates/configconstraints.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps.kubeblocks.io/v1alpha1
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
metadata:
name: clickhouse-constraints
Expand All @@ -9,11 +9,11 @@ metadata:
{{- end }}
spec:
# top level mysql configuration type
cfgSchemaTopLevelName: ClickhouseParameter
configSchemaTopLevelKey: ClickhouseParameter

# ConfigurationSchema that impose restrictions on engine parameter's rule
configurationSchema:
# schema: auto generate from mmmcue scripts
configSchema:
# schemaInJSON: auto generate from cue scripts
# example: ../../pkg/configuration/testdata/mysql_openapi.json
cue: |-
{{- .Files.Get "configs/clickhouse-config-constraint.cue" | nindent 6 }}
Expand Down
23 changes: 23 additions & 0 deletions addons/dmdb/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Loading

0 comments on commit 358abaf

Please sign in to comment.