如何在Istio注入的命名空间内创建MySQL集群?

时间:2019-11-26 06:49:10

标签: mysql kubernetes istio

我目前正在尝试使用Oracle MySQL Operator在1.13.10 K8中创建2个节点的MySQL集群。它在标准名称空间中正常工作。但是,一旦在Istio 1.4注入的命名空间中创建了它,负责设置复制的MySQL代理就会返回以下错误:

  

错误引导群集:无法创建新群集:SystemError:RuntimeError:Dba.create_cluster:错误:启动群集时出错:localAddress选项的端口“ 33061”已在使用中。指定要与localAddress选项一起使用的可用端口,或指定可用端口“ 33061”。

到目前为止,我还没有找到任何支持。

如何配置Istio以使代理能够管理复制?

在我的Yaml清单下面:

apiVersion: v1
kind: Namespace
metadata:
  name: test
  labels:
    istio-injection: enabled
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: mysql-agent
  namespace: test
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: mysql-agent
  namespace: test
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: mysql-agent
subjects:
- kind: ServiceAccount
  name: mysql-agent
  namespace: test
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-test-mysql-data0
  labels:
    namespace: test
    type: data
    app: mysql
spec:
  storageClassName: hostpath
  persistentVolumeReclaimPolicy: Retain 
  accessModes:
    - ReadWriteMany
  capacity:
    storage: 2Gi
  hostPath:
    path: /data/test/mysql/data0
    type: DirectoryOrCreate
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-test-mysql-data1
  labels:
    namespace: test
    type: data
    app: mysql
spec:
  storageClassName: hostpath
  persistentVolumeReclaimPolicy: Retain 
  accessModes:
    - ReadWriteMany
  capacity:
    storage: 2Gi
  hostPath:
    path: /share/test/mysql/data1
    type: DirectoryOrCreate
---
apiVersion: v1
kind: Secret
metadata:
  name: mysql-root-user-secret
  namespace: test
stringData:
    password: password
---
apiVersion: mysql.oracle.com/v1alpha1
kind: Cluster
metadata:
  name: mysql
  namespace: test
  labels:
    app: mysql
    namespace: test
spec:
  multiMaster: true
  members: 2
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        - labelSelector:
            matchExpressions:
              - key: "v1alpha1.mysql.oracle.com/cluster"
                operator: In
                values:
                - mysql
          topologyKey: "kubernetes.io/hostname"
  rootPasswordSecret:
    name: mysql-root-user-secret
  volumeClaimTemplate:
    metadata:
      name: data
    spec:
      storageClassName: hostpath
      accessModes:
        - ReadWriteMany
      resources:
        requests:
          storage: 2Gi
      selector:
        matchLabels:
          namespace: test
          type: data
          app: mysql

0 个答案:

没有答案