Skip to content

Commit

Permalink
perf: 容器化环境支持配置单独的归档库 #2317
Browse files Browse the repository at this point in the history
配置放在backupConfig下
  • Loading branch information
jsonwan committed Aug 7, 2023
1 parent 117d335 commit c774fbd
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 52 deletions.
46 changes: 24 additions & 22 deletions support-files/kubernetes/charts/bk-job/VALUES_LOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# chart values 更新日志
## 0.4.6
1.增加数据归档相关配置
1.增加备份服务中的数据归档相关配置
```yaml
## 数据归档配置
archive:
# 归档使用的MariaDB实例,若开启归档,必须配置该项内容
mariadb:
host: ""
port: ""
username: "job"
password: "job"
connection:
properties: ?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
# job-execute模块的归档配置
execute:
# 是否开启数据归档,默认不开启
enabled: false
# 归档任务运行的cron表达式,默认每天凌晨04:00
cron: 0 0 4 * * *
data:
# 热库中的数据保留时间(天)
keep_days: 30
delete:
# 是否删除热库中的过期老数据,默认不删除
## job-backup备份服务配置
backupConfig:
## 数据归档配置
archive:
# 归档使用的MariaDB实例,若开启归档,必须配置该项内容
mariadb:
host: ""
port: ""
username: "job"
password: "job"
connection:
properties: ?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
# job-execute模块的归档配置
execute:
# 是否开启数据归档,默认不开启
enabled: false
# 归档任务运行的cron表达式,默认每天凌晨04:00
cron: 0 0 4 * * *
data:
# 热库中的数据保留时间(天)
keep_days: 30
delete:
# 是否删除热库中的过期老数据,默认不删除
enabled: false
```
## 0.4.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ data:
idle-timeout: 6000
poolName: "job-execute-db"
validationTimeout: 5000
{{- if .Values.archive.execute.enabled }}
{{- if .Values.backupConfig.archive.execute.enabled }}
job-execute-archive:
driver-class-name: {{ include "job.jdbcMysqlDriverClass" . }}
type: com.zaxxer.hikari.HikariDataSource
jdbc-url: {{ include "job.jdbcMysqlScheme" . }}://{{ .Values.archive.mariadb.host }}:{{ .Values.archive.mariadb.port }}/job_execute{{ .Values.archive.mariadb.connection.properties }}
username: {{ .Values.archive.mariadb.username }}
jdbc-url: {{ include "job.jdbcMysqlScheme" . }}://{{ .Values.backupConfig.archive.mariadb.host }}:{{ .Values.backupConfig.archive.mariadb.port }}/job_execute{{ .Values.backupConfig.archive.mariadb.connection.properties }}
username: {{ .Values.backupConfig.archive.mariadb.username }}
password: ${archive-mariadb-password}
maximum-pool-size: 10
minimum-idle: 2
Expand Down Expand Up @@ -106,5 +106,5 @@ data:
repo: {{ .Values.backupConfig.artifactory.repo }}
execute:
archive:
{{- toYaml .Values.archive.execute | nindent 10 }}
{{- toYaml .Values.backupConfig.archive.execute | nindent 10 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ spec:
- name: mariadb
secret:
secretName: {{ include "job.mariadb.secretName" . }}
{{- if .Values.archive.execute.enabled }}
{{- if .Values.backupConfig.archive.execute.enabled }}
- name: archive-mariadb
secret:
secretName: {{ include "job.archiveMariadb.secretName" . }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.archive.execute.enabled }}
{{- if .Values.backupConfig.archive.execute.enabled }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -13,5 +13,5 @@ metadata:
{{- end }}
type: Opaque
data:
archive-mariadb-password: {{ .Values.archive.mariadb.password | b64enc | quote }}
archive-mariadb-password: {{ .Values.backupConfig.archive.mariadb.password | b64enc | quote }}
{{- end }}
45 changes: 22 additions & 23 deletions support-files/kubernetes/charts/bk-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -642,29 +642,6 @@ persistence:
## 在删除该声明后,这个卷也会被销毁(用于单节点环境,生产环境不推荐)。
# ref: https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/

## 数据归档配置
archive:
# 归档使用的MariaDB实例,若开启归档,必须配置该项内容
mariadb:
host: ""
port: ""
username: "job"
password: "job"
connection:
properties: ?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
# job-execute模块的归档配置
execute:
# 是否开启数据归档,默认不开启
enabled: false
# 归档任务运行的cron表达式,默认每天凌晨04:00
cron: 0 0 4 * * *
data:
# 热库中的数据保留时间(天)
keep_days: 30
delete:
# 是否删除热库中的过期老数据,默认不删除
enabled: false

## 蓝鲸日志采集配置
bkLogConfig:
# 是否开启蓝鲸日志采集
Expand Down Expand Up @@ -1025,6 +1002,28 @@ backupConfig:
artifactory:
# 存储后端使用制品库时使用的备份服务仓库代码
repo: backup
## 数据归档配置
archive:
# 归档使用的MariaDB实例,若开启归档,必须配置该项内容
mariadb:
host: ""
port: ""
username: "job"
password: "job"
connection:
properties: ?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
# job-execute模块的归档配置
execute:
# 是否开启数据归档,默认不开启
enabled: false
# 归档任务运行的cron表达式,默认每天凌晨04:00
cron: 0 0 4 * * *
data:
# 热库中的数据保留时间(天)
keep_days: 30
delete:
# 是否删除热库中的过期老数据,默认不删除
enabled: false
image:
registry: hub.bktencent.com
repository: blueking/job-backup
Expand Down

0 comments on commit c774fbd

Please sign in to comment.