Kubernetes 的 MySQL Operator 手冊  /  MySQL Operator 自訂資源屬性

第 8 章 MySQL Operator 自訂資源屬性

資源類型

InnoDBCluster

表 8.1 InnoDBCluster 的 Spec 表格

名稱 類型 描述 必要
apiVersion 字串 mysql.oracle.com/v2
kind 字串 InnoDBCluster
metadata 物件 請參閱 Kubernetes API 文件
spec 物件
status 物件

InnoDBCluster.spec

父項

表 8.2 InnoDBCluster.spec 的 Spec 表格

名稱 類型 描述 必要
secretName 字串

包含 root/預設帳戶密碼的通用類型 Secret 名稱

backupProfiles []物件

叢集的備份設定檔規格,可以從備份排程和一次性備份作業中參考

backupSchedules []物件

定期執行備份的排程

baseServerId 整數

叢集中執行個體的 MySQL server_id 的基礎值

  • 預設: 1000

  • 最小值: 0

  • 最大值: 4294967195

datadirVolumeClaimTemplate 物件

PersistentVolumeClaim 的範本,用作 datadir

edition 字串

MySQL 伺服器版本 (社群版或企業版)

imagePullPolicy 字串

預設為 Always,但在部署 Operator 時,於 deploy-operator.yaml 中設定為 IfNotPresent

imagePullSecrets []物件
imageRepository 字串

從中提取映像檔的儲存庫;預設為 container-registry.oracle.com/mysql

initDB 物件
instances 整數

叢集的 MySQL 複本執行個體數

  • 預設: 1

  • 最小值: 1

  • 最大值: 9

keyring 物件

金鑰環規格

logs 物件 MySQL Operator for Kubernetes 8.2.0-2.1.1 中新增的功能。
metrics 物件

Prometheus 風格指標提供者的設定;在 Kubernetes 的 MySQL Operator 8.1.0-2.1.0 中新增的功能。

mycnf 字串

my.cnf 的自訂設定新增項目

podAnnotations 物件
podLabels 物件
podSpec 物件
readReplicas []物件
router 物件

MySQL Router 規格

service 物件

用於連線至 InnoDB Cluster 的應用程式所使用的服務設定

serviceAccountName 字串
serviceFqdnTemplate 字串

解析為叢集無頭執行個體服務和個別 Pod 的 FQDN 範本;在 Kubernetes 的 MySQL Operator 8.4.0-2.1.3 中新增的功能。

tlsCASecretName 字串

包含 CA (ca.pem) 和 SSL 可選 CRL (crl.pem) 的通用類型 Secret 名稱

tlsSecretName 字串

包含 SSL 伺服器憑證和私密金鑰的 TLS 類型 Secret 名稱

tlsUseSelfSigned 布林值

啟用自我簽署 TLS 憑證的使用,以減少或停用基於 TLS 的安全性驗證

  • 預設:false

version 字串

MySQL 伺服器版本


InnoDBCluster.spec.backupProfiles[index]

父項

表 8.3 InnoDBCluster.spec.backupProfiles[index] 的 Spec 表格

名稱 類型 描述 必要
name 字串

內嵌備份設定檔,在其他地方稱為 backupProfileName

dumpInstance 物件
podAnnotations 物件
podLabels 物件
snapshot 物件

InnoDBCluster.spec.backupProfiles[index].dumpInstance

父項

表 8.4 InnoDBCluster.spec.backupProfiles[index].dumpInstance 的 Spec 表格

名稱 類型 描述 必要
dumpOptions 物件

直接傳遞至 MySQL Shell 的 DumpInstance() 的鍵值組字典

storage 物件

InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage

父項

表 8.5 InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage 的 Spec 表格

名稱 類型 描述 必要
azure 物件
ociObjectStorage 物件
persistentVolumeClaim 物件

要使用的 PVC 規格。在執行備份的 Pod 中「按原樣」使用。

s3 物件

InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage.azure

父項

表 8.6 InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage.azure 的 Spec 表格

名稱 類型 描述 必要
config 字串

具有 Azure BLOB 儲存體設定和認證的 Secret 名稱

containerName 字串

儲存 Dump 的 Azure BLOB 儲存體容器名稱

prefix 字串

容器中儲存 Dump 檔案的路徑


InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage.ociObjectStorage

父項

表 8.7 InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage.ociObjectStorage 的 Spec 表格

名稱 類型 描述 必要
bucketName 字串

