Skip to content

Commit a30cdc9

Browse files
authored
feat(bootstrap): add capz chart (#825)
Signed-off-by: David van der Spek <[email protected]>
1 parent 0ff9bed commit a30cdc9

24 files changed

+5649
-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-azure
3+
repository: https://pluralsh.github.io/capi-helm-charts
4+
version: 0.1.8
5+
digest: sha256:a121b432405288d78644e268fab20ac4369a2bfd13084094b9de9e0f65c05ad1
6+
generated: "2023-08-24T17:11:19.117169+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-azure
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.11
6+
appVersion: v1.10.2
7+
dependencies:
8+
- name: cluster-api-provider-azure
9+
version: 0.1.8
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 Azure
2+
3+
A helm chart that deploys the Cluster API Provider for Azure
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 azure
6+
spec:
7+
dependencies: []
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
AZURE_VERSION=v1.9.14
2+
3+
azure:
4+
# Clean current CRDs
5+
rm -rf ../templates/*-crd.yaml
6+
mkdir tmp
7+
wget https://github.com/pluralsh/cluster-api-provider-azure/releases/download/${AZURE_VERSION}/infrastructure-components.yaml
8+
# This rewrites the data to stringData in the secret
9+
yq 'select(.kind == "Secret") | .stringData += .data | del(.data)' infrastructure-components.yaml > tmp.yaml
10+
# This removes the Secret from the yaml
11+
yq 'del( select(.kind == "Secret"))' infrastructure-components.yaml > tmp2.yaml
12+
13+
# This combines the yaml files back together
14+
yq eval-all tmp.yaml tmp2.yaml > infrastructure-components.yaml
15+
16+
cat infrastructure-components.yaml | helmify -generate-defaults -image-pull-secrets tmp/cluster-api-provider-azure
17+
rm infrastructure-components.yaml tmp.yaml tmp2.yaml
18+
yq -i ".appVersion=\"${AZURE_VERSION}\"" ../Chart.yaml
19+
20+
# This removes the Azure credentials from the values.yaml since it is being set by managerBootstrapCredentials.credentials instead
21+
yq -i "del(.configVariables.azureClientIdB64) | del(.configVariables.azureClientSecretB64) | del(.configVariables.azureSubscriptionIdB64) | del(.configVariables.azureTenantIdB64)" tmp/cluster-api-provider-azure/values.yaml
22+
23+
mv tmp/cluster-api-provider-azure/templates/*-crd.yaml ../templates/
24+
rm -rf tmp/
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-azure-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-azure-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-azure-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-azure-plural.labels" -}}
37+
helm.sh/chart: {{ include "cluster-api-provider-azure-plural.chart" . }}
38+
{{ include "cluster-api-provider-azure-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-azure-plural.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "cluster-api-provider-azure-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-azure-plural.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "cluster-api-provider-azure-plural.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

0 commit comments

Comments
 (0)