IBM / ibm-object-csi-driver

Object storage plugin for IBM satellite
Apache License 2.0
3 stars 8 forks source link

Add priorityClassName to driver pods and update readme and other yamls #141

Closed Bhagyashreek8 closed 1 month ago

Bhagyashreek8 commented 1 month ago

Describe your changes

Issue ticket number and link

Checklist before requesting a review

Bhagyashreek8 commented 1 month ago

Test results-

% ic ks cluster config -c bha-priorityClass
OK
The configuration for bha-priorityClass was downloaded successfully.

Added context for bha-priorityClass to the current kubeconfig file.
You can now execute 'kubectl' commands against your cluster. For example, run 'kubectl get nodes'.
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % kubectl get nodes
NAME           STATUS   ROLES    AGE     VERSION
10.240.0.4     Ready    <none>   3m34s   v1.30.4+IKS
10.240.128.4   Ready    <none>   3m15s   v1.30.4+IKS
10.240.64.4    Ready    <none>   3m51s   v1.30.4+IKS
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % 
% kubectl apply -k deploy/ibmCloud/
namespace/ibm-object-csi-driver created
storageclass.storage.k8s.io/ibm-object-storage-smart-rclone created
storageclass.storage.k8s.io/ibm-object-storage-smart-rclone-retain created
storageclass.storage.k8s.io/ibm-object-storage-smart-s3fs created
storageclass.storage.k8s.io/ibm-object-storage-smart-s3fs-retain created
storageclass.storage.k8s.io/ibm-object-storage-standard-rclone created
storageclass.storage.k8s.io/ibm-object-storage-standard-rclone-retain created
storageclass.storage.k8s.io/ibm-object-storage-standard-s3fs created
storageclass.storage.k8s.io/ibm-object-storage-standard-s3fs-retain created
serviceaccount/ibm-object-csi-controller created
serviceaccount/ibm-object-csi-nodeserver created
clusterrole.rbac.authorization.k8s.io/ibm-object-csi-controller-role created
clusterrole.rbac.authorization.k8s.io/ibm-object-csi-nodeserver-role created
clusterrolebinding.rbac.authorization.k8s.io/ibm-object-csi-controller-allow-anyuid created
clusterrolebinding.rbac.authorization.k8s.io/ibm-object-csi-controller-rolebind created
clusterrolebinding.rbac.authorization.k8s.io/ibm-object-csi-nodeserver-allow-privileged created
clusterrolebinding.rbac.authorization.k8s.io/ibm-object-csi-nodeserver-rolebind created
deployment.apps/ibm-object-csi-controller created
daemonset.apps/ibm-object-csi-driver created
csidriver.storage.k8s.io/cos.s3.csi.ibm.io created
% kubectl get all -n ibm-object-csi-driver                                               
NAME                                             READY   STATUS    RESTARTS   AGE
pod/ibm-object-csi-controller-6d49fb7cb4-lg9mk   3/3     Running   0          113s
pod/ibm-object-csi-driver-k7ffh                  3/3     Running   0          15m
pod/ibm-object-csi-driver-wwxg2                  3/3     Running   0          15m
pod/ibm-object-csi-driver-xc9p9                  3/3     Running   0          15m

NAME                                   DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/ibm-object-csi-driver   3         3         3       3            3           <none>          15m

NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/ibm-object-csi-controller   1/1     1            1           15m

NAME                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/ibm-object-csi-controller-6d49fb7cb4   1         1         1       15m
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % 
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % 
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % kubectl get sc | grep object
ibm-object-storage-smart-rclone               cos.s3.csi.ibm.io      Delete          Immediate              false                  15m
ibm-object-storage-smart-rclone-retain        cos.s3.csi.ibm.io      Retain          Immediate              false                  15m
ibm-object-storage-smart-s3fs                 cos.s3.csi.ibm.io      Delete          Immediate              false                  15m
ibm-object-storage-smart-s3fs-retain          cos.s3.csi.ibm.io      Retain          Immediate              false                  15m
ibm-object-storage-standard-rclone            cos.s3.csi.ibm.io      Delete          Immediate              false                  15m
ibm-object-storage-standard-rclone-retain     cos.s3.csi.ibm.io      Retain          Immediate              false                  15m
ibm-object-storage-standard-s3fs              cos.s3.csi.ibm.io      Delete          Immediate              false                  15m
ibm-object-storage-standard-s3fs-retain       cos.s3.csi.ibm.io      Retain          Immediate              false                  15m
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % 
% kubectl describe pod ibm-object-csi-driver-rzdsc -n ibm-object-csi-driver
Name:                 ibm-object-csi-driver-rzdsc
Namespace:            ibm-object-csi-driver
Priority:             2000001000
Priority Class Name:  system-node-critical
Service Account:      ibm-object-csi-nodeserver
Node:                 10.240.0.4/10.240.0.4
Start Time:           Wed, 11 Sep 2024 11:23:50 +0530
Labels:               app=ibm-object-csi-driver
                      app.kubernetes.io/managed-by=kustomize
                      app.kubernetes.io/part-of=ibm-object-csi-driver
                      controller-revision-hash=7d9d967984
                      pod-template-generation=1