儲存備份的 OCI 儲存桶名稱

credentials 字串

具有存取儲存桶資料的 Secret 名稱

prefix 字串

儲存備份的儲存桶路徑


InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage.s3

父項

表 8.8 InnoDBCluster.spec.backupProfiles[index].dumpInstance.storage.s3 的 Spec 表格

名稱 類型 描述 必要
bucketName 字串

儲存 Dump 的 S3 儲存桶名稱

config 字串

具有 S3 設定和認證的 Secret 名稱

endpoint 字串

覆寫端點 URL

prefix 字串

儲存 Dump 檔案的儲存桶路徑

profile 字串

設定檔正在設定檔中使用的設定檔

  • 預設:


InnoDBCluster.spec.backupProfiles[index].snapshot

父項

表 8.9 InnoDBCluster.spec.backupProfiles[index].snapshot 的 Spec 表格

名稱 類型 描述 必要
storage 物件

InnoDBCluster.spec.backupProfiles[index].snapshot.storage

父項

表 8.10 InnoDBCluster.spec.backupProfiles[index].snapshot.storage 的 Spec 表格

名稱 類型 描述 必要
azure 物件
ociObjectStorage 物件
persistentVolumeClaim 物件

要使用的 PVC 規格。在執行備份的 Pod 中「按原樣」使用。

s3 物件

InnoDBCluster.spec.backupProfiles[index].snapshot.storage.azure

父項

表 8.11 InnoDBCluster.spec.backupProfiles[index].snapshot.storage.azure 的 Spec 表格

名稱 類型 描述 必要
config 字串

具有 Azure BLOB 儲存體設定和認證的 Secret 名稱

containerName 字串

儲存 Dump 的 Azure BLOB 儲存體容器名稱

prefix 字串

容器中儲存 Dump 檔案的路徑


InnoDBCluster.spec.backupProfiles[index].snapshot.storage.ociObjectStorage

父項

表 8.12 InnoDBCluster.spec.backupProfiles[index].snapshot.storage.ociObjectStorage 的 Spec 表格

名稱 類型 描述 必要
bucketName 字串

儲存備份的儲存桶名稱

credentials 字串

具有存取儲存桶資料的 Secret 名稱

prefix 字串

儲存備份的儲存桶路徑


InnoDBCluster.spec.backupProfiles[index].snapshot.storage.s3

父項

表 8.13 InnoDBCluster.spec.backupProfiles[index].snapshot.storage.s3 的 Spec 表格

名稱 類型 描述 必要
bucketName 字串

儲存 Dump 的 S3 儲存桶名稱

config 字串

具有 S3 設定和認證的 Secret 名稱

endpoint 字串

覆寫端點 URL

prefix 字串

儲存 Dump 檔案的儲存桶路徑

profile 字串

設定檔正在設定檔中使用的設定檔

  • 預設:


InnoDBCluster.spec.backupSchedules[index]

父項

表 8.14 InnoDBCluster.spec.backupSchedules[index] 的 Spec 表格

名稱 類型 描述 必要
name 字串

備份排程的名稱

schedule 字串

作業的排程,語法為 cron 表達式

backupProfile 物件

如果未指定 backupProfileName,則為 backupProfile 規格

backupProfileName 字串

要使用的 backupProfile 名稱

deleteBackupData 布林值

如果刪除作業建立的 MySQLBackup 物件,是否要刪除備份資料

  • 預設:false

enabled 布林值

是否啟用排程

  • 預設:true

timeZone 字串

備份排程的時區,例如:'America/New_York' -- Kubernetes 的 MySQL Operator 8.3.0-2.1.2 中新增的功能。


InnoDBCluster.spec.backupSchedules[index].backupProfile

父項

描述:如果未指定 backupProfileName,則為 backupProfile 規格

表 8.15 InnoDBCluster.spec.backupSchedules[index].backupProfile 的 Spec 表格

名稱 類型 描述 必要
dumpInstance 物件
podAnnotations 物件
podLabels 物件

InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance

父項

表 8.16 InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance 的 Spec 表格

名稱 類型 描述 必要
dumpOptions 物件

直接傳遞至 MySQL Shell 的 DumpInstance() 的鍵值組字典

storage 物件

InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage

父項

表 8.17 InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage 的 Spec 表格

名稱 類型 描述 必要
azure 物件
ociObjectStorage 物件
persistentVolumeClaim 物件

