Skip to content

Commit 1a2f6eb

Browse files
Merge pull request #1632 from anmazzotti/separate_providers_chart
Create separate providers chart
2 parents afbc009 + 36acc1f commit 1a2f6eb

18 files changed

+883
-1
lines changed

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,11 @@ RELEASE_TAG ?= $(shell git describe --abbrev=0 --exclude 'test/*' 2>/dev/null)
184184
PREVIOUS_TAG ?= $(shell git describe --abbrev=0 --exclude $(RELEASE_TAG) --exclude 'test/*' 2>/dev/null)
185185
HELM_CHART_TAG := $(shell echo $(RELEASE_TAG) | cut -c 2-)
186186
CHART_DIR := charts/rancher-turtles
187+
PROVIDERS_CHART_DIR := charts/rancher-turtles-providers
187188
RELEASE_DIR ?= out
188189
CHART_PACKAGE_DIR ?= $(RELEASE_DIR)/package
189190
CHART_RELEASE_DIR ?= $(RELEASE_DIR)/$(CHART_DIR)
191+
PROVIDERS_CHART_RELEASE_DIR ?= $(RELEASE_DIR)/$(PROVIDERS_CHART_DIR)
190192

191193
# Allow overriding the imagePullPolicy
192194
PULL_POLICY ?= IfNotPresent
@@ -545,6 +547,9 @@ $(RELEASE_DIR):
545547
$(CHART_RELEASE_DIR):
546548
mkdir -p $(CHART_RELEASE_DIR)/templates
547549

550+
$(PROVIDERS_CHART_RELEASE_DIR):
551+
mkdir -p $(PROVIDERS_CHART_RELEASE_DIR)/templates
552+
548553
$(CHART_PACKAGE_DIR):
549554
mkdir -p $(CHART_PACKAGE_DIR)
550555