Annotations:          <none>
Status:               Running
IP:                   10.240.0.4
IPs:
  IP:           10.240.0.4
Controlled By:  DaemonSet/ibm-object-csi-driver
Containers:
  driver-registrar:
    Container ID:  containerd://1fa3a3b77d76761138affd1865f7c4c7e9e5245ccf42bf6b16c4a56e0aefb7e6
    Image:         k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.6.3
    Image ID:      k8s.gcr.io/sig-storage/csi-node-driver-registrar@sha256:fdff3ee285341bc58033b6b2458a5d45fd90ec6922a8ba6ebdd49b0c41e2cd34
    Port:          <none>
    Host Port:     <none>
    Args:
      --v=5
      --csi-address=$(ADDRESS)
      --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
    State:          Running
      Started:      Wed, 11 Sep 2024 11:23:52 +0530
    Ready:          True
    Restart Count:  0
    Environment:
      ADDRESS:               /csi/csi.sock
      DRIVER_REG_SOCK_PATH:  /var/lib/kubelet/plugins/cos.s3.csi.ibm.io/csi.sock
      KUBE_NODE_NAME:         (v1:spec.nodeName)
    Mounts:
      /csi from plugin-dir (rw)
      /registration from registration-dir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-wxd29 (ro)
  cos-csi-driver:
    Container ID:  containerd://7c3d604f0dab3703807e4a361a6440648d1d93ced5145b111032b5f2cf0ca3f2
    Image:         icr.io/ibm/ibm-object-csi-driver:v0.1.11
    Image ID:      icr.io/ibm/ibm-object-csi-driver@sha256:1bc3e51360af18da36b95d9da987b213c85b6c07a45960fdb4ff53a933bf157e
    Port:          <none>
    Host Port:     <none>
    Args:
      --servermode=node
      --endpoint=$(CSI_ENDPOINT)
      --nodeid=$(KUBE_NODE_NAME)
      --logtostderr=true
      --v=5
    State:          Running
      Started:      Wed, 11 Sep 2024 11:23:52 +0530
    Ready:          True
    Restart Count:  0
    Environment:
      CSI_ENDPOINT:    unix:///csi/csi.sock
      KUBE_NODE_NAME:   (v1:spec.nodeName)
    Mounts:
      /csi from plugin-dir (rw)
      /dev/fuse from fuse-device (rw)
      /dev/log from log-dev (rw)
      /host/var/log from host-log (rw)
      /var/data/kubelet from kubelet-dir-ibm (rw)
      /var/lib/kubelet from kubelet-dir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-wxd29 (ro)
  liveness-probe:
    Container ID:  containerd://463d2601ba61c9bebb5a605fe2fc41f7ec4a5494df84e046a28cc2a1c4b6fd28
    Image:         registry.k8s.io/sig-storage/livenessprobe:v2.9.0
    Image ID:      registry.k8s.io/sig-storage/livenessprobe@sha256:2b10b24dafdc3ba94a03fc94d9df9941ca9d6a9207b927f5dfd21d59fbe05ba0
    Port:          <none>
    Host Port:     <none>
    Args:
      --csi-address=/csi/csi.sock
    State:          Running
      Started:      Wed, 11 Sep 2024 11:23:53 +0530
    Ready:          True
    Restart Count:  0
    Environment:
      ADDRESS:  /csi/csi.sock
    Mounts:
      /csi from plugin-dir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-wxd29 (ro)
Conditions:
  Type                        Status
  PodReadyToStartContainers   True 
  Initialized                 True 
  Ready                       True 
  ContainersReady             True 
  PodScheduled                True 