要使用的 PVC 規格。在執行備份的 Pod 中「按原樣」使用。

s3 物件

InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage.azure

父項

表 8.18 InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage.azure 的 Spec 表格

名稱 類型 描述 必要
config 字串

具有 Azure BLOB 儲存體設定和認證的 Secret 名稱

containerName 字串

儲存 Dump 的 Azure BLOB 儲存體容器名稱

prefix 字串

容器中儲存 Dump 檔案的路徑


InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage.ociObjectStorage

父項

表 8.19 InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage.ociObjectStorage 的 Spec 表格

名稱 類型 描述 必要
bucketName 字串

儲存備份的 OCI 儲存桶名稱

credentials 字串

具有存取儲存桶資料的 Secret 名稱

prefix 字串

儲存備份的儲存桶路徑


InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage.s3

父項

表 8.20 InnoDBCluster.spec.backupSchedules[index].backupProfile.dumpInstance.storage.s3 的 Spec 表格

名稱 類型 描述 必要
bucketName 字串

儲存 Dump 的 S3 儲存桶名稱

config 字串

具有 S3 設定和認證的 Secret 名稱

endpoint 字串

覆寫端點 URL

prefix 字串

儲存 Dump 檔案的儲存桶路徑

profile 字串

設定檔正在設定檔中使用的設定檔

  • 預設:


InnoDBCluster.spec.imagePullSecrets[index]

父項

表 8.21 InnoDBCluster.spec.imagePullSecrets[index] 的規格表

名稱 類型 描述 必要
name 字串

InnoDBCluster.spec.initDB

父項

表 8.22 InnoDBCluster.spec.initDB 的規格表

名稱 類型 描述 必要
clone 物件
dump 物件

InnoDBCluster.spec.initDB.clone

父項

表 8.23 InnoDBCluster.spec.initDB.clone 的規格表

名稱 類型 描述 必要
donorUrl 字串

要從中複製的叢集 URL

secretKeyRef 物件
rootUser 字串

用於複製的使用者名稱

  • 預設值:root


InnoDBCluster.spec.initDB.clone.secretKeyRef

父項

表 8.24 InnoDBCluster.spec.initDB.clone.secretKeyRef 的規格表

名稱 類型 描述 必要
name 字串

具有金鑰 'rootPassword' 的 Secret 名稱,用於儲存 rootUser 中指定使用者的密碼


InnoDBCluster.spec.initDB.dump

父項

表 8.25 InnoDBCluster.spec.initDB.dump 的規格表

名稱 類型 描述 必要
storage 物件
name 字串

Dump 的名稱。運算子不會使用,但為叢集管理員提供描述性提示

options 物件

直接傳遞到 MySQL Shell 的 loadDump() 的鍵值對字典

path 字串

PVC 中 dump 的路徑。在指定 persistentVolumeClaim 時使用。若為 ociObjectStorage、S3 或 azure 則省略。


InnoDBCluster.spec.initDB.dump.storage

父項

表 8.26 InnoDBCluster.spec.initDB.dump.storage 的規格表

名稱 類型 描述 必要
azure 物件
ociObjectStorage 物件
persistentVolumeClaim 物件

要使用的 PVC 規格。在複製 Pod 中「按原樣」使用。

s3 物件

InnoDBCluster.spec.initDB.dump.storage.azure

父項

表 8.27 InnoDBCluster.spec.initDB.dump.storage.azure 的規格表

名稱 類型 描述 必要
config 字串

具有 Azure BLOB 儲存體設定和認證的 Secret 名稱

containerName 字串

儲存 Dump 的 Azure BLOB 儲存體容器名稱

prefix 字串

容器中儲存 Dump 檔案的路徑


InnoDBCluster.spec.initDB.dump.storage.ociObjectStorage

父項

表 8.28 InnoDBCluster.spec.initDB.dump.storage.ociObjectStorage 的規格表

名稱 類型 描述 必要
bucketName 字串

儲存 dump 的 OCI 儲存桶名稱

credentials 字串

具有存取儲存桶資料的 Secret 名稱

prefix 字串

儲存 Dump 檔案的儲存桶路徑


InnoDBCluster.spec.initDB.dump.storage.s3

父項

表 8.29 InnoDBCluster.spec.initDB.dump.storage.s3 的規格表

名稱 類型 描述 必要
bucketName 字串

儲存 Dump 的 S3 儲存桶名稱