@@ -577,6 +582,12 @@ build-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_RELEASE_DIR) $(CHART_PA
577582
cd $(CHART_RELEASE_DIR) && $(HELM) dependency update
578583
$(HELM) package $(CHART_RELEASE_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR)
579584

585+
.PHONY: build-providers-chart
586+
build-providers-chart: $(HELM) $(RELEASE_DIR) $(PROVIDERS_CHART_RELEASE_DIR) $(CHART_PACKAGE_DIR)
587+
cp -rf $(PROVIDERS_CHART_DIR)/* $(PROVIDERS_CHART_RELEASE_DIR)
588+
cd $(PROVIDERS_CHART_RELEASE_DIR) && $(HELM) dependency update
589+
$(HELM) package $(PROVIDERS_CHART_RELEASE_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR)
590+
580591
.PHONY: release-chart
581592
release-chart: $(HELM) $(NOTES) build-chart verify-gen
582593
$(NOTES) --repository $(REPO) -workers=1 -add-kubernetes-version-support=false --from=$(PREVIOUS_TAG) > $(CHART_RELEASE_DIR)/RELEASE_NOTES.md
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Chartlock.lock
2+
charts/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: rancher-turtles-providers
3+
description: This chart installs the Rancher Turtles certified providers.
4+
home: https://turtles.docs.rancher.com/turtles/stable/en/overview/certified.html
5+
icon: https://raw.githubusercontent.com/rancher/turtles/main/logos/capi.svg
6+
version: 0.0.0
7+
appVersion: "0.0.0"
8+
keywords:
9+
- rancher
10+
- cluster-api
11+
- capi
12+
- provisioning
13+
- provider
14+
annotations:
15+
catalog.cattle.io/certified: rancher
16+
catalog.cattle.io/display-name: Rancher Turtles Certified Providers
17+
catalog.cattle.io/kube-version: '>= 1.23.0-0'
18+
catalog.cattle.io/namespace: rancher-turtles-system
19+
catalog.cattle.io/os: linux
20+
catalog.cattle.io/permits-os: linux
21+
catalog.cattle.io/rancher-version: '>= 2.11.0-1'
22+
catalog.cattle.io/release-name: rancher-turtles
23+
catalog.cattle.io/scope: management
24+
catalog.cattle.io/type: cluster-tool
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Rancher Turtles Providers Chart
2+
3+
This chart installs Rancher Turtles Certified CAPI providers using Helm.
4+
5+
Checkout the [documentation](https://turtles.docs.rancher.com/turtles/stable/en/overview/certified.html) for further information.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{{- if index .Values "providers" "addonFleet" "enabled" }}
2+
---
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
name: {{ index .Values "providers" "addonFleet" "namespace" }}
7+
---
8+
apiVersion: v1
9+
kind: ConfigMap
10+
metadata:
11+
name: fleet-addon-config
12+
namespace: {{ index .Values "providers" "addonFleet" "namespace" }}
13+
data:
14+
manifests: |-
15+
apiVersion: addons.cluster.x-k8s.io/v1alpha1
16+
kind: FleetAddonConfig
17+
metadata:
18+
name: fleet-addon-config
19+
spec:
20+
config:
21+
featureGates:
22+
configMap:
23+
ref:
24+
kind: ConfigMap
25+
apiVersion: v1
26+
name: rancher-config
27+
namespace: cattle-system
28+
experimentalOciStorage: true
29+
experimentalHelmOps: true
30+
clusterClass:
31+
patchResource: true
32+
setOwnerReferences: true
33+
cluster:
34+
agentNamespace: cattle-fleet-system
35+
applyClassGroup: true
36+
patchResource: true
37+
setOwnerReferences: true
38+
hostNetwork: true
39+
selector:
40+
matchLabels:
41+
cluster-api.cattle.io/rancher-auto-import: "true"
42+
matchExpressions:
43+
- key: cluster-api.cattle.io/disable-fleet-auto-import
44+
operator: DoesNotExist
45+
namespaceSelector:
46+
matchLabels:
47+
cluster-api.cattle.io/rancher-auto-import: "true"
48+
matchExpressions:
49+
- key: cluster-api.cattle.io/disable-fleet-auto-import
50+
operator: DoesNotExist
51+
---
52+
apiVersion: rbac.authorization.k8s.io/v1
53+
kind: ClusterRoleBinding
54+
metadata:
55+
name: cappf-controller-psa
56+
roleRef:
57+
apiGroup: rbac.authorization.k8s.io
58+
kind: ClusterRole
59+
name: fleet-controller-psa
60+
subjects:
61+
- kind: ServiceAccount
62+
name: caapf-controller-manager
63+
namespace: {{ .Values.providers.addonFleet.namespace }}
64+
---
65+
apiVersion: turtles-capi.cattle.io/v1alpha1
66+
kind: CAPIProvider
67+
metadata:
68+
name: fleet
69+
namespace: {{ index .Values "providers" "addonFleet" "namespace" }}
70+
spec:
71+
name: fleet
72+
type: addon
73+
{{- if index .Values "providers" "addonFleet" "version" }}
74+
version: {{ index .Values "providers" "addonFleet" "version" }}
75+
{{- end }}
76+
{{- if index .Values "providers" "addonFleet" "enableAutomaticUpdate" }}
77+
enableAutomaticUpdate: {{ index .Values "providers" "addonFleet" "enableAutomaticUpdate" }}
78+
{{- end }}
79+
{{- if index .Values "providers" "addonFleet" "features" }}
80+
features:
81+
machinePool: {{ index .Values "providers" "addonFleet" "features" "machinePool" }}
82+
clusterResourceSet: {{ index .Values "providers" "addonFleet" "features" "clusterResourceSet" }}
83+
clusterTopology: {{ index .Values "providers" "addonFleet" "features" "clusterTopology" }}
84+
{{- end }}
85+
{{- if index .Values "providers" "addonFleet" "variables" }}
86+
variables:
87+
{{- range $key, $val := .Values.providers.addonFleet.variables }}
88+
{{ $key }}: "{{ $val }}"
89+
{{- end }}
90+
{{- end }}
91+
{{- if or (index .Values "providers" "addonFleet" "credentials") }}
92+
credentials:
93+
name: {{ index .Values "providers" "addonFleet" "credentials" "name" }}
94+
namespace: {{ index .Values "providers" "addonFleet" "credentials" "namespace" }}
95+
{{- end }}
96+
{{- if or (index .Values "providers" "addonFleet" "configSecret") }}
97+
configSecret:
98+
name: {{ index .Values "providers" "addonFleet" "configSecret" "name" }}
99+
namespace: {{ index .Values "providers" "addonFleet" "configSecret" "namespace" }}
100+
{{- end }}
101+
{{- if index .Values "providers" "addonFleet" "fetchConfig" }}
102+
fetchConfig:
103+
{{- if index .Values "providers" "addonFleet" "fetchConfig" "url" }}
104+
url: {{ index .Values "providers" "addonFleet" "fetchConfig" "url" }}
105+
{{- end }}
106+
{{- if index .Values "providers" "addonFleet" "fetchConfig" "url" }}
107+
oci: {{ index .Values "providers" "addonFleet" "fetchConfig" "url" }}
108+
{{- end }}
109+
{{- end }}
110+
additionalManifests:
111+
name: fleet-addon-config
112+
namespace: {{ index .Values "providers" "addonFleet" "namespace" }}
113+
{{- end }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{{- if index .Values "providers" "bootstrapKubeadm" "enabled" }}
2+
---
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
name: {{ index .Values "providers" "bootstrapKubeadm" "namespace" }}
7+
---
8+
apiVersion: turtles-capi.cattle.io/v1alpha1
9+
kind: CAPIProvider
10+
metadata:
11+
name: kubeadm-bootstrap
12+
namespace: {{ index .Values "providers" "bootstrapKubeadm" "namespace" }}
13+
spec:
14+
name: kubeadm
15+
type: bootstrap
16+
{{- if index .Values "providers" "bootstrapKubeadm" "version" }}
17+
version: {{ index .Values "providers" "bootstrapKubeadm" "version" }}
18+
{{- end }}
19+
{{- if index .Values "providers" "bootstrapKubeadm" "enableAutomaticUpdate" }}
20+
enableAutomaticUpdate: {{ index .Values "providers" "bootstrapKubeadm" "enableAutomaticUpdate" }}
21+
{{- end }}
22+
{{- if index .Values "providers" "bootstrapKubeadm" "features" }}
23+
features:
24+
machinePool: {{ index .Values "providers" "bootstrapKubeadm" "features" "machinePool" }}
25+
clusterResourceSet: {{ index .Values "providers" "bootstrapKubeadm" "features" "clusterResourceSet" }}
26+
clusterTopology: {{ index .Values "providers" "bootstrapKubeadm" "features" "clusterTopology" }}
27+
{{- end }}
28+
{{- if index .Values "providers" "bootstrapKubeadm" "variables" }}
29+
variables:
30+
{{- range $key, $val := .Values.providers.bootstrapKubeadm.variables }}
31+
{{ $key }}: "{{ $val }}"
32+
{{- end }}
33+
{{- end }}
34+
{{- if or (index .Values "providers" "bootstrapKubeadm" "credentials") }}
35+
credentials:
36+
name: {{ index .Values "providers" "bootstrapKubeadm" "credentials" "name" }}
37+
namespace: {{ index .Values "providers" "bootstrapKubeadm" "credentials" "namespace" }}
38+
{{- end }}
39+
{{- if or (index .Values "providers" "bootstrapKubeadm" "configSecret") }}
40+
configSecret:
41+
name: {{ index .Values "providers" "bootstrapKubeadm" "configSecret" "name" }}
42+
namespace: {{ index .Values "providers" "bootstrapKubeadm" "configSecret" "namespace" }}
43+
{{- end }}
44+
{{- if index .Values "providers" "bootstrapKubeadm" "fetchConfig" }}
45+
fetchConfig:
46+
{{- if index .Values "providers" "bootstrapKubeadm" "fetchConfig" "url" }}
47+
url: {{ index .Values "providers" "bootstrapKubeadm" "fetchConfig" "url" }}
48+
{{- end }}
49+
{{- if index .Values "providers" "bootstrapKubeadm" "fetchConfig" "url" }}
50+
oci: {{ index .Values "providers" "bootstrapKubeadm" "fetchConfig" "url" }}
51+
{{- end }}
52+
{{- end }}
53+
{{- end }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{{- if index .Values "providers" "bootstrapRKE2" "enabled" }}
2+
---
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
name: {{ index .Values "providers" "bootstrapRKE2" "namespace" }}
7+
---
8+
apiVersion: turtles-capi.cattle.io/v1alpha1
9+
kind: CAPIProvider
10+
metadata:
11+
name: rke2-bootstrap
12+
namespace: {{ index .Values "providers" "bootstrapRKE2" "namespace" }}
13+
spec:
14+
name: rke2
15+
type: bootstrap
16+
{{- if index .Values "providers" "bootstrapRKE2" "version" }}
17+
version: {{ index .Values "providers" "bootstrapRKE2" "version" }}
18+
{{- end }}
19+
{{- if index .Values "providers" "bootstrapRKE2" "enableAutomaticUpdate" }}
20+
enableAutomaticUpdate: {{ index .Values "providers" "bootstrapRKE2" "enableAutomaticUpdate" }}
21+
{{- end }}
22+
{{- if index .Values "providers" "bootstrapRKE2" "features" }}
23+
features:
24+
machinePool: {{ index .Values "providers" "bootstrapRKE2" "features" "machinePool" }}
25+
clusterResourceSet: {{ index .Values "providers" "bootstrapRKE2" "features" "clusterResourceSet" }}
26+
clusterTopology: {{ index .Values "providers" "bootstrapRKE2" "features" "clusterTopology" }}
27+
{{- end }}
28+
{{- if index .Values "providers" "bootstrapRKE2" "variables" }}
29+
variables:
30+
{{- range $key, $val := .Values.providers.bootstrapRKE2.variables }}
31+
{{ $key }}: "{{ $val }}"
32+
{{- end }}
33+
{{- end }}
34+
{{- if or (index .Values "providers" "bootstrapRKE2" "credentials") }}
35+
credentials:
36+
name: {{ index .Values "providers" "bootstrapRKE2" "credentials" "name" }}
37+
namespace: {{ index .Values "providers" "bootstrapRKE2" "credentials" "namespace" }}
38+
{{- end }}
39+
{{- if or (index .Values "providers" "bootstrapRKE2" "configSecret") }}
40+
configSecret:
41+
name: {{ index .Values "providers" "bootstrapRKE2" "configSecret" "name" }}
42+
namespace: {{ index .Values "providers" "bootstrapRKE2" "configSecret" "namespace" }}
43+
{{- end }}
44+
{{- if index .Values "providers" "bootstrapRKE2" "fetchConfig" }}
45+
fetchConfig:
46+
{{- if index .Values "providers" "bootstrapRKE2" "fetchConfig" "url" }}
47+
url: {{ index .Values "providers" "bootstrapRKE2" "fetchConfig" "url" }}
48+
{{- end }}
49+
{{- if index .Values "providers" "bootstrapRKE2" "fetchConfig" "url" }}
50+
oci: {{ index .Values "providers" "bootstrapRKE2" "fetchConfig" "url" }}
51+
{{- end }}
52+
{{- end }}
53+
{{- end }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{{- if index .Values "providers" "controlplaneKubeadm" "enabled" }}
2+
---
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
name: {{ index .Values "providers" "controlplaneKubeadm" "namespace" }}
7+
---
8+
apiVersion: turtles-capi.cattle.io/v1alpha1
9+
kind: CAPIProvider
10+
metadata:
11+
name: kubeadm-control-plane
12+
namespace: {{ index .Values "providers" "controlplaneKubeadm" "namespace" }}
13+
spec:
14+
name: kubeadm
15+
type: controlPlane
16+
{{- if index .Values "providers" "controlplaneKubeadm" "version" }}
17+
version: {{ index .Values "providers" "controlplaneKubeadm" "version" }}
18+
{{- end }}
19+
{{- if index .Values "providers" "controlplaneKubeadm" "enableAutomaticUpdate" }}
20+
enableAutomaticUpdate: {{ index .Values "providers" "controlplaneKubeadm" "enableAutomaticUpdate" }}
21+
{{- end }}
22+
{{- if index .Values "providers" "controlplaneKubeadm" "features" }}
23+
features:
24+
machinePool: {{ index .Values "providers" "controlplaneKubeadm" "features" "machinePool" }}
25+
clusterResourceSet: {{ index .Values "providers" "controlplaneKubeadm" "features" "clusterResourceSet" }}
26+
clusterTopology: {{ index .Values "providers" "controlplaneKubeadm" "features" "clusterTopology" }}
27+
{{- end }}
28+
{{- if index .Values "providers" "controlplaneKubeadm" "variables" }}
29+
variables:
30+
{{- range $key, $val := .Values.providers.controlplaneKubeadm.variables }}
31+
{{ $key }}: "{{ $val }}"
32+
{{- end }}
33+
{{- end }}
34+
{{- if or (index .Values "providers" "controlplaneKubeadm" "credentials") }}
35+
credentials:
36+
name: {{ index .Values "providers" "controlplaneKubeadm" "credentials" "name" }}
37+
namespace: {{ index .Values "providers" "controlplaneKubeadm" "credentials" "namespace" }}
38+
{{- end }}
39+
{{- if or (index .Values "providers" "controlplaneKubeadm" "configSecret") }}
40+
configSecret:
41+
name: {{ index .Values "providers" "controlplaneKubeadm" "configSecret" "name" }}
42+
namespace: {{ index .Values "providers" "controlplaneKubeadm" "configSecret" "namespace" }}
43+
{{- end }}
44+
{{- if index .Values "providers" "controlplaneKubeadm" "fetchConfig" }}
45+
fetchConfig:
46+
{{- if index .Values "providers" "controlplaneKubeadm" "fetchConfig" "url" }}
47+
url: {{ index .Values "providers" "controlplaneKubeadm" "fetchConfig" "url" }}
48+
{{- end }}
49+
{{- if index .Values "providers" "controlplaneKubeadm" "fetchConfig" "url" }}
50+
oci: {{ index .Values "providers" "controlplaneKubeadm" "fetchConfig" "url" }}
51+
{{- end }}
52+
{{- end }}
53+
{{- end }}

0 commit comments

Comments
 (0)