自动化部署 tendis集群和redis集群初始化集群步骤一样,创建出3主3从的节点后,再创建一个初始化的job,对集群进行初始化配置。(redis集群创建修改镜像即可)
创建svc
以下是svc的yaml
kind: Service apiVersion: v1 metadata: name: tendis-cluster-auto-9n44 namespace: tendis labels: app: tendis-cluster-auto annotations: kubesphere.io/alias-name: tendis-cluster-auto kubesphere.io/serviceType: statefulservice spec: ports: - name: http-0 protocol: TCP port: 30032 targetPort: 51002 selector: app: tendis-cluster-auto clusterIP: None clusterIPs: - None type: ClusterIP sessionAffinity: None ipFamilies: - IPv4 ipFamilyPolicy: SingleStack internalTrafficPolicy: Cluster |
创建6副本的statefulset
通过pvc模板自动创建对应的pvc挂载,可自行修改
kind: StatefulSet apiVersion: apps/v1 metadata: name: tendis-cluster-auto namespace: tendis labels: app: tendis-cluster-auto spec: replicas: 6 selector: matchLabels: app: tendis-cluster-auto template: metadata: creationTimestamp: null labels: app: tendis-cluster-auto |