Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to upgrade to QingCloud CSI v1.1.0 #110

Open
wnxn opened this issue Aug 31, 2019 · 4 comments
Open

How to upgrade to QingCloud CSI v1.1.0 #110

wnxn opened this issue Aug 31, 2019 · 4 comments
Labels
kind/documentation Categorizes issue or PR as related to documentation.
Milestone

Comments

@wnxn
Copy link
Contributor

wnxn commented Aug 31, 2019

What would you like to be added:

Why is this needed:

@wnxn wnxn added the kind/documentation Categorizes issue or PR as related to documentation. label Aug 31, 2019
@wnxn wnxn added this to the v1.1.0 milestone Aug 31, 2019
@wnxn
Copy link
Contributor Author

wnxn commented Oct 9, 2019

qingcloud csi v0.2.x

storage class

# kubectl get sc csi-qingcloud -oyaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{"storageclass.beta.kubernetes.io/is-default-class":"true","storageclass.kubesphere.io/supported_access_modes":"[\"ReadWriteOnce\"]"},"name":"csi-qingcloud"},"parameters":{"fsType":"ext4","maxSize":"1000","minSize":"10","stepSize":"10","type":"3"},"provisioner":"csi-qingcloud","reclaimPolicy":"Delete"}
    storageclass.beta.kubernetes.io/is-default-class: "true"
    storageclass.kubesphere.io/supported_access_modes: '["ReadWriteOnce"]'
  creationTimestamp: "2019-08-11T09:40:49Z"
  name: csi-qingcloud
  resourceVersion: "9281018"
  selfLink: /apis/storage.k8s.io/v1/storageclasses/csi-qingcloud
  uid: 19ef5a5a-bc1c-11e9-a675-525499c9b2bb
parameters:
  fsType: ext4
  maxSize: "1000"
  minSize: "10"
  stepSize: "10"
  type: "3"
provisioner: csi-qingcloud
reclaimPolicy: Delete
volumeBindingMode: Immediate

PVC

# kubectl get pvc mysql-pv-claim -oyaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"3c0879d1-bc1c-11e9-85b5-ca295d26a072","leaseDurationSeconds":15,"acquireTime":"2019-09-27T08:45:53Z","renewTime":"2019-09-27T08:46:05Z","leaderTransitions":0}'
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: csi-qingcloud
  creationTimestamp: "2019-09-27T08:45:53Z"
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    app: wordpress
  name: mysql-pv-claim
  namespace: default
  resourceVersion: "16399289"
  selfLink: /api/v1/namespaces/default/persistentvolumeclaims/mysql-pv-claim
  uid: 36fd9b5e-e103-11e9-a74d-525499c9b2bb
spec:
  accessModes:
  - ReadWriteOnce
  dataSource: null
  resources:
    requests:
      storage: 20Gi
  storageClassName: csi-qingcloud
  volumeMode: Filesystem
  volumeName: pvc-36fd9b5ee10311e9
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 20Gi
  phase: Bound

PV

# kubectl get pv pvc-36fd9b5ee10311e9 -oyaml
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    pv.kubernetes.io/provisioned-by: csi-qingcloud
  creationTimestamp: "2019-09-27T08:46:05Z"
  finalizers:
  - kubernetes.io/pv-protection
  - external-attacher/csi-qingcloud
  name: pvc-36fd9b5ee10311e9
  resourceVersion: "16399571"
  selfLink: /api/v1/persistentvolumes/pvc-36fd9b5ee10311e9
  uid: 3e05e2e7-e103-11e9-a74d-525499c9b2bb
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 20Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: mysql-pv-claim
    namespace: default
    resourceVersion: "16399204"
    uid: 36fd9b5e-e103-11e9-a74d-525499c9b2bb
  csi:
    driver: csi-qingcloud
    volumeAttributes:
      fsType: ext4
      maxSize: "1000"
      minSize: "10"
      stepSize: "10"
      storage.kubernetes.io/csiProvisionerIdentity: 1565516505378-8081-csi-qingcloud
      type: "3"
    volumeHandle: vol-28exsiuk
  persistentVolumeReclaimPolicy: Delete
  storageClassName: csi-qingcloud
  volumeMode: Filesystem