config 字串

具有 S3 設定和認證的 Secret 名稱

prefix 字串

儲存 Dump 檔案的儲存桶路徑

endpoint 字串

覆寫端點 URL

profile 字串

設定檔正在設定檔中使用的設定檔

  • 預設:


InnoDBCluster.spec.keyring

父項

描述:金鑰環規格

表 8.30 InnoDBCluster.spec.keyring 的規格表

名稱 類型 描述 必要
encryptedFile 物件

金鑰環「加密檔案」規格

file 物件

金鑰環「檔案」規格

oci 物件

金鑰環「OCI」規格


InnoDBCluster.spec.keyring.encryptedFile

父項

描述:金鑰環「加密檔案」規格

表 8.31 InnoDBCluster.spec.keyring.encryptedFile 的規格表

名稱 類型 描述 必要
password 字串

具有金鑰環密碼的金鑰 'keyring_password' 的 Secret 名稱

storage 物件

要掛載金鑰環檔案所在位置的磁碟區規格

fileName 字串

儲存磁碟區內金鑰環檔案名稱的路徑(會加上掛載路徑前綴)

  • 預設值:mysql_keyring

readOnly 布林值

是否以唯讀模式開啟金鑰環檔案

  • 預設:false


InnoDBCluster.spec.keyring.file

父項

描述:金鑰環「檔案」規格

表 8.32 InnoDBCluster.spec.keyring.file 的規格表

名稱 類型 描述 必要
storage 物件

要掛載金鑰環檔案所在位置的磁碟區規格

fileName 字串

儲存磁碟區內金鑰環檔案名稱的路徑(會加上掛載路徑前綴)

  • 預設值:mysql_keyring

readOnly 布林值

是否以唯讀模式開啟金鑰環檔案

  • 預設:false


InnoDBCluster.spec.keyring.oci

父項

描述:金鑰環「OCI」規格

表 8.33 InnoDBCluster.spec.keyring.oci 的規格表

名稱 類型 描述 必要
keyFingerprint 字串

私密金鑰指紋

keySecret 字串

在欄位 'privatekey' 下包含私密金鑰的 Secret

tenancy 字串

租用戶識別碼,格式為 ocid1.tenancy.oc1...

user 字串

使用者識別碼,格式為 ocid1.user.oc1...

caCertificate 字串

包含 ca.crt 欄位的 Secret,其中包含 keyring_oci 外掛程式用於 Oracle Cloud Infrastructure 憑證驗證的 CA 憑證套件檔案

compartment 字串

區間識別碼,格式為 ocid1.compartment.oc1...

endpoints 物件
masterKey 字串

格式為 ocid1.key.oc1... 的主金鑰識別碼

virtualVault 字串

格式為 ocid1.vault.oc1... 的 Vault 識別碼


InnoDBCluster.spec.keyring.oci.endpoints

父項

表 8.34 InnoDBCluster.spec.keyring.oci.endpoints 的規格表

名稱 類型 描述 必要
encryption 字串

加密端點 URI,如 {identifier}-crypto.kms.{region}.oraclecloud.com

management 字串

管理端點 URI,如 {identifier}-management.kms.{region}.oraclecloud.com

secrets 字串

秘密端點 URI,如 secrets.vaults.{region}.oci.oraclecloud.com

vaults 字串

Vault 端點 URI,如 vaults.{region}.oci.oraclecloud.com


InnoDBCluster.spec.logs

MySQL Operator for Kubernetes 8.2.0-2.1.1 中新增的功能。

父項

表 8.35 InnoDBCluster.spec.logs 的規格表

名稱 類型 描述 必要
collector 物件
error 物件
general 物件
slowQuery 物件

InnoDBCluster.spec.logs.collector

父項

表 8.36 InnoDBCluster.spec.logs.collector 的規格表

名稱 類型 描述 必要
containerName 字串

收集器容器 Sidecar 的名稱

  • 預設值:logcollector

env []物件
fluentd 物件

fluentd 日誌收集器的屬性

image 字串

用於日誌收集器 Sidecar 的映像檔名稱,包括登錄檔和儲存庫。如果提供,它需要是設定收集器類型的映像檔。


InnoDBCluster.spec.logs.collector.fluentd

父項

描述:fluentd 日誌收集器的屬性

表 8.37 InnoDBCluster.spec.logs.collector.fluentd 的規格表

名稱 類型 描述 必要
additionalFilterConfiguration 字串

