Skip to content

Commit 0ff9bed

Browse files
authored
feat(bootstrap): add main capi charts (#824)
Signed-off-by: David van der Spek <[email protected]>
1 parent 58c1e2d commit 0ff9bed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+839
-0
lines changed
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: cluster-api-bootstrap
3+
repository: https://pluralsh.github.io/capi-helm-charts
4+
version: 0.1.6
5+
digest: sha256:0f68504758f18d0df554d395770f5f4646ffcbe66a19c767de9d3f73d0dfbdca
6+
generated: "2023-09-05T13:06:05.337568+02:00"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v2
2+
name: cluster-api-bootstrap
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.3
6+
appVersion: "v1.5.1"
7+
dependencies:
8+
- name: cluster-api-bootstrap
9+
version: 0.1.6
10+
repository: https://pluralsh.github.io/capi-helm-charts
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Cluster API Bootstrap
2+
3+
A helm chart that deploys the Cluster API Kubeadm bootstrap provider
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: plural.sh/v1alpha1
2+
kind: Dependencies
3+
metadata:
4+
application: true
5+
description: installs the cluster-api kubeadm bootstrap provider
6+
spec:
7+
dependencies: []
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "cluster-api-bootstrap-plural.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "cluster-api-bootstrap-plural.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "cluster-api-bootstrap-plural.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "cluster-api-bootstrap-plural.labels" -}}
37+
helm.sh/chart: {{ include "cluster-api-bootstrap-plural.chart" . }}
38+
{{ include "cluster-api-bootstrap-plural.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "cluster-api-bootstrap-plural.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "cluster-api-bootstrap-plural.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "cluster-api-bootstrap-plural.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "cluster-api-bootstrap-plural.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{{- if .Values.job.enabled -}}
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: {{ include "cluster-api-bootstrap-plural.fullname" . }}-wait-for-provider
6+
labels:
7+
{{- include "cluster-api-bootstrap-plural.labels" . | nindent 4 }}
8+
annotations:
9+
{{- toYaml .Values.job.annotations | nindent 4 }}
10+
spec:
11+
template:
12+
spec:
13+
containers:
14+
- name: wait-for-provider
15+
image: {{ .Values.job.image.repository }}:{{ .Values.job.image.tag }}
16+
imagePullPolicy: {{ .Values.job.image.pullPolicy }}
17+
command: ["kubectl"]
18+
args: ["wait", "--for=condition=Available", "--timeout=600s", "deployment/{{ include "cluster-api-bootstrap.fullname" (index .Subcharts "cluster-api-bootstrap") }}-controller-manager", "-n", "{{ .Release.namespace }}"]
19+
restartPolicy: Never
20+
serviceAccountName: {{ include "cluster-api-bootstrap-plural.fullname" . }}-wait-for-provider
21+
backoffLimit: 4
22+
---
23+
kind: Role
24+
apiVersion: rbac.authorization.k8s.io/v1
25+
metadata:
26+
name: {{ include "cluster-api-bootstrap-plural.fullname" . }}-wait-for-provider
27+
labels:
28+
{{- include "cluster-api-bootstrap-plural.labels" . | nindent 4 }}
29+
annotations:
30+
{{- toYaml .Values.job.annotations | nindent 4 }}
31+
rules:
32+
- apiGroups: [""]
33+
resources: ["pods"]
34+
verbs: ["get", "list", "watch"]
35+
- apiGroups: ["apps"]
36+
resources: ["deployments"]
37+
verbs: ["get", "list", "watch"]
38+
---
39+
kind: RoleBinding
40+
apiVersion: rbac.authorization.k8s.io/v1
41+
metadata:
42+
name: {{ include "cluster-api-bootstrap-plural.fullname" . }}-wait-for-provider
43+
labels:
44+
{{- include "cluster-api-bootstrap-plural.labels" . | nindent 4 }}
45+
annotations:
46+
{{- toYaml .Values.job.annotations | nindent 4 }}
47+
subjects:
48+
- kind: ServiceAccount
49+
name: {{ include "cluster-api-bootstrap-plural.fullname" . }}-wait-for-provider
50+
namespace: {{ .Release.namespace }}
51+
roleRef:
52+
kind: Role
53+
name: {{ include "cluster-api-bootstrap-plural.fullname" . }}-wait-for-provider
54+
apiGroup: rbac.authorization.k8s.io
55+
---
56+
apiVersion: v1
57+
kind: ServiceAccount
58+
metadata:
59+
name: {{ include "cluster-api-bootstrap-plural.fullname" . }}-wait-for-provider
60+
labels:
61+
{{- include "cluster-api-bootstrap-plural.labels" . | nindent 4 }}
62+
annotations:
63+
{{- toYaml .Values.job.annotations | nindent 4 }}
64+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cluster-api-bootstrap:
2+
configVariables:
3+
exprimental:
4+
machinePool: true
5+
6+
job:
7+
enabled: true
8+
annotations:
9+
helm.sh/hook: post-install,post-upgrade
10+
helm.sh/hook-weight: "-5"
11+
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
12+
image:
13+
repository: bitnami/kubectl
14+
tag: 1.25.8
15+
pullPolicy: IfNotPresent
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)