status:
  phase: Bound

@wnxn
Copy link
Contributor Author

wnxn commented Oct 9, 2019

qingcloud csi v1.1.0

storage class

# kubectl get sc csi-qingcloud -oyaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.beta.kubernetes.io/is-default-class: "true"
    storageclass.kubernetes.io/is-default-class: "true"
  creationTimestamp: "2019-07-26T20:55:07Z"
  name: csi-qingcloud
  resourceVersion: "36343649"
  selfLink: /apis/storage.k8s.io/v1/storageclasses/csi-qingcloud
  uid: 0ec98349-158b-4955-a9c2-c68a40ff27d3
parameters:
  fsType: ext4
  maxSize: "5000"
  minSize: "10"
  replica: "2"
  stepSize: "10"
  type: "100"
provisioner: disk.csi.qingcloud.com
reclaimPolicy: Delete
volumeBindingMode: Immediate

PVC

# kubectl get pvc test -n wx -oyaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    kubesphere.io/creator: admin
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: disk.csi.qingcloud.com
  creationTimestamp: "2019-09-24T04:02:54Z"
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    app: test
  name: test
  namespace: wx
  resourceVersion: "34089971"
  selfLink: /api/v1/namespaces/wx/persistentvolumeclaims/test
  uid: b0fa9a37-75f2-4cd5-8563-11befbcff26d
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: csi-qingcloud
  volumeMode: Filesystem
  volumeName: pvc-b0fa9a37-75f2-4cd5-8563-11befbcff26d
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 10Gi
  phase: Bound

PV

# kubectl get pv pvc-b0fa9a37-75f2-4cd5-8563-11befbcff26d -oyaml
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    pv.kubernetes.io/provisioned-by: disk.csi.qingcloud.com
  creationTimestamp: "2019-09-24T04:03:07Z"
  finalizers:
  - kubernetes.io/pv-protection
  - external-attacher/disk-csi-qingcloud-com
  name: pvc-b0fa9a37-75f2-4cd5-8563-11befbcff26d
  resourceVersion: "34090201"
  selfLink: /api/v1/persistentvolumes/pvc-b0fa9a37-75f2-4cd5-8563-11befbcff26d
  uid: 6c182465-4137-460b-89df-2754f85af95c
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 10Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: test
    namespace: wx
    resourceVersion: "34089876"
    uid: b0fa9a37-75f2-4cd5-8563-11befbcff26d
  csi:
    driver: disk.csi.qingcloud.com
    fsType: ext4
    volumeAttributes:
      fsType: ext4
      maxSize: "5000"
      minSize: "10"
      replica: "2"
      stepSize: "10"
      storage.kubernetes.io/csiProvisionerIdentity: 1569297645168-8081-disk.csi.qingcloud.com
      type: "100"
    volumeHandle: vol-ry6pk5to
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: topology.disk.csi.qingcloud.com/instance-type
          operator: In
          values:
          - Standard
        - key: topology.disk.csi.qingcloud.com/zone
          operator: In
          values:
          - ap2a
  persistentVolumeReclaimPolicy: Delete
  storageClassName: csi-qingcloud
  volumeMode: Filesystem
status:
  phase: Bound

@wnxn
Copy link
Contributor Author

wnxn commented Oct 10, 2019

Cannot edit spec.csi.driver in PV

  • spec.persistentvolumesource: Forbidden: is immutable after creation

Seems that we can't modify PV's spec.csi.driver field
https://github.com/kubernetes/kubernetes/blob/825e07d4723be6ebfc96d92ba1d3bc82f06cd307/pkg/apis/core/validation/validation.go#L1838-L1842

@wnxn
Copy link
Contributor Author

wnxn commented Oct 10, 2019

How to upgrade to qingcloud csi v1.1.0

  1. In Kubernetes v1.14+, please set correct feature-gates https://github.com/yunify/qingcloud-csi/tree/master#installation
  2. uninstall previous qingcloud csi v0.2.x resource except configmap
  3. configure qingcloud csi v1.1.0 yaml file (replace disk.csi.qingcloud.com to csi-qingcloud)and remove configmap section
  4. install qingcloud csi v1.1.0 yaml file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

No branches or pull requests

1 participant