feat(cloud): add GCP WIF credential support for OpenShift#275
Open
maxcao13 wants to merge 1 commit into
Open
Conversation
Introduce a cloud credential provider framework that creates and manages GCP WIF secrets. The operator builds the external_account credential JSON, creates the Secret via CreateOrUpdate with owner references, and wires volumes/mounts/env vars into the keda-operator Deployment. - New cloud package with provider interface and GCP WIF implementation - Platform-agnostic enablement gated on env vars, with Infrastructure CR fallback for project ID on OpenShift - Transform helpers for injecting volumes, mounts, and env vars - Unit and envtest integration tests covering both Subscription-patch and console-install env var configurations, plus negative cases - RBAC updates for Secret management Made-with: Cursor Signed-off-by: Max Cao <macao@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI Summary:
Introduce a cloud credential provider framework that creates and manages GCP WIF secrets. The operator builds the
external_accountcredential JSON, creates the Secret viaCreateOrUpdatewith owner references, and wires volumes/mounts/env vars into thekeda-operatorDeployment.Made-with: Cursor
My summary:
Allows the
keda-olm-operatorto be enabled with gcp wif integration for Red Hat OpenShift (currently not supported for general case Kubernetes with OLM). I tried to keep the code structure as generic for identity provider workflows, in the case we need to support Azure or AWS in the future.A [user story]/[testing workflow] is as follows:
User wants to scale their pods on OCP with KEDA OLM Operator based on their managed Prometheus instance in their GCP project: e.g. https://keda.sh/docs/2.19/scalers/prometheus/#google-managed-service-for-prometheus
keda-olm-operatorthrough OperatorHub, and fills in the console parameters accordingly (GCP project number, pool ID, SA email, provider id) (they can also edit theirSubscriptionobject without the console path withAUDIENCE+SERVICE_ACCOUNT_EMAIL):external_accountjson embedded secret with theWIF audience URI,STS token URL,SA impersonation URL, and the path to the projected token file.CLOUDSDK_CORE_PROJECTif it's set from theSubscriptionobject to pass to thekeda-operator. Thekeda-operatorcode uses this environment variable as the default GCP project ID to use when calling SDK code. If the env var is not set, it falls back to checking the project ID on the infrastructure object (only on OpenShift).keda-operatorpod, and passes inGOOGLE_APPLICATION_CREDENTIALSpointing to that mounted credential so that thekeda-operatorcan now obtain a short-term access token from theSTS token urlto impersonate the authorized service account from earlier.keda-operatorcan now query your GCP project for anything it needs now (and can access, in this case, it's the managed prometheus instance in GCP which only needs the monitoring.viewer role) that it has the temporary access token.Checklist