Skip to content

Commit 9b1bada

Browse files
authored
feat: Add local-path-provisioner CSI (#693)
This enables easy testing with Docker clusters as well, but this should not be used in production.
1 parent dcda1dc commit 9b1bada

File tree

18 files changed

+240
-15
lines changed

18 files changed

+240
-15
lines changed

api/v1alpha1/addon_types.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ const (
1919
CNIProviderCalico = "Calico"
2020
CNIProviderCilium = "Cilium"
2121

22-
CSIProviderAWSEBS = "aws-ebs"
23-
CSIProviderNutanix = "nutanix"
22+
CSIProviderAWSEBS = "aws-ebs"
23+
CSIProviderNutanix = "nutanix"
24+
CSIProviderLocalPath = "local-path"
2425

2526
VirtualIPProviderKubeVIP = "KubeVIP"
2627

@@ -45,8 +46,9 @@ const (
4546
type StorageProvisioner string
4647

4748
const (
48-
AWSEBSProvisioner StorageProvisioner = "ebs.csi.aws.com"
49-
NutanixProvisioner StorageProvisioner = "csi.nutanix.com"
49+
AWSEBSProvisioner StorageProvisioner = "ebs.csi.aws.com"
50+
NutanixProvisioner StorageProvisioner = "csi.nutanix.com"
51+
LocalPathProvisioner StorageProvisioner = "rancher.io/local-path"
5052
)
5153

5254
// FIXME: Remove the CCM providers from the API. Users do not provider this
@@ -110,7 +112,7 @@ type ClusterAutoscaler struct {
110112
type DefaultStorage struct {
111113
// Name of the CSI Provider for the default storage class.
112114
// +kubebuilder:validation:Required
113-
// +kubebuilder:validation:Enum=aws-ebs;nutanix
115+
// +kubebuilder:validation:Enum=aws-ebs;nutanix;local-path
114116
ProviderName string `json:"providerName"`
115117

116118
// Name of storage class config in any of the provider objects.
@@ -131,7 +133,7 @@ type CSI struct {
131133
type CSIProvider struct {
132134
// Name of the CSI Provider.
133135
// +kubebuilder:validation:Required
134-
// +kubebuilder:validation:Enum=aws-ebs;nutanix
136+
// +kubebuilder:validation:Enum=aws-ebs;nutanix;local-path
135137
Name string `json:"name"`
136138

137139
// StorageClassConfig is a list of storage class configurations for this CSI provider.

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ spec:
113113
enum:
114114
- aws-ebs
115115
- nutanix
116+
- local-path
116117
type: string
117118
storageClassConfigName:
118119
description: Name of storage class config in any of the
@@ -151,6 +152,7 @@ spec:
151152
enum:
152153
- aws-ebs
153154
- nutanix
155+
- local-path
154156
type: string
155157
storageClassConfig:
156158
description: StorageClassConfig is a list of storage

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ spec:
114114
enum:
115115
- aws-ebs
116116
- nutanix
117+
- local-path
117118
type: string
118119
storageClassConfigName:
119120
description: Name of storage class config in any of the
@@ -152,6 +153,7 @@ spec:
152153
enum:
153154
- aws-ebs
154155
- nutanix
156+
- local-path
155157
type: string
156158
storageClassConfig:
157159
description: StorageClassConfig is a list of storage

api/v1alpha1/crds/caren.nutanix.com_genericclusterconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ spec:
122122
enum:
123123
- aws-ebs
124124
- nutanix
125+
- local-path
125126
type: string
126127
storageClassConfigName:
127128
description: Name of storage class config in any of the
@@ -160,6 +161,7 @@ spec:
160161
enum:
161162
- aws-ebs
162163
- nutanix
164+
- local-path
163165
type: string
164166
storageClassConfig:
165167
description: StorageClassConfig is a list of storage

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ spec:
114114
enum:
115115
- aws-ebs
116116
- nutanix
117+
- local-path
117118
type: string
118119
storageClassConfigName:
119120
description: Name of storage class config in any of the
@@ -152,6 +153,7 @@ spec:
152153
enum:
153154
- aws-ebs
154155
- nutanix
156+
- local-path
155157
type: string
156158
storageClassConfig:
157159
description: StorageClassConfig is a list of storage

charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ data:
1515
ChartName: cluster-autoscaler
1616
ChartVersion: 9.37.0
1717
RepositoryURL: https://kubernetes.github.io/autoscaler
18+
local-path-provisioner-csi: |
19+
ChartName: local-path-provisioner
20+
ChartVersion: v0.0.29
21+
RepositoryURL: https://charts.containeroo.ch
1822
metallb: |
1923
ChartName: metallb
2024
ChartVersion: v0.14.5

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ spec:
2727
cni:
2828
provider: Calico
2929
strategy: ClusterResourceSet
30+
csi:
31+
defaultStorage:
32+
providerName: local-path
33+
storageClassConfigName: local-path
34+
providers:
35+
- name: local-path
36+
storageClassConfig:
37+
- name: local-path
38+
strategy: HelmAddon
3039
nfd:
3140
strategy: ClusterResourceSet
3241
encryptionAtRest:

examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ spec:
2727
cni:
2828
provider: Calico
2929
strategy: HelmAddon
30+
csi:
31+
defaultStorage:
32+
providerName: local-path
33+
storageClassConfigName: local-path
34+
providers:
35+
- name: local-path
36+
storageClassConfig:
37+
- name: local-path
38+
strategy: HelmAddon
3039
nfd:
3140
strategy: HelmAddon
3241
encryptionAtRest:

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ spec:
2727
cni:
2828
provider: Cilium
2929
strategy: ClusterResourceSet
30+
csi:
31+
defaultStorage:
32+
providerName: local-path
33+
storageClassConfigName: local-path
34+
providers:
35+
- name: local-path
36+
storageClassConfig:
37+
- name: local-path
38+
strategy: HelmAddon
3039
nfd:
3140
strategy: ClusterResourceSet
3241
encryptionAtRest:

examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ spec:
2727
cni:
2828
provider: Cilium
2929
strategy: HelmAddon
30+
csi:
31+
defaultStorage:
32+
providerName: local-path
33+
storageClassConfigName: local-path
34+
providers:
35+
- name: local-path
36+
storageClassConfig:
37+
- name: local-path
38+
strategy: HelmAddon
3039
nfd:
3140
strategy: HelmAddon
3241
encryptionAtRest:

0 commit comments

Comments
 (0)