跳至正文

基于kubernetes 的oracle mysql-operator 安装

说明:本文档只是安装mysql-operator,不涉及实际的innodb cluster安装

1.配置helm仓库,注意支持的APP VERSION

helm repo add mysql-operator https://mysql.github.io/mysql-operator/

helm  search repo mysql-operator
NAME                                CHART VERSION   APP VERSION DESCRIPTION                                       
mysql-operator/mysql-operator       2.2.8           9.7.0-2.2.8 MySQL Operator Helm Chart for deploying MySQL I...
mysql-operator/mysql-innodbcluster  2.2.8           9.7.0       MySQL InnoDB Cluster Helm Chart for deploying M...

helm repo update

2.安装,注意需要指定k8sClusterDomain: cluster.local 否则日志会报如下错误:

[2026-07-02 08:07:56,077] root                 [WARNING ] Failed to detect cluster domain. Reason: [Errno -2] Name or service not known
[2026-07-02 08:07:58,077] root                 [ERROR   ] Failed to automatically identify the cluster domain. If this
        persists try setting MYSQL_OPERATOR_K8S_CLUSTER_DOMAIN via environment.
#cat mysql-operator-values.yaml | grep -v "#" | grep -v "^$"
image:
  registry: container-registry.oracle.com
  repository: mysql
  name: community-operator
  pullPolicy: IfNotPresent
  tag: ""
  pullSecrets:
    enabled: false
    secretName:
envs:
    imagesPullPolicy: IfNotPresent
    imagesDefaultRegistry:
    imagesDefaultRepository:
    k8sClusterDomain: cluster.local
replicas: 1
disableLookups: false
debugger:
  enabled: false
  bindip: 0.0.0.0
  bindport: 9009

helm upgrade --install my-mysql-operator mysql-operator/mysql-operator   --namespace mysql-operator   --version 2.2.8   --reset-then-reuse-values   --create-namespace   -f mysql-operator-values.yaml

3.其他:显示innodbcluster参考配置信息

 helm show values mysql-operator/mysql-innodbcluster

参考:https://dev.mysql.com/doc/mysql-operator/en/mysql-operator-installation.html

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

error: Content is protected !!