GCP-431: feat: Add CNCC support for GCP WIF in HyperShift#7824
GCP-431: feat: Add CNCC support for GCP WIF in HyperShift#7824apahim wants to merge 1 commit intoopenshift:mainfrom
Conversation
- Add Network field to GCPServiceAccountsEmails API with CEL validation ensuring the GSA belongs to the hosting project. - Add cloud-network service account to iam-bindings.json with fine-grained CNCC permissions (compute.instances.get, compute.subnetworks.use, etc.). - Provision cloud-network-config-controller-creds secret in ReconcileCredentials when Network GSA email is configured. - Set GCP_CNCC_CREDENTIALS_FILE env var on CNO deployment for GCP platform so CNO wires GOOGLE_APPLICATION_CREDENTIALS on the CNCC container. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@apahim: This pull request references GCP-431 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThese changes add Cloud Network Config Controller (CNCC) credential support to HyperShift's GCP platform integration. A new Network service account field with validations is introduced to the GCP configuration, corresponding IAM permissions are configured, CNO deployment environment setup is updated, and credential management logic is extended to handle CNCC credentials. Changes
Sequence DiagramsequenceDiagram
participant HCP as GCP Controller
participant Spec as Platform Spec
participant Creds as Credential Manager
participant Secret as Kubernetes Secret
participant CNO as CNO Deployment
HCP->>Spec: Read Network service account email
alt Network service account configured
HCP->>Creds: Call ReconcileCredentials()
Creds->>Creds: Detect Network service account
Creds->>Secret: Create CNCCCredsSecret<br/>(cloud-network-config-controller-creds)
Secret-->>Creds: Secret created/reconciled
Creds-->>HCP: Credentials ready
HCP->>CNO: Set GCP_CNCC_CREDENTIALS_FILE<br/>environment variable
CNO->>Secret: Mount credentials
else No Network service account
HCP->>CNO: Standard CNO deployment
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@apahim: This pull request references GCP-431 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/hold |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: apahim The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@apahim: This pull request references GCP-431 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@apahim: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What this PR does / why we need it:
Adds CNCC (Cloud Network Config Controller) support for GCP Workload Identity Federation in HyperShift HCP mode. Currently HyperShift does not provision WIF credentials
for CNCC on GCP, so CNCC cannot authenticate to GCP APIs to manage egress IPs and subnets.
This PR:
Which issue(s) this PR fixes:
Fixes GCP-431
Special notes for your reviewer:
This PR is part of a cross-repo effort:
--token-audience=openshift to the cloud-token minter
The Network field is +optional (unlike the other GSA fields which are +required) since existing clusters won't have it set. The iam-bindings.json entry uses permissions
instead of roles because CNCC needs fine-grained permissions that don't map to a single predefined GCP role.
Checklist:
Summary by CodeRabbit
Release Notes