bhouse-nexthop opened a new issue, #14913:
URL: https://github.com/apache/cloudstack/issues/14913
### problem
A CKS cluster created with the CSI driver (`enablecsi=true`) has no
`CSIDriver` object and no `cloudstack-csi-snapshotter-binding`
ClusterRoleBinding, so the CSI controller's snapshotter has no RBAC and volume
snapshots can't work.
The binaries ISO builder (`scripts/util/create-kubernetes-binaries-iso.sh`)
downloads `manifest.yaml` of cloudstack-csi-driver v3.0.0. That file ends line
121 with the document separator:
```yaml
roleRef:
kind: ClusterRole
name: cloudstack-csi-snapshotter-role
apiGroup: rbac.authorization.k8s.io---
apiVersion: storage.k8s.io/v1
kind: CSIDriver
```
The ClusterRoleBinding and the CSIDriver become one document, which the API
server refuses (error below). The rest of the manifest is applied, so the
controller and node pods run and the cluster looks healthy.
The failure isn't reported. `deploy-csi-driver` fails, CloudStack copies the
scripts again and re-runs it, and the second run exits 0 at its first line
because the `cloudstack-csi-controller` pod from the partial apply exists.
The driver's release workflow appends `---` to `deploy/k8s/rbac.yaml`, which
has no final newline. A later change there (`printf "---\n"`) doesn't fix it,
and no app release has been made since v3.0.0, so every ISO built from the
current builder carries the broken file.
### versions
4.22 branch and `main`. The CSI driver integration exists since 4.22.0. KVM,
any storage.
### The steps to reproduce the bug
1. Create a CKS cluster with `enablecsi=true` from a binaries ISO built by
`create-kubernetes-binaries-iso.sh`.
2. On the control node: `kubectl get csidriver csi.cloudstack.apache.org`
returns NotFound, and `kubectl get clusterrolebinding
cloudstack-csi-snapshotter-binding` returns NotFound.
3. `kubectl apply -f /opt/csi/manifest.yaml` on the control node applies
everything else and fails with:
```
Error from server (BadRequest): error when creating
"/opt/csi/manifest.yaml": CSIDriver in version "v1" cannot be handled as a
CSIDriver: strict decoding error: unknown field "roleRef", unknown field
"subjects"
```
### What to do about it?
Put the separator on a line of its own when the control node copies
`manifest.yaml` from the ISO to `/opt/csi`. That also fixes clusters created
from ISOs that were already built. On a correct manifest the step changes
nothing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]