Volumes:
  plugin-dir:
    Type:          HostPath (bare host directory volume)
    Path:          /var/lib/kubelet/plugins/cos.s3.csi.ibm.io/
    HostPathType:  DirectoryOrCreate
  kubelet-dir-ibm:
    Type:          HostPath (bare host directory volume)
    Path:          /var/data/kubelet
    HostPathType:  DirectoryOrCreate
  kubelet-dir:
    Type:          HostPath (bare host directory volume)
    Path:          /var/lib/kubelet
    HostPathType:  Directory
  registration-dir:
    Type:          HostPath (bare host directory volume)
    Path:          /var/lib/kubelet/plugins_registry/
    HostPathType:  DirectoryOrCreate
  fuse-device:
    Type:          HostPath (bare host directory volume)
    Path:          /dev/fuse
    HostPathType:  
  log-dev:
    Type:          HostPath (bare host directory volume)
    Path:          /dev/log
    HostPathType:  
  host-log:
    Type:          HostPath (bare host directory volume)
    Path:          /var/log
    HostPathType:  
  kube-api-access-wxd29:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/disk-pressure:NoSchedule op=Exists
                             node.kubernetes.io/memory-pressure:NoSchedule op=Exists
                             node.kubernetes.io/network-unavailable:NoSchedule op=Exists
                             node.kubernetes.io/not-ready:NoExecute op=Exists
                             node.kubernetes.io/pid-pressure:NoSchedule op=Exists
                             node.kubernetes.io/unreachable:NoExecute op=Exists
                             node.kubernetes.io/unschedulable:NoSchedule op=Exists
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  72s   default-scheduler  Successfully assigned ibm-object-csi-driver/ibm-object-csi-driver-rzdsc to 10.240.0.4
  Normal  Pulling    71s   kubelet            Pulling image "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.6.3"
  Normal  Pulled     70s   kubelet            Successfully pulled image "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.6.3" in 725ms (725ms including waiting). Image size: 10124505 bytes.
  Normal  Created    70s   kubelet            Created container driver-registrar
  Normal  Started    70s   kubelet            Started container driver-registrar
  Normal  Pulling    70s   kubelet            Pulling image "icr.io/ibm/ibm-object-csi-driver:v0.1.11"
  Normal  Pulled     70s   kubelet            Successfully pulled image "icr.io/ibm/ibm-object-csi-driver:v0.1.11" in 425ms (425ms including waiting). Image size: 125444720 bytes.
  Normal  Created    70s   kubelet            Created container cos-csi-driver
  Normal  Started    70s   kubelet            Started container cos-csi-driver
  Normal  Pulled     70s   kubelet            Container image "registry.k8s.io/sig-storage/livenessprobe:v2.9.0" already present on machine
  Normal  Created    70s   kubelet            Created container liveness-probe
  Normal  Started    69s   kubelet            Started container liveness-probe
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % 
% kubectl create -f examples/kubernetes/cos-s3-csi-s3fs-secret.yaml
secret/cos-s3-csi-s3fs-pvc created
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % 
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % 
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % kubectl describe secret cos-s3-csi-s3fs-pvc
Name:         cos-s3-csi-s3fs-pvc
Namespace:    default
Labels:       <none>
Annotations:  <none>

Type:  cos-s3-csi-driver

Data
====
accessKey:     32 bytes
bucketName:    0 bytes
mountOptions:  0 bytes
secretKey:     48 bytes
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % kubectl create -f examples/kubernetes/cos-s3-csi-s3fs-pvc.yaml
persistentvolumeclaim/cos-s3-csi-s3fs-pvc created
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % kubectl get pvc
NAME                  STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                       VOLUMEATTRIBUTESCLASS   AGE
cos-s3-csi-s3fs-pvc   Bound    pvc-c58a4a66-ba25-4e05-80c2-c1c4e3fd96f7   256Mi      RWO            ibm-object-storage-standard-s3fs   <unset>                 13s
% kubectl create -f examples/kubernetes/cos-csi-app-s3fs.yaml   
pod/cos-csi-app-s3fs created
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % kubectl get pods
NAME               READY   STATUS    RESTARTS   AGE
cos-csi-app-s3fs   1/1     Running   0          96s
bhagyashreek@Bhagyashrees-MacBook-Pro ibm-object-csi-driver % kubectl exec -it cos-csi-app-s3fs -- /bin/bash
root@cos-csi-app-s3fs:/# mount | grep s3fs
s3fs on /data type fuse.s3fs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
root@cos-csi-app-s3fs:/# cd /data/
root@cos-csi-app-s3fs:/data# ls
root@cos-csi-app-s3fs:/data# vi test.txt
bash: vi: command not found
root@cos-csi-app-s3fs:/data# touch test.txt
root@cos-csi-app-s3fs:/data# ls
test.txt
root@cos-csi-app-s3fs:/data# echo "hello" >> test.txt 
root@cos-csi-app-s3fs:/data# cat test.txt 
hello