ceph / ceph-csi-operator

operator that deploys and manages the CephCSI plugins
Apache License 2.0
7 stars 13 forks source link

csi deployment and daemonset pod are having empty container arguments #61

Open Madhu-1 opened 1 month ago

Madhu-1 commented 1 month ago
[🎩︎]mrajanna@li-2cfbef4c-22d9-11b2-a85c-a3e4a93c405f ceph-csi-operator $]kubectl get po -nopenshift-storage openshift-storage.cephfs.csi.ceph.com-ctrlplugin-cf894d87-jtstq -oyaml
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2024-07-26T11:31:51Z"
  generateName: openshift-storage.cephfs.csi.ceph.com-ctrlplugin-cf894d87-
  labels:
    app: openshift-storage.cephfs.csi.ceph.com-ctrlplugin
    pod-template-hash: cf894d87
  name: openshift-storage.cephfs.csi.ceph.com-ctrlplugin-cf894d87-jtstq
  namespace: openshift-storage
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: openshift-storage.cephfs.csi.ceph.com-ctrlplugin-cf894d87
    uid: 6a198468-a397-4ce3-a72c-736fedec2f2b
  resourceVersion: "495901"
  uid: 68620b93-7333-4df8-8557-4fdcfa437d84
spec:
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchLabels:
            app: openshift-storage.cephfs.csi.ceph.com-ctrlplugin
        topologyKey: kubernetes.io/hostname
  containers:
  - args:
    - --type=cephfs
    - --v=0
    - --endpoint=unix:///csi/csi.sock
    - --nodeid=$(NODE_ID)
    - --controllerserver=true
    - --drivername=openshift-storage.cephfs.csi.ceph.com
    - --pidlimit=-1
    - ""
    - ""
    - ""
    - ""
    env:
    - name: POD_IP
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: status.podIP
    - name: NODE_ID
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: spec.nodeName
    - name: POD_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    image: quay.io/cephcsi/cephcsi:v3.11.0
    imagePullPolicy: IfNotPresent
    name: csi-cephfsplugin
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /csi
      name: socket-dir
    - mountPath: /dev
      name: host-dev
    - mountPath: /sys
      name: host-sys
    - mountPath: /lib/modules
      name: lib-modules
      readOnly: true
    - mountPath: /tmp/csi/keys
      name: keys-tmp-dir
    - mountPath: /etc/ceph-csi-config
      name: ceph-csi-config
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: kube-api-access-qrn26
      readOnly: true
  - args:
    - --leader-election=true
    - --leader-election-namespace=openshift-storage
    - --leader-election-lease-duration=137s
    - --leader-election-renew-deadline=107s
    - --leader-election-retry-period=26s
    - --v=0
    - --csi-address=unix:///csi/csi.sock
    - --timeout=150s
    - --retry-interval-start=500ms
    - --default-fstype=ext4
    - --prevent-volume-mode-conversion=true
    - --feature-gates=HonorPVReclaimPolicy=true
    - ""
    - ""

The above is just one example.

leelavg commented 1 month ago

I also saw these empty args after deployment.

nb-ohad commented 1 month ago

This works as designed, they are an artifact of how the code is written. I am trying to understand what is the concrete concern. According to k8s standard empty args are ok and just ignored

To complete the picture I would add that we can refactor the code base to resolve these but the tradeoff would be the expanse of time and effort and it will make the code base more complex.

Madhu-1 commented 1 month ago

@nb-ohad There are 2 problems This creates confusion for those who get switched from Rook/cephcsi to the new operator where they will see many empty arguments for the containers IMHO this is completely an assumption that all the executables in the container image that we run in kubernetes must support empty args (I know that kubernetes supports pod/container creation with empty arguments but I have not seen that where it defined that all the containers that need to run in k8s should support empty arguments)