kind: ConfigMap apiVersion: v1 metadata: name: goinception-config namespace: tools labels: app.kubernetes.io/name: goinception data: config.toml.template: |- host="0.0.0.0" advertise_address="" port=4000 [inc] check_autoincrement_datatype=true check_autoincrement_init_value=true check_autoincrement_name=true check_column_comment=true check_column_default_value=true check_column_position_change=true check_column_type_change=true check_dml_limit=true check_dml_orderby=true check_dml_where=true check_identifier=true check_index_prefix=true check_insert_field=true check_primary_key=true check_table_comment=true check_timestamp_default=true check_timestamp_count=false enable_autoincrement_unsigned=true enable_blob_type=true enable_column_charset=true enable_drop_database=true enable_drop_table=true enable_enum_set_bit=false enable_fingerprint=true enable_foreign_key=false enable_json_type=true enable_identifer_keyword=false enable_not_innodb=false enable_nullable=false enable_null_index_name=false enable_orderby_rand=true enable_partition_table=true enable_pk_columns_only_int=true enable_select_star=false enable_set_charset=true enable_set_collation=false enable_set_engine=false max_char_length=0 max_insert_rows=0 max_keys=5 max_key_parts=5 max_update_rows=5000 max_primary_key_parts=1 max_allowed_packet=33554432 merge_alter_table=true check_float_double=true support_charset="utf8,utf8mb4" support_collation="utf8_general_ci,utf8mb4_general_ci" backup_host="BACKUP_HOST_PLACEHOLDER" backup_port=BACKUP_PORT_PLACEHOLDER backup_user="BACKUP_USER_PLACEHOLDER" backup_password="BACKUP_PASSWORD_PLACEHOLDER" #安全更新是否开启. #-1表示不做操作,基于远端数据库[默认值] #0表示关闭安全更新 #1表示开启安全更新 sql_safe_updates=0 #lang="en-US" lang="zh-CN" #是否记录全量日志 general_log=false #开启统计功能 enable_sql_statistic=true [inc_level] er_cant_set_engine=2 er_cant_set_collation=2 er_table_must_have_comment=2 er_column_have_no_comment=2 er_table_must_have_pk=2 er_index_name_idx_prefix=1 er_index_name_uniq_prefix=1 er_autoinc_unsigned=2 er_alter_table_once=2 er_pk_too_many_parts=2 [osc] osc_on=false osc_min_table_size=16 osc_print_none=false osc_bin_dir="/usr/local/bin" [ghost] ghost_on=false ghost_allow_on_master=true ghost_assume_rbr=true ghost_chunk_size=1000 ghost_concurrent_rowcount=true ghost_cut_over="atomic" ghost_cut_over_lock_timeout_seconds=3 ghost_default_retries=60 ghost_heartbeat_interval_millis=500 ghost_max_lag_millis=1500 ghost_approve_renamed_columns=true ghost_exponential_backoff_max_interval=64 ghost_dml_batch_size=10 [log] # Log level: debug, info, warn, error, fatal. level="error" # Log format, one of json, text, console. format="console" --- apiVersion: v1 kind: Service metadata: name: archery-goinception namespace: tools labels: app.kubernetes.io/name: goinception spec: type: ClusterIP ports: - port: 4000 targetPort: 4000 protocol: TCP name: goinception selector: app.kubernetes.io/name: goinception app.kubernetes.io/instance: archery --- apiVersion: apps/v1 kind: Deployment metadata: name: archery-goinception namespace: tools labels: app.kubernetes.io/name: goinception spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: goinception app.kubernetes.io/instance: archery template: metadata: labels: app.kubernetes.io/name: goinception app.kubernetes.io/instance: archery spec: initContainers: - name: override-configs #image: "busybox:latest" #image: "harbor.uenpay.com/base/busybox:latest" image: "registry.cn-hangzhou.aliyuncs.com/zhengyu1992/busybox:latest" imagePullPolicy: IfNotPresent env: - name: BACKUP_HOST value: "tidb-cluster-tidb" - name: BACKUP_PORT value: "4000" - name: BACKUP_USER value: "admin" - name: BACKUP_PASSWORD value: "Uenpay@2024" command: ['sh', '-c', 'sed "s/BACKUP_HOST_PLACEHOLDER/${BACKUP_HOST}/g;s/BACKUP_PORT_PLACEHOLDER/${BACKUP_PORT}/g;s/BACKUP_USER_PLACEHOLDER/${BACKUP_USER}/g;s/BACKUP_PASSWORD_PLACEHOLDER/${BACKUP_PASSWORD}/g" /etc/goinception-template/config.toml.template > /etc/goinception/config.toml; cat /etc/goinception/config.toml'] volumeMounts: - name: goinception-config-volume mountPath: /etc/goinception - name: goinception-config-template mountPath: /etc/goinception-template containers: - name: goinception #image: "harbor.uenpay.com/base/goinception:latest" image: "registry.cn-hangzhou.aliyuncs.com/zhengyu1992/goinception:latest" imagePullPolicy: IfNotPresent ports: - name: goinception containerPort: 4000 protocol: TCP livenessProbe: tcpSocket: port: goinception resources: {} command: - "/usr/local/bin/dumb-init" - "/goInception" - "--config=/etc/goinception/config.toml" volumeMounts: - name: goinception-config-volume mountPath: /etc/goinception volumes: - name: goinception-config-volume emptyDir: {} - name: goinception-config-template configMap: name: goinception-config