要新增到組態檔案的額外 Fluentd 篩選器的原始組態

errorLog 物件
generalLog 物件
recordAugmentation 物件
sinks []物件
slowQueryLog 物件

InnoDBCluster.spec.logs.collector.fluentd.errorLog

父項

表 8.38 InnoDBCluster.spec.logs.collector.fluentd.errorLog 的規格表

名稱 類型 描述 必要
options 物件

錯誤日誌的 fluentd 特定選項

tag 字串

錯誤日誌記錄的標籤

  • 預設:


InnoDBCluster.spec.logs.collector.fluentd.generalLog

父項

表 8.39 InnoDBCluster.spec.logs.collector.fluentd.generalLog 的規格表

名稱 類型 描述 必要
options 物件

一般日誌的 fluentd 特定選項

tag 字串

一般日誌記錄的標籤

  • 預設:


InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation

父項

表 8.40 InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation 的規格表

名稱 類型 描述 必要
annotations []物件
enabled 布林值

是否啟用額外資料的記錄增強

  • 預設:false

labels []物件
podFields []物件
resourceFields []物件
staticFields []物件

InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.annotations[index]

父項

表 8.41 InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.annotations[index] 的規格表

名稱 類型 描述 必要
annotationName 字串

保留要儲存在日誌記錄中 fieldName 下的值的 Pod 標籤名稱

fieldName 字串

新增到日誌記錄的欄位名稱,其值來自 annotationName


InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.labels[index]

父項

表 8.42 InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.labels[index] 的規格表

名稱 類型 描述 必要
fieldName 字串

新增到日誌記錄的欄位名稱,其值來自 labelName

labelName 字串

保留要儲存在日誌記錄中 fieldName 下的值的 Pod 標籤名稱


InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.podFields[index]

父項

表 8.43 InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.podFields[index] 的規格表

名稱 類型 描述 必要
fieldName 字串

新增到日誌記錄的欄位名稱,其值取自儲存在 fieldPath 中路徑的欄位

fieldPath 字串

欄位 fieldName 的值。路徑應與從欄位參考掛載環境變數所使用的語法相同 - valueFrom.fieldRef.fieldPath。欄位將掛載到 Pod 作為環境變數,加上前綴,然後新增到日誌記錄。欄位參考的範例為:spec.nodeName、metadata.namespace、status.podIP 等。


InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.resourceFields[index]

父項

表 8.44 InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.resourceFields[index] 的規格表

名稱 類型 描述 必要
containerName 字串
fieldName 字串

新增到日誌記錄的欄位名稱,其值取自儲存在 fieldPath 中路徑的欄位

resource 字串

請參閱 https://kubernetes.dev.org.tw/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-container-fields-as-values-for-environment-variables


InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.staticFields[index]

父項

表 8.45 InnoDBCluster.spec.logs.collector.fluentd.recordAugmentation.staticFields[index] 的規格表

名稱 類型 描述 必要
fieldName 字串

新增到日誌記錄的欄位名稱,其值來自 fieldValue

fieldValue 字串

靜態欄位的值,其名稱取自 fieldName


InnoDBCluster.spec.logs.collector.fluentd.sinks[index]

父項

表 8.46 InnoDBCluster.spec.logs.collector.fluentd.sinks[index] 的規格表

名稱 類型 描述 必要
name 字串

Sink 的名稱。僅用於文件用途

rawConfig 字串

Sink 的原始組態


InnoDBCluster.spec.logs.collector.fluentd.slowQueryLog

父項

表 8.47 InnoDBCluster.spec.logs.collector.fluentd.slowQueryLog 的規格表

名稱 類型 描述 必要
options 物件

慢速日誌的 fluentd 特定選項

tag 字串

慢速日誌記錄的標籤

  • 預設:


InnoDBCluster.spec.logs.error

父項

表 8.48 InnoDBCluster.spec.logs.error 的規格表

名稱 類型 描述 必要
collect 布林值

是否應收集錯誤記錄資料。表示應啟用記錄。如果啟用,錯誤日誌將切換為 JSON 格式輸出

  • 預設:false

verbosity 整數

記錄錯誤詳細程度。如需詳細資訊,請參閱 MySQL Server --log-error-verbosity 文件。

  • 預設: 3

  • 最小值: 1

  • 最大值: 3


InnoDBCluster.spec.logs.general

父項

