Skip to content

Commit

Permalink
fix: update gcp capi provider to work with latest capi charts (#865)
Browse files Browse the repository at this point in the history
* fix: update gcp capi provider to work with latest capi charts

* bump gcp chart dependency

* allow helm to properly annotate certmanager SA

* update bootstrap

* bump helm/tf version
  • Loading branch information
floreks authored Nov 13, 2023
1 parent ade6b63 commit ae12190
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 23 deletions.
6 changes: 3 additions & 3 deletions bootstrap/helm/cluster-api-provider-gcp/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: cluster-api-provider-gcp
repository: https://pluralsh.github.io/capi-helm-charts
version: 0.1.4
digest: sha256:4a5070742fa6e34bf27a5ea29d590a5c86cdac50f56522b1b79671181907da82
generated: "2023-08-23T17:30:41.21781934+02:00"
version: 0.1.9
digest: sha256:276229b280a0de17bf5518f0a716d1d889100a7c52a9a49a651aa25d1d271363
generated: "2023-11-03T15:03:07.222737147+01:00"
10 changes: 5 additions & 5 deletions bootstrap/helm/cluster-api-provider-gcp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: v2
name: cluster-api-provider-gcp
description: A Helm chart for Kubernetes
type: application
version: 0.1.13
appVersion: v1.4.5
version: 0.2.0
appVersion: v1.4.7
dependencies:
- name: cluster-api-provider-gcp
version: 0.1.4
repository: https://pluralsh.github.io/capi-helm-charts
- name: cluster-api-provider-gcp
version: 0.1.9
repository: https://pluralsh.github.io/capi-helm-charts
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: CustomResourceDefinition
metadata:
name: gcpclusters.infrastructure.cluster.x-k8s.io
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" . }}-serving-cert'
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-serving-cert'
controller-gen.kubebuilder.io/version: v0.11.3
labels:
clusterctl.cluster.x-k8s.io: ""
Expand All @@ -18,7 +18,7 @@ spec:
clientConfig:
caBundle: Cg==
service:
name: '{{ include "cluster-api-provider-gcp.fullname" . }}-webhook-service'
name: '{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /convert
conversionReviewVersions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: CustomResourceDefinition
metadata:
name: gcpclustertemplates.infrastructure.cluster.x-k8s.io
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" . }}-serving-cert'
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-serving-cert'
controller-gen.kubebuilder.io/version: v0.11.3
labels:
clusterctl.cluster.x-k8s.io: ""
Expand All @@ -18,7 +18,7 @@ spec:
clientConfig:
caBundle: Cg==
service:
name: '{{ include "cluster-api-provider-gcp.fullname" . }}-webhook-service'
name: '{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /convert
conversionReviewVersions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: CustomResourceDefinition
metadata:
name: gcpmachines.infrastructure.cluster.x-k8s.io
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" . }}-serving-cert'
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-serving-cert'
controller-gen.kubebuilder.io/version: v0.11.3
labels:
clusterctl.cluster.x-k8s.io: ""
Expand All @@ -18,7 +18,7 @@ spec:
clientConfig:
caBundle: Cg==
service:
name: '{{ include "cluster-api-provider-gcp.fullname" . }}-webhook-service'
name: '{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /convert
conversionReviewVersions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: CustomResourceDefinition
metadata:
name: gcpmachinetemplates.infrastructure.cluster.x-k8s.io
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" . }}-serving-cert'
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-serving-cert'
controller-gen.kubebuilder.io/version: v0.11.3
labels:
clusterctl.cluster.x-k8s.io: ""
Expand All @@ -18,7 +18,7 @@ spec:
clientConfig:
caBundle: Cg==
service:
name: '{{ include "cluster-api-provider-gcp.fullname" . }}-webhook-service'
name: '{{ include "cluster-api-provider-gcp.fullname" (index .Subcharts "cluster-api-provider-gcp") }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /convert
conversionReviewVersions:
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/helm/cluster-api-provider-gcp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cluster-api-provider-gcp:
manager:
image:
repository: ghcr.io/pluralsh/cluster-api-gcp-controller
tag: v1.4.5
tag: v1.4.7
bootstrapMode: false

job:
Expand Down
7 changes: 4 additions & 3 deletions bootstrap/helm/cluster-api-provider-gcp/values.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cluster-api-provider-gcp:
serviceAccount:
annotations:
iam.gke.io/gcp-service-account: {{ importValue "Terraform" "capi_sa_workload_identity_email" }}
serviceAccounts:
manager:
annotations:
iam.gke.io/gcp-service-account: {{ importValue "Terraform" "capi_sa_workload_identity_email" }}
2 changes: 1 addition & 1 deletion bootstrap/terraform/gcp-bootstrap/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
description: Creates a GKE cluster and adds initial configuration
version: 0.2.25
version: 0.2.26
spec:
dependencies: []
providers:
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/terraform/gcp-bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ module "certmanager-workload-identity" {

module "capi-workload-identity" {
source = "terraform-google-modules/kubernetes-engine/google//modules/workload-identity"
name = "${var.cluster_name}-cluster-api-provider-gcp"
name = "${var.cluster_name}-capg"
namespace = var.namespace
project_id = var.gcp_project_id
use_existing_k8s_sa = true
annotate_k8s_sa = false
k8s_sa_name = "bootstrap-cluster-api-provider-gcp"
k8s_sa_name = "${var.namespace}-capg-manager"
roles = [
"roles/iam.serviceAccountUser",
"roles/iam.workloadIdentityUser",
Expand Down

0 comments on commit ae12190

Please sign in to comment.