云原生 | k8s集群部署nacos2.2.1 版本

1.环境配置:1.21.1容器集群,NFS存储环境

# 各个主从节点新建/nfs/data目录
mkdir -p /nfs/data/mysql
chmod 777 /nfs/data/mysql

2.创建mysql-nfs.yaml文件

vim mysql-nfs.yaml

修改nfs存储路径

apiVersion: v1
kind: Namespace
metadata:
  labels:
  name: nacos
---
apiVersion: v1
kind: ReplicationController
metadata:
  namespace: nacos
  name: mysql
  labels:
    name: mysql
spec:
  replicas: 1
  selector:
    name: mysql
  template:
    metadata:
      labels:
        name: mysql
    spec:
      containers:
      - name: mysql
        image: nacos/nacos-mysql:5.7
        ports:
        - containerPort: 3306
        volumeMounts:
        - name: mysql-data
          mountPath: /var/lib/mysql
        env:
        - name: MYSQL_

你可能感兴趣的:(中间件,kubernetes,云原生)