表 8.49 InnoDBCluster.spec.logs.general 的規格表

名稱 類型 描述 必要
collect 布林值

是否應收集一般記錄資料。表示應啟用記錄。

  • 預設:false

enabled 布林值

是否應啟用一般記錄

  • 預設:false


InnoDBCluster.spec.logs.slowQuery

父項

表 8.50 InnoDBCluster.spec.logs.slowQuery 的規格表

名稱 類型 描述 必要
collect 布林值

是否應收集慢速查詢記錄資料。表示應啟用記錄。

  • 預設:false

enabled 布林值

是否應啟用慢速查詢記錄

  • 預設:false

longQueryTime number

慢速查詢時間閾值

  • 預設: 10

  • 最小值: 0


InnoDBCluster.spec.metrics

父項

描述:Prometheus 風格度量提供者的組態;在 Kubernetes 8.1.0-2.1.0 的 MySQL Operator 中新增的功能。

表 8.51 InnoDBCluster.spec.metrics 的規格表

名稱 類型 描述 必要
enable 布林值

切換以啟用或停用度量 Sidecar

  • 預設:false

image 字串

用於度量 Sidecar 的映像檔名稱,如果提供,則將啟用度量

monitor 布林值

為 Prometheus Operator 建立 ServiceMonitor

  • 預設:false

monitorSpec 物件

ServiceMonitor 物件的自訂組態

  • 預設值:map[]

options []string

作為命令列引數傳遞給度量提供者的選項

tlsSecret 字串

具有 TLS 憑證、金鑰和 CA 的 Secret 名稱,將掛載在容器的 /tls 中,並且可以從 webConfig 使用

webConfig 字串

具有 web.config 檔案的 ConfigMap 名稱,如果提供此選項,則會新增命令列選項 --web.config.file


InnoDBCluster.spec.readReplicas[index]

MySQL Operator for Kubernetes 8.2.0-2.1.1 中新增的功能。

父項

表 8.52 InnoDBCluster.spec.readReplicas[index] 的規格表

名稱 類型 描述 必要
baseServerId 整數

讀取複本執行個體的 MySQL server_id 的基本值,如果為 0,則會自動指派

  • 預設: 0

  • 最小值: 0

  • 最大值: 4294967195

name 字串
datadirVolumeClaimTemplate 物件

PersistentVolumeClaim 的範本,用作 datadir

instances 整數

讀取複本集合的 MySQL 執行個體數

  • 預設: 1

  • 最小值: 1

  • 最大值: 999

mycnf 字串

my.cnf 的自訂設定新增項目

podAnnotations 物件
podLabels 物件
podSpec 物件
version 字串

MySQL 伺服器版本


InnoDBCluster.spec.router

父項

描述:MySQL Router 規格

表 8.53 InnoDBCluster.spec.router 的規格表

名稱 類型 描述 必要
bootstrapOptions []string

在引導時傳遞到 MySQL Router 的命令列選項;在 Kubernetes 8.2.0-2.1.1 的 MySQL Operator 中新增的功能。

instances 整數

要部署的 MySQL Router 執行個體數

  • 預設: 1

  • 最小值: 0

options []string

在執行時傳遞到 MySQL Router 的命令列選項;在 Kubernetes 8.2.0-2.1.1 的 MySQL Operator 中新增的功能。

podAnnotations 物件
podLabels 物件
podSpec 物件
routingOptions 物件

設定叢集的路由選項

tlsSecretName 字串

包含用於 SSL 的 MySQL Router 憑證和私密金鑰的 TLS 類型 Secret 名稱

version 字串

覆寫 MySQL Router 版本


InnoDBCluster.spec.router.routingOptions

父項

描述:設定叢集的路由選項

表 8.54 InnoDBCluster.spec.router.routingOptions 的規格表

名稱 類型 描述 必要
invalidated_cluster_policy enum
  • 列舉:drop_all、accept_ro

read_only_targets enum
  • 列舉:all、read_replicas、secondaries

stats_updates_frequency 整數
  • 預設: 0

  • 最小值: 0


InnoDBCluster.spec.service

父項

描述:應用程式連線到 InnoDB Cluster 時所使用的服務設定

表 8.55 InnoDBCluster.spec.service 的規格表

名稱 類型 描述 必要
annotations 物件

服務的自訂註解

defaultPort enum

