Skip to content

Commit 13424a0

Browse files
authored
feat(bootstrap): add capi aws provider chart (#832)
Signed-off-by: David van der Spek <[email protected]>
1 parent 4331a1f commit 13424a0

File tree

10 files changed

+208
-0
lines changed

10 files changed

+208
-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-provider-aws
3+
repository: https://pluralsh.github.io/capi-helm-charts
4+
version: 0.1.9
5+
digest: sha256:c1ef36b6f6c60b9bedbd8fdfef4858e1135bbe7ad49fe511e8adc1347e633063
6+
generated: "2023-09-01T13:53:22.234271+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-provider-aws
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.5
6+
appVersion: "v2.2.1"
7+
dependencies:
8+
- name: cluster-api-provider-aws
9+
version: 0.1.9
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 Provider AWS
2+
3+
A helm chart that deploys the Cluster API Provider for AWS
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 provider aws
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-provider-aws-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-provider-aws-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-provider-aws-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-provider-aws-plural.labels" -}}
37+
helm.sh/chart: {{ include "cluster-api-provider-aws-plural.chart" . }}
38+
{{ include "cluster-api-provider-aws-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-provider-aws-plural.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "cluster-api-provider-aws-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-provider-aws-plural.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "cluster-api-provider-aws-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-provider-aws-plural.fullname" . }}-wait-for-provider
6+
labels:
7+
{{- include "cluster-api-provider-aws-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-provider-aws.fullname" (index .Subcharts "cluster-api-provider-aws") }}-controller-manager", "-n", "{{ .Release.namespace }}"]
19+
restartPolicy: Never
20+
serviceAccountName: {{ include "cluster-api-provider-aws-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-provider-aws-plural.fullname" . }}-wait-for-provider
27+
labels:
28+
{{- include "cluster-api-provider-aws-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-provider-aws-plural.fullname" . }}-wait-for-provider
43+
labels:
44+
{{- include "cluster-api-provider-aws-plural.labels" . | nindent 4 }}
45+
annotations:
46+
{{- toYaml .Values.job.annotations | nindent 4 }}
47+
subjects:
48+
- kind: ServiceAccount
49+
name: {{ include "cluster-api-provider-aws-plural.fullname" . }}-wait-for-provider
50+
namespace: {{ .Release.namespace }}
51+
roleRef:
52+
kind: Role
53+
name: {{ include "cluster-api-provider-aws-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-provider-aws-plural.fullname" . }}-wait-for-provider
60+
labels:
61+
{{- include "cluster-api-provider-aws-plural.labels" . | nindent 4 }}
62+
annotations:
63+
{{- toYaml .Values.job.annotations | nindent 4 }}
64+
{{- end }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cluster-api-provider-aws:
2+
controllerManager:
3+
manager:
4+
image:
5+
repository: registry.k8s.io/cluster-api-aws/cluster-api-aws-controller
6+
tag: v2.2.1
7+
configVariables:
8+
awsControllerIamRole: ''
9+
capaEksAddRoles: true
10+
capaEksIam: true
11+
exprimental:
12+
externalResourceGc: true
13+
machinePool: true
14+
managerBootstrapCredentials:
15+
AWS_ACCESS_KEY_ID: ""
16+
AWS_SECRET_ACCESS_KEY: ""
17+
AWS_REGION: ""
18+
AWS_SESSION_TOKEN: ""
19+
bootstrapMode: false
20+
21+
job:
22+
enabled: true
23+
annotations:
24+
helm.sh/hook: post-install,post-upgrade
25+
helm.sh/hook-weight: "-5"
26+
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
27+
image:
28+
repository: bitnami/kubectl
29+
tag: 1.25.8
30+
pullPolicy: IfNotPresent
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cluster-api-provider-aws:
2+
configVariables:
3+
awsControllerIamRole: "arn:aws:iam::{{ .Project }}:role/{{ .Cluster }}-capa-controller"

0 commit comments

Comments
 (0)