Skip to content

Commit 8c5ab6e

Browse files
authored
feat(bootstrap): add capi gcp provider chart (#833)
Signed-off-by: David van der Spek <[email protected]>
1 parent 26e2d1f commit 8c5ab6e

18 files changed

+2750
-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-gcp
3+
repository: https://pluralsh.github.io/capi-helm-charts
4+
version: 0.1.4
5+
digest: sha256:4a5070742fa6e34bf27a5ea29d590a5c86cdac50f56522b1b79671181907da82
6+
generated: "2023-08-23T17:30:41.21781934+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-gcp
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.12
6+
appVersion: v1.4.5
7+
dependencies:
8+
- name: cluster-api-provider-gcp
9+
version: 0.1.4
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 GCP
2+
3+
A helm chart that deploys the Cluster API Provider for GCP
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 gcp
6+
spec:
7+
dependencies: []
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
GCP_VERSION=v1.4.5
2+
3+
gcp:
4+
# Clean current CRDs
5+
rm -rf ../templates/*-crd.yaml tmp/ *.yaml
6+
mkdir tmp
7+
wget https://github.com/pluralsh/cluster-api-provider-gcp/releases/download/${GCP_VERSION}/infrastructure-components.yaml
8+
# This rewrites the data to stringData in the secret
9+
yq 'select(.kind == "Secret") | .data."credentials.json" = ""' 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-gcp
17+
rm infrastructure-components.yaml tmp.yaml tmp2.yaml
18+
yq -i ".appVersion=\"${GCP_VERSION}\"" ../Chart.yaml
19+
20+
mv tmp/cluster-api-provider-gcp/templates/*-crd.yaml ../templates/
21+
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-gcp-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-gcp-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-gcp-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-gcp-plural.labels" -}}
37+
helm.sh/chart: {{ include "cluster-api-provider-gcp-plural.chart" . }}
38+
{{ include "cluster-api-provider-gcp-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-gcp-plural.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "cluster-api-provider-gcp-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-gcp-plural.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "cluster-api-provider-gcp-plural.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

0 commit comments

Comments
 (0)