服務預設 (3306) 連接埠的目標。如果 mysql-rw 流量將導向主節點並允許讀取和寫入操作,mysql-ro 流量將導向複本節點並僅允許讀取操作,而 mysql-rw-split 則會將路由器的讀寫分割作為目標

  • 枚舉:mysql-rw、mysql-ro、mysql-rw-split

  • 預設值:mysql-rw

labels 物件

服務的自訂標籤

type enum
  • 枚舉:ClusterIP、NodePort、LoadBalancer

  • 預設值:ClusterIP


MySQLBackup

表 8.56 MySQLBackup 的規格表

名稱 類型 描述 必要
apiVersion 字串 mysql.oracle.com/v2
kind 字串 MySQLBackup
metadata 物件 請參閱 Kubernetes API 文件
spec 物件
status 物件

MySQLBackup.spec

父項

表 8.57 MySQLBackup.spec 的規格表

名稱 類型 描述 必要
clusterName 字串
addTimestampToBackupDirectory 布林值
  • 預設:true

backupProfile 物件

如果未指定 backupProfileName,則為 backupProfile 規格

backupProfileName 字串
deleteBackupData 布林值
  • 預設:false


MySQLBackup.spec.backupProfile

父項

描述:如果未指定 backupProfileName,則為 backupProfile 規格

表 8.58 MySQLBackup.spec.backupProfile 的規格表

名稱 類型 描述 必要
dumpInstance 物件
podAnnotations 物件
podLabels 物件

MySQLBackup.spec.backupProfile.dumpInstance

父項

表 8.59 MySQLBackup.spec.backupProfile.dumpInstance 的規格表

名稱 類型 描述 必要
dumpOptions 物件

直接傳遞至 MySQL Shell 的 DumpInstance() 的鍵值組字典

storage 物件

MySQLBackup.spec.backupProfile.dumpInstance.storage

父項

表 8.60 MySQLBackup.spec.backupProfile.dumpInstance.storage 的規格表

名稱 類型 描述 必要
azure 物件
ociObjectStorage 物件
persistentVolumeClaim 物件

要使用的 PVC 規格。在執行備份的 Pod 中「按原樣」使用。

s3 物件

MySQLBackup.spec.backupProfile.dumpInstance.storage.azure

父項

表 8.61 MySQLBackup.spec.backupProfile.dumpInstance.storage.azure 的規格表

名稱 類型 描述 必要
config 字串

具有 Azure BLOB 儲存體設定和認證的 Secret 名稱

containerName 字串

儲存 Dump 的 Azure BLOB 儲存體容器名稱

prefix 字串

容器中儲存 Dump 檔案的路徑


MySQLBackup.spec.backupProfile.dumpInstance.storage.ociObjectStorage

父項

表 8.62 MySQLBackup.spec.backupProfile.dumpInstance.storage.ociObjectStorage 的規格表

名稱 類型 描述 必要
bucketName 字串

儲存備份的 OCI 儲存桶名稱

credentials 字串

具有存取儲存桶資料的 Secret 名稱

prefix 字串

儲存備份的儲存桶路徑


MySQLBackup.spec.backupProfile.dumpInstance.storage.s3

父項

表 8.63 MySQLBackup.spec.backupProfile.dumpInstance.storage.s3 的規格表

名稱 類型 描述 必要
bucketName 字串

儲存 Dump 的 S3 儲存桶名稱

config 字串

具有 S3 設定和認證的 Secret 名稱

endpoint 字串

覆寫端點 URL

prefix 字串

儲存 Dump 檔案的儲存桶路徑

profile 字串

設定檔正在設定檔中使用的設定檔

  • 預設:


MySQLBackup.status

父項

表 8.64 MySQLBackup.status 的規格表

名稱 類型 描述 必要
bucket 字串
completionTime 字串
container 字串
elapsedTime 字串
message 字串
method 字串
ociTenancy 字串
output 字串
size 字串
source 字串
spaceAvailable 字串
startTime 字串
status 字串

資源類型

ClusterKopfPeering

表 8.65 ClusterKopfPeering 的規格表

名稱 類型 描述 必要
apiVersion 字串 zalando.org/v1
kind 字串 ClusterKopfPeering
metadata 物件 請參閱 Kubernetes API 文件
status 物件

KopfPeering

表 8.66 KopfPeering 的規格表

名稱 類型 描述 必要
apiVersion 字串 zalando.org/v1
kind 字串 KopfPeering
metadata 物件 請參閱 Kubernetes API 文件
status 物件