Skip to content

Commit 3ac83ac

Browse files
authored
[k8s] add expanding persistent volumes in tenant clusters (#1438)
<!-- Thank you for making a contribution! Here are some tips for you: - Start the PR title with the [label] of Cozystack component: - For system components: [platform], [system], [linstor], [cilium], [kube-ovn], [dashboard], [cluster-api], etc. - For managed apps: [apps], [tenant], [kubernetes], [postgres], [virtual-machine] etc. - For development and maintenance: [tests], [ci], [docs], [maintenance]. - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Add the label `backport` if it's a bugfix that needs to be backported to a previous version. --> ## What this PR does ### Release note <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same [label] as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note - add expanding persistent volumes in tenant clusters ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Enabled PersistentVolumeClaim expansion in the KubeVirt CSI StorageClass. - Added CSI resizer sidecar to the controller for online volume resizing. - Introduced cluster-scoped RBAC to allow required access to PersistentVolumes. - Chores - Updated Kubernetes app chart to 0.29.2 and set app version to 1.32.6. - Upgraded KubeVirt CSI driver image to 0.37.0. - Refreshed versions map entries for the new release. - Simplified CoreDNS configuration to use the default image repository. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents d991c49 + ca19529 commit 3ac83ac

8 files changed

Lines changed: 51 additions & 6 deletions

File tree

‎packages/apps/kubernetes/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.29.1
19+
version: 0.29.2
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ghcr.io/cozystack/cozystack/kubevirt-csi-driver:0.29.1@sha256:cae43eae09fc39e5f2140d30ef55253f871cc565b8b7a564a54077b7cbd92212
1+
kklinch0/kubevirt-csi-driver:0.37.0@sha256:d334ba727f0974b085f6e44ee52a61fa0c507063875b52006665dbacfa332cbd

‎packages/apps/kubernetes/templates/csi/deploy.yaml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,29 @@ spec:
205205
- mountPath: /etc/kubernetes/kubeconfig
206206
name: kubeconfig
207207
readOnly: true
208+
- name: csi-resizer
209+
image: registry.k8s.io/sig-storage/csi-resizer:v1.13.1
210+
args:
211+
- "-csi-address=/csi/csi.sock"
212+
- "-kubeconfig=/etc/kubernetes/kubeconfig/super-admin.svc"
213+
- "-v=5"
214+
- "-timeout=3m"
215+
- '-handle-volume-inuse-error=false'
216+
volumeMounts:
217+
- mountPath: /csi
218+
name: socket-dir
219+
- mountPath: /etc/kubernetes/kubeconfig
220+
name: kubeconfig
221+
readOnly: true
222+
resources:
223+
requests:
224+
cpu: 10m
225+
memory: 20Mi
226+
securityContext:
227+
capabilities:
228+
drop:
229+
- ALL
230+
readOnlyRootFilesystem: true
208231
volumes:
209232
- name: socket-dir
210233
emptyDir: {}

‎packages/apps/kubernetes/templates/csi/infra-cluster-service-account.yaml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,25 @@ roleRef:
3636
subjects:
3737
- kind: ServiceAccount
3838
name: {{ .Release.Name }}-kcsi
39+
---
40+
apiVersion: rbac.authorization.k8s.io/v1
41+
kind: ClusterRole
42+
metadata:
43+
name: {{ .Release.Name }}-kcsi
44+
rules:
45+
- apiGroups: [""]
46+
resources: ["persistentvolumes"]
47+
verbs: ["get"]
48+
---
49+
kind: ClusterRoleBinding
50+
apiVersion: rbac.authorization.k8s.io/v1
51+
metadata:
52+
name: {{ .Release.Name }}-kcsi-binding
53+
roleRef:
54+
kind: ClusterRole
55+
name: {{ .Release.Name }}-kcsi
56+
apiGroup: rbac.authorization.k8s.io
57+
subjects:
58+
- kind: ServiceAccount
59+
name: {{ .Release.Name }}-kcsi
60+
namespace: {{ .Release.Namespace }}

‎packages/apps/versions_map‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ kubernetes 0.26.3 c02a3818
7272
kubernetes 0.27.0 6cd5e746
7373
kubernetes 0.28.0 7f477eec
7474
kubernetes 0.29.0 87b23161
75-
kubernetes 0.29.1 HEAD
75+
kubernetes 0.29.1 53fbe7c2
76+
kubernetes 0.29.2 HEAD
7677
mysql 0.1.0 263e47be
7778
mysql 0.2.0 c24a103f
7879
mysql 0.3.0 53f2365e
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
coredns:
2-
image:
3-
repository: registry.k8s.io/coredns/coredns
42
replicaCount: 2

‎packages/system/kubevirt-csi-node/templates/deploy.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ metadata:
273273
annotations:
274274
storageclass.kubernetes.io/is-default-class: "true"
275275
provisioner: csi.kubevirt.io
276+
allowVolumeExpansion: true
276277
parameters:
277278
infraStorageClassName: {{ .Values.storageClass }}
278279
bus: scsi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
storageClass: replicated
22
csiDriver:
3-
image: ghcr.io/cozystack/cozystack/kubevirt-csi-driver:0.29.1@sha256:cae43eae09fc39e5f2140d30ef55253f871cc565b8b7a564a54077b7cbd92212
3+
image: kklinch0/kubevirt-csi-driver:0.37.0@sha256:d334ba727f0974b085f6e44ee52a61fa0c507063875b52006665dbacfa332cbd

0 commit comments

Comments
 (0)