当前位置:网站首页>Deploy metersphere

Deploy metersphere

2022-07-23 10:49:00 Zhangzhexi

kubernetes Deployment in China

Helm Charts Mode deployment MeterSphere

Helm Charts Online deployment

bash
kubectl create ns ms
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add metersphere https://metersphere.github.io/helm-chart/
 from  chart  Update locally available in the warehouse chart Information about 
helm repo update  
helm install metersphere metersphere/metersphere -n ms

Helm Charts Offline deployment

1. Import mirror
download MeterSphere The latest version of the offline installation package and extract , Put the installation package image The image in the directory tar Packages uploaded to kubernetes Or manually load To kubernetes On each host node .
MeterSphere Offline installation package download link : https://community.fit2cloud.com/#/products/metersphere/downloads
2. Download offline Chart package

helm-chart  Installation package download link : https://github.com/metersphere/helm-chart/releases
 Such as :https://github.com/metersphere/helm-chart/releases/download/metersphere-1.1.0/metersphere-1.1.0.tgz

3. install

helm install metersphere metersphere-1.0.10.tgz -n ms

Helm Charts Online upgrade

helm repo update  #  from  chart  Update locally available in the warehouse chart Information about 
helm upgrade  metersphere metersphere/metersphere -n ms

After the official documents are installed and deployed , No deployment pv, Lead to pvc Unable to bind to pv, So we need to deploy it separately pv, But it's bound pvc It's quite a lot , So my deployment is storageclass, You can have one pv One pv Deploy .
Deploy storageclass
1. Deploy nfs
install nfs service :yum -y install nfs-utils ( Each node in the cluster should also be installed, otherwise it is not supported )
start-up nfs And set it to start automatically :systemctl start nfs && systemctl enable nfs
Create a shared mount directory : mkdir -pv /data/metersphere
edit /etc/exports file

/data/metersphere  *(rw,fsid=0,sync,no_root_squash)

2. download storageclass Needed Yaml file

for file in class.yaml deployment.yaml rbac.yaml test-claim.yaml ; do wget https://raw.githubusercontent.com/kubernetes-incubator/external-storage/master/nfs-client/deploy/$file ; done

3. Modify the resource list
#vim deployment.yaml

#vim deployment.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: nfs-client-provisioner
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: nfs-client-provisioner
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: nfs-client-provisioner
    spec:
      serviceAccountName: nfs-client-provisioner
      containers:
        - name: nfs-client-provisioner
          image: quay.io/external_storage/nfs-client-provisioner:v2.0.0  ## The default is latest edition 
          volumeMounts:
            - name: nfs-client-root
              mountPath: /persistentvolumes
          env:
            - name: PROVISIONER_NAME
              value: fuseim.pri/ifs  ## The supplier name here must be the same as class.yaml Medium provisioner The names are the same , Otherwise, the deployment will not succeed 
            - name: NFS_SERVER
              value: k8s-nfs      ## Write here NFS Server's IP Address or host name that can be resolved 
            - name: NFS_PATH
              value: /data/volumes/v1   ## Write here NFS Shared mount directory in the server ( emphasize : The path here must be the last folder in the directory , Otherwise, the deployed application will not have permission to create a directory, resulting in Pending)
      volumes:
        - name: nfs-client-root

          nfs:
            server: k8s-nfs                ##NFS Server's IP Or resolvable hostname 
            path: /data/volumes/v1  ##NFS Shared mount directory in the server ( emphasize : The path here must be the last folder in the directory , Otherwise, the deployed application will not have permission to create a directory, resulting in Pending)

4. Deploy

kubectl apply -f .

5. View service
Check out this NFS The plug-in pod Whether the deployment is successful
 Insert picture description here

6. see storageclass

 Insert picture description here

原网站

版权声明
本文为[Zhangzhexi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/07/202207230452299477.html