Skip to content

Commit bb98508

Browse files
authored
feat: Support CRS for local-path provisioner and add CSI e2e (#731)
Further strategy support for other providers coming in follow up PR, plus more e2e tests for those other providers.
1 parent 602cef3 commit bb98508

File tree

30 files changed

+901
-75
lines changed

30 files changed

+901
-75
lines changed

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
6060
| hooks.cni.cilium.crsStrategy.defaultCiliumConfigMap.name | string | `"cilium"` | |
6161
| hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
6262
| hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-cilium-cni-helm-values-template"` | |
63+
| hooks.csi.local-path.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
64+
| hooks.csi.local-path.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-local-path-csi-helm-values-template"` | |
6365
| hooks.csi.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
6466
| hooks.csi.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nutanix-csi-helm-values-template"` | |
6567
| hooks.nfd.crsStrategy.defaultInstallationConfigMap.name | string | `"node-feature-discovery"` | |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2024 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{{- if (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.create }}
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: '{{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}'
9+
data:
10+
values.yaml: |-
11+
storageClass:
12+
create: false
13+
provisionerName: rancher.io/local-path
14+
helperImage:
15+
tag: 1.36.1
16+
tolerations:
17+
- key: CriticalAddonsOnly
18+
operator: Exists
19+
- effect: NoExecute
20+
operator: Exists
21+
tolerationSeconds: 300
22+
- effect: NoSchedule
23+
key: node-role.kubernetes.io/master
24+
operator: Exists
25+
- effect: NoSchedule
26+
key: node-role.kubernetes.io/control-plane
27+
operator: Exists
28+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
# Copyright 2024 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
#=================================================================
5+
# DO NOT EDIT THIS FILE
6+
# IT HAS BEEN GENERATED BY /hack/addons/update-local-path-provisioner-csi.sh
7+
#=================================================================
8+
apiVersion: v1
9+
data:
10+
local-path-provisioner-csi.yaml: |
11+
apiVersion: v1
12+
imagePullSecrets: null
13+
kind: ServiceAccount
14+
metadata:
15+
labels:
16+
app.kubernetes.io/instance: local-path-provisioner
17+
app.kubernetes.io/managed-by: Helm
18+
app.kubernetes.io/name: local-path-provisioner
19+
app.kubernetes.io/version: v0.0.27
20+
helm.sh/chart: local-path-provisioner-0.0.29
21+
name: local-path-provisioner
22+
namespace: kube-system
23+
---
24+
apiVersion: rbac.authorization.k8s.io/v1
25+
kind: Role
26+
metadata:
27+
labels:
28+
app.kubernetes.io/instance: local-path-provisioner
29+
app.kubernetes.io/managed-by: Helm
30+
app.kubernetes.io/name: local-path-provisioner
31+
app.kubernetes.io/version: v0.0.27
32+
helm.sh/chart: local-path-provisioner-0.0.29
33+
name: local-path-provisioner
34+
namespace: kube-system
35+
rules:
36+
- apiGroups:
37+
- ""
38+
resources:
39+
- pods
40+
verbs:
41+
- get
42+
- list
43+
- watch
44+
- create
45+
- patch
46+
- update
47+
- delete
48+
---
49+
apiVersion: rbac.authorization.k8s.io/v1
50+
kind: ClusterRole
51+
metadata:
52+
labels:
53+
app.kubernetes.io/instance: local-path-provisioner
54+
app.kubernetes.io/managed-by: Helm
55+
app.kubernetes.io/name: local-path-provisioner
56+
app.kubernetes.io/version: v0.0.27
57+
helm.sh/chart: local-path-provisioner-0.0.29
58+
name: local-path-provisioner
59+
rules:
60+
- apiGroups:
61+
- ""
62+
resources:
63+
- nodes
64+
- persistentvolumeclaims
65+
- configmaps
66+
- pods
67+
- pods/log
68+
verbs:
69+
- get
70+
- list
71+
- watch
72+
- apiGroups:
73+
- ""
74+
resources:
75+
- persistentvolumes
76+
verbs:
77+
- get
78+
- list
79+
- watch
80+
- create
81+
- patch
82+
- update
83+
- delete
84+
- apiGroups:
85+
- ""
86+
resources:
87+
- events
88+
verbs:
89+
- create
90+
- patch
91+
- apiGroups:
92+
- storage.k8s.io
93+
resources:
94+
- storageclasses
95+
verbs:
96+
- get
97+
- list
98+
- watch
99+
---
100+
apiVersion: rbac.authorization.k8s.io/v1
101+
kind: RoleBinding
102+
metadata:
103+
labels:
104+
app.kubernetes.io/instance: local-path-provisioner
105+
app.kubernetes.io/managed-by: Helm
106+
app.kubernetes.io/name: local-path-provisioner
107+
app.kubernetes.io/version: v0.0.27
108+
helm.sh/chart: local-path-provisioner-0.0.29
109+
name: local-path-provisioner
110+
namespace: kube-system
111+
roleRef:
112+
apiGroup: rbac.authorization.k8s.io
113+
kind: Role
114+
name: local-path-provisioner
115+
subjects:
116+
- kind: ServiceAccount
117+
name: local-path-provisioner
118+
namespace: kube-system
119+
---
120+
apiVersion: rbac.authorization.k8s.io/v1
121+
kind: ClusterRoleBinding
122+
metadata:
123+
labels:
124+
app.kubernetes.io/instance: local-path-provisioner
125+
app.kubernetes.io/managed-by: Helm
126+
app.kubernetes.io/name: local-path-provisioner
127+
app.kubernetes.io/version: v0.0.27
128+
helm.sh/chart: local-path-provisioner-0.0.29
129+
name: local-path-provisioner
130+
roleRef:
131+
apiGroup: rbac.authorization.k8s.io
132+
kind: ClusterRole
133+
name: local-path-provisioner
134+
subjects:
135+
- kind: ServiceAccount
136+
name: local-path-provisioner
137+
namespace: kube-system
138+
---
139+
apiVersion: v1
140+
data:
141+
config.json: |-
142+
{
143+
"nodePathMap": [
144+
{
145+
"node": "DEFAULT_PATH_FOR_NON_LISTED_NODES",
146+
"paths": [
147+
"/opt/local-path-provisioner"
148+
]
149+
}
150+
]
151+
}
152+
helperPod.yaml: |-
153+
apiVersion: v1
154+
kind: Pod
155+
metadata:
156+
name: helper-pod
157+
namespace: kube-system
158+
spec:
159+
priorityClassName: system-node-critical
160+
tolerations:
161+
- key: node.kubernetes.io/disk-pressure
162+
operator: Exists
163+
effect: NoSchedule
164+
containers:
165+
- name: helper-pod
166+
image: busybox:1.36.1
167+
imagePullPolicy: IfNotPresent
168+
resources:
169+
{}
170+
setup: |-
171+
#!/bin/sh
172+
set -eu
173+
mkdir -m 0777 -p "$VOL_DIR"
174+
teardown: |-
175+
#!/bin/sh
176+
set -eu
177+
rm -rf "$VOL_DIR"
178+
kind: ConfigMap
179+
metadata:
180+
labels:
181+
app.kubernetes.io/instance: local-path-provisioner
182+
app.kubernetes.io/managed-by: Helm
183+
app.kubernetes.io/name: local-path-provisioner
184+
app.kubernetes.io/version: v0.0.27
185+
helm.sh/chart: local-path-provisioner-0.0.29
186+
name: local-path-config
187+
namespace: kube-system
188+
---
189+
apiVersion: apps/v1
190+
kind: Deployment
191+
metadata:
192+
labels:
193+
app.kubernetes.io/instance: local-path-provisioner
194+
app.kubernetes.io/managed-by: Helm
195+
app.kubernetes.io/name: local-path-provisioner
196+
app.kubernetes.io/version: v0.0.27
197+
helm.sh/chart: local-path-provisioner-0.0.29
198+
name: local-path-provisioner
199+
namespace: kube-system
200+
spec:
201+
replicas: 1
202+
selector:
203+
matchLabels:
204+
app.kubernetes.io/instance: local-path-provisioner
205+
app.kubernetes.io/name: local-path-provisioner
206+
template:
207+
metadata:
208+
labels:
209+
app.kubernetes.io/instance: local-path-provisioner
210+
app.kubernetes.io/managed-by: Helm
211+
app.kubernetes.io/name: local-path-provisioner
212+
app.kubernetes.io/version: v0.0.27
213+
helm.sh/chart: local-path-provisioner-0.0.29
214+
spec:
215+
containers:
216+
- command:
217+
- local-path-provisioner
218+
- --debug
219+
- start
220+
- --config
221+
- /etc/config/config.json
222+
- --service-account-name
223+
- local-path-provisioner
224+
- --provisioner-name
225+
- rancher.io/local-path
226+
- --helper-image
227+
- busybox:1.36.1
228+
- --configmap-name
229+
- local-path-config
230+
env:
231+
- name: POD_NAMESPACE
232+
value: kube-system
233+
- name: CONFIG_MOUNT_PATH
234+
value: /etc/config/
235+
image: rancher/local-path-provisioner:v0.0.27
236+
imagePullPolicy: IfNotPresent
237+
name: local-path-provisioner
238+
resources: {}
239+
securityContext: {}
240+
volumeMounts:
241+
- mountPath: /etc/config/
242+
name: config-volume
243+
securityContext: {}
244+
serviceAccountName: local-path-provisioner
245+
tolerations:
246+
- key: CriticalAddonsOnly
247+
operator: Exists
248+
- effect: NoExecute
249+
operator: Exists
250+
tolerationSeconds: 300
251+
- effect: NoSchedule
252+
key: node-role.kubernetes.io/master
253+
operator: Exists
254+
- effect: NoSchedule
255+
key: node-role.kubernetes.io/control-plane
256+
operator: Exists
257+
volumes:
258+
- configMap:
259+
name: local-path-config
260+
name: config-volume
261+
kind: ConfigMap
262+
metadata:
263+
creationTimestamp: null
264+
name: local-path-provisioner-csi

charts/cluster-api-runtime-extensions-nutanix/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
- --helm-addons-configmap={{ .Values.helmAddonsConfigMap }}
3434
- --cni.cilium.helm-addon.default-values-template-configmap-name={{ .Values.hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
3535
- --nfd.helm-addon.default-values-template-configmap-name={{ .Values.hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
36+
- --csi.local-path.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
3637
{{- range $key, $value := .Values.extraArgs }}
3738
- --{{ $key }}={{ $value }}
3839
{{- end }}

charts/cluster-api-runtime-extensions-nutanix/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ hooks:
4949
defaultValueTemplateConfigMap:
5050
create: true
5151
name: default-nutanix-csi-helm-values-template
52+
local-path:
53+
helmAddonStrategy:
54+
defaultValueTemplateConfigMap:
55+
create: true
56+
name: default-local-path-csi-helm-values-template
5257
ccm:
5358
nutanix:
5459
helmAddonStrategy:

examples/capi-quick-start/docker-cluster-calico-crs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
local-path:
3636
storageClassConfigs:
3737
default: {}
38-
strategy: HelmAddon
38+
strategy: ClusterResourceSet
3939
nfd:
4040
strategy: ClusterResourceSet
4141
encryptionAtRest:

examples/capi-quick-start/docker-cluster-cilium-crs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
local-path:
3636
storageClassConfigs:
3737
default: {}
38-
strategy: HelmAddon
38+
strategy: ClusterResourceSet
3939
nfd:
4040
strategy: ClusterResourceSet
4141
encryptionAtRest:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2024 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
storageClass:
6+
create: false
7+
provisionerName: rancher.io/local-path
8+
helperImage:
9+
tag: 1.36.1
10+
tolerations:
11+
- key: CriticalAddonsOnly
12+
operator: Exists
13+
- effect: NoExecute
14+
operator: Exists
15+
tolerationSeconds: 300
16+
- effect: NoSchedule
17+
key: node-role.kubernetes.io/master
18+
operator: Exists
19+
- effect: NoSchedule
20+
key: node-role.kubernetes.io/control-plane
21+
operator: Exists

hack/addons/kustomize/local-path-provisioner-csi/kustomization.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ helmCharts:
1414
repo: https://charts.containeroo.ch
1515
releaseName: local-path-provisioner
1616
version: ${LOCAL_PATH_CSI_CHART_VERSION}
17+
valuesFile: helm-values.yaml
1718
includeCRDs: true
1819
skipTests: true
1920
namespace: kube-system

0 commit comments

Comments
 (0)