Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Workload Identity federation support for GKE #177

Open
simonebruzzechesse opened this issue Nov 5, 2024 · 1 comment
Open

Add Workload Identity federation support for GKE #177

simonebruzzechesse opened this issue Nov 5, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@simonebruzzechesse
Copy link

Is your feature request related to a problem? Please describe.
Best practice for accessing Google APIs from workloads running in GKE cluster is to leverage Workload Identity Federation and link kubernetes service account with GCP service account with permissions to operate on Cloud products (such as pubsub).

Describe the solution you'd like
Documentation is available at the following link. While it should still be doable to grant permissions to GCP resources to k8s service account following this it would be great to support linking k8s service account via annotations as per the following snippet since there are limitations with IAM WIF principal described in this page.

apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    iam.gke.io/gcp-service-account: [email protected]
  name: bindplane
  namespace: bindplane

I tried the following configuration on service-account.yml:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "bindplane.fullname" . }}
  namespace: {{ .Release.Namespace }}
  {{- if .Values.wif.iam_service_account }}
  annotations:
    iam.gke.io/gcp-service-account: {{ .Values.wif.iam_service_account }}
  {{- end }}
  labels:
    app.kubernetes.io/name: {{ include "bindplane.name" . }}
    app.kubernetes.io/stack: bindplane
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}

and updated values.yaml by adding the following section:

# Workload Identity
# https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#kubernetes-sa-to-iam
wif:
  iam_service_account: ""

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@jsirianni jsirianni self-assigned this Nov 5, 2024
@jsirianni jsirianni added the enhancement New feature or request label Nov 5, 2024
@jsirianni
Copy link
Member

Thanks for opening this issue. I have used worked-load identity in the past, the change will be straight forward. I will get this prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants