Tutorial

Alibaba Cloud NAS Configuration

Please follow the steps to configure Alibaba Cloud NAS:

Create ServiceAccount

  1. Visit Kubernetes UI. The address is http://IP:31234, replace IP by the actual IP of Kubernetes master node.
  2. Selects Kube-system in the Namaspace, and click on CREATE on the right corner of the page.

    enterkubernetes

  3. Create YAML file(You an create from text input, or create from file). The content of YAML file is in below:

    apiVersion: v1
    kind: ServiceAccount
    metadata:
     labels:
       type: storage-class
       kind: imanager-base
     name: nas-client-controller
    ---
    kind: ClusterRoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
     labels:
       type: storage-class
       kind: imanager-base
      name: run-nfs-client-provisioner
    subjects:
     - kind: ServiceAccount
       name: nas-client-controller
       namespace: kube-system
    roleRef:
     kind: ClusterRole
     name: nfs-client-provisioner-runner
     apiGroup: rbac.authorization.k8s.io
  4. Click on UPLOAD.

Install Nas Controller

  1. Repeat the steps 1-2 of Create ServiceAccount.
  2. Create YAML file. The content of YAML file is in below:

    kind: Deployment
    apiVersion: extensions/v1beta1
    metadata:
     name: alicloud-nas-controller
     namespace: kube-system
    spec:
     strategy:
       type: Recreate
     template:
       metadata:
         labels:
           app: alicloud-nas-controller
       spec:
         tolerations:
         - operator: Exists
         affinity:
           nodeAffinity:
             preferredDuringSchedulingIgnoredDuringExecution:
             - weight: 1
                preference:
                 matchExpressions:
                 - key: node-role.kubernetes.io/master
                   operator: Exists
         priorityClassName: system-node-critical
         serviceAccount: nas-client-controller
         hostNetwork: true
         containers:
           - name: nfs-provisioner
             image: registry.cn-hangzhou.aliyuncs.com/acs/alicloud-nas-controller:v1.14.3.8-58bf821-aliyun
             env:
             - name: PROVISIONER_NAME
               value: alicloud/nas
             securityContext:
               privileged: true
             volumeMounts:
             - mountPath: /var/log
               name: log
         volumes:
         - hostPath:
             path: /var/log
           name: log
  3. Click on UPLOAD.

Create StorageClass

GIS application and database need different StorageClass when binding a same NAS. If you change both GIS application and database to NAS storage, you need to create two StorageClass.

Create Database StorageClass

  1. Repeat the steps 1-2 of Create ServiceAccount.
  2. Create YAML file. The content of YAML file is in below:

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
     labels:
       kind: imanager-base
     name: alicloud-nas-database
    mountOptions:
    - nolock,tcp,noresvport
    - vers=3
    parameters:
     server: "23a9649583-iaq37.cn-shenzhen.nas.aliyuncs.com:/nasroot1/"
     driver: flexvolume
    provisioner: alicloud/nas
    reclaimPolicy: Delete
  3. Click on UPLOAD.

Create GIS Application StorageClass

  1. Repeat the steps 1-2 of Create ServiceAccount.
  2. Create YAML file. The content of YAML file is in below:

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
     labels:
       kind: imanager-base
     name: alicloud-nas-gisappset
    mountOptions:
    - nolock,tcp,noresvport
    - vers=3
    parameters:
     server: "23a9649583-iaq37.cn-shenzhen.nas.aliyuncs.com:/nasroot1/"
     driver: flexvolume
    provisioner: alicloud/nas
    reclaimPolicy: Delete
  3. Click on UPLOAD.

Configure StorageClass.conf File

  1. Open the storageClass.conf file in the iManager installation directory(supermap-imanager-for-kubernetes), and execute:

    vi storageClass.conf
  2. Adds StorageClass name to the related parameter, as the screenshot below:

    addstorageclasstoconf

  3. Save and exit.
  4. Start up iManager:

    ./startup.sh