Skip to content

feat: Support CRS for local-path provisioner and add CSI e2e #731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions charts/cluster-api-runtime-extensions-nutanix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
| hooks.cni.cilium.crsStrategy.defaultCiliumConfigMap.name | string | `"cilium"` | |
| hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-cilium-cni-helm-values-template"` | |
| hooks.csi.local-path.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.csi.local-path.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-local-path-csi-helm-values-template"` | |
| hooks.csi.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.csi.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nutanix-csi-helm-values-template"` | |
| hooks.nfd.crsStrategy.defaultInstallationConfigMap.name | string | `"node-feature-discovery"` | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2024 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

{{- if (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.create }}
apiVersion: v1
kind: ConfigMap
metadata:
name: '{{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}'
data:
values.yaml: |-
storageClass:
create: false
provisionerName: rancher.io/local-path
helperImage:
tag: 1.36.1
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
operator: Exists
tolerationSeconds: 300
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
# Copyright 2024 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

#=================================================================
# DO NOT EDIT THIS FILE
# IT HAS BEEN GENERATED BY /hack/addons/update-local-path-provisioner-csi.sh
#=================================================================
apiVersion: v1
data:
local-path-provisioner-csi.yaml: |
apiVersion: v1
imagePullSecrets: null
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
name: local-path-provisioner
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
name: local-path-provisioner
namespace: kube-system
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- create
- patch
- update
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
name: local-path-provisioner
rules:
- apiGroups:
- ""
resources:
- nodes
- persistentvolumeclaims
- configmaps
- pods
- pods/log
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- patch
- update
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
name: local-path-provisioner
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: local-path-provisioner
subjects:
- kind: ServiceAccount
name: local-path-provisioner
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
name: local-path-provisioner
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: local-path-provisioner
subjects:
- kind: ServiceAccount
name: local-path-provisioner
namespace: kube-system
---
apiVersion: v1
data:
config.json: |-
{
"nodePathMap": [
{
"node": "DEFAULT_PATH_FOR_NON_LISTED_NODES",
"paths": [
"/opt/local-path-provisioner"
]
}
]
}
helperPod.yaml: |-
apiVersion: v1
kind: Pod
metadata:
name: helper-pod
namespace: kube-system
spec:
priorityClassName: system-node-critical
tolerations:
- key: node.kubernetes.io/disk-pressure
operator: Exists
effect: NoSchedule
containers:
- name: helper-pod
image: busybox:1.36.1
imagePullPolicy: IfNotPresent
resources:
{}
setup: |-
#!/bin/sh
set -eu
mkdir -m 0777 -p "$VOL_DIR"
teardown: |-
#!/bin/sh
set -eu
rm -rf "$VOL_DIR"
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
name: local-path-config
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
name: local-path-provisioner
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/name: local-path-provisioner
template:
metadata:
labels:
app.kubernetes.io/instance: local-path-provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: local-path-provisioner
app.kubernetes.io/version: v0.0.27
helm.sh/chart: local-path-provisioner-0.0.29
spec:
containers:
- command:
- local-path-provisioner
- --debug
- start
- --config
- /etc/config/config.json
- --service-account-name
- local-path-provisioner
- --provisioner-name
- rancher.io/local-path
- --helper-image
- busybox:1.36.1
- --configmap-name
- local-path-config
env:
- name: POD_NAMESPACE
value: kube-system
- name: CONFIG_MOUNT_PATH
value: /etc/config/
image: rancher/local-path-provisioner:v0.0.27
imagePullPolicy: IfNotPresent
name: local-path-provisioner
resources: {}
securityContext: {}
volumeMounts:
- mountPath: /etc/config/
name: config-volume
securityContext: {}
serviceAccountName: local-path-provisioner
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
operator: Exists
tolerationSeconds: 300
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
volumes:
- configMap:
name: local-path-config
name: config-volume
kind: ConfigMap
metadata:
creationTimestamp: null
name: local-path-provisioner-csi
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ spec:
- --helm-addons-configmap={{ .Values.helmAddonsConfigMap }}
- --cni.cilium.helm-addon.default-values-template-configmap-name={{ .Values.hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
- --nfd.helm-addon.default-values-template-configmap-name={{ .Values.hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
- --csi.local-path.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
{{- range $key, $value := .Values.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/cluster-api-runtime-extensions-nutanix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ hooks:
defaultValueTemplateConfigMap:
create: true
name: default-nutanix-csi-helm-values-template
local-path:
helmAddonStrategy:
defaultValueTemplateConfigMap:
create: true
name: default-local-path-csi-helm-values-template
ccm:
nutanix:
helmAddonStrategy:
Expand Down
2 changes: 1 addition & 1 deletion examples/capi-quick-start/docker-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
local-path:
storageClassConfigs:
default: {}
strategy: HelmAddon
strategy: ClusterResourceSet
nfd:
strategy: ClusterResourceSet
encryptionAtRest:
Expand Down
2 changes: 1 addition & 1 deletion examples/capi-quick-start/docker-cluster-cilium-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
local-path:
storageClassConfigs:
default: {}
strategy: HelmAddon
strategy: ClusterResourceSet
nfd:
strategy: ClusterResourceSet
encryptionAtRest:
Expand Down
21 changes: 21 additions & 0 deletions hack/addons/kustomize/local-path-provisioner-csi/helm-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

---
storageClass:
create: false
provisionerName: rancher.io/local-path
helperImage:
tag: 1.36.1
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
operator: Exists
tolerationSeconds: 300
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ helmCharts:
repo: https://charts.containeroo.ch
releaseName: local-path-provisioner
version: ${LOCAL_PATH_CSI_CHART_VERSION}
valuesFile: helm-values.yaml
includeCRDs: true
skipTests: true
namespace: kube-system
Loading
Loading