CORS-4403: Add enhancement for GCP customer-managed KMS encryption#1975
CORS-4403: Add enhancement for GCP customer-managed KMS encryption#1975barbacbd wants to merge 1 commit into
Conversation
|
@barbacbd: This pull request references CORS-4403 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 "5.0.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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
| // used to store bootstrap ignition configs. When omitted, the bucket uses | ||
| // Google-managed encryption. | ||
| // +optional | ||
| IgnitionStorageEncryptionKey *StorageEncryptionKeyReference `json:"ignitionStorageEncryptionKey,omitempty"` |
There was a problem hiding this comment.
ignitionStorageEncryptionKey.kmsKey has key twice in quick succession, maybe drop the first key?
| // the image registry GCS bucket. This is consumed by the cluster-image-registry-operator | ||
| // when creating the registry storage bucket. | ||
| // +optional | ||
| RegistryStorageKMSKey *GCPKMSKeyReference `json:"registryStorageKMSKey,omitempty"` |
There was a problem hiding this comment.
NIt: Recommendation now is to avoid the pointer and use omitzero instead of omitempty
| // the image registry GCS bucket. This is consumed by the cluster-image-registry-operator | ||
| // when creating the registry storage bucket. | ||
| // +optional | ||
| RegistryStorageKMSKey *GCPKMSKeyReference `json:"registryStorageKMSKey,omitempty"` |
There was a problem hiding this comment.
Might want to make this more structured in case we have additional stuff to add later
registry:
storage:
kmsKey:
name: ...
|
|
||
| #### Standalone Clusters | ||
|
|
||
| This enhancement is fully applicable to standalone IPI (Installer Provisioned Infrastructure) clusters on GCP. It does not apply to UPI (User Provisioned Infrastructure) as users manage their own storage infrastructure. |
There was a problem hiding this comment.
For a UPI cluster, how does the platform status get populated so that the image registry operator can create the bucket?
There was a problem hiding this comment.
Or now, what is the expectation for the image registry, do users configure that when they generate the manifests?
There was a problem hiding this comment.
I don't think so. The manifest should be generated by the installer still. Even if this is run as upi, the installer is still executed and those manifests would be generated based on your input in the install-config.
| 2. **Validation Logic**: The `validatePlatformKMSKeys` function in `pkg/asset/installconfig/gcp/validation.go` | ||
| 3. **Default Handling**: The pattern in `pkg/types/gcp/defaults/machinepool.go` for defaulting ProjectID | ||
|
|
||
| This provides consistency across the API and reduces implementation complexity. |
There was a problem hiding this comment.
What happens if a new field is added to KMSKeyReference, you'd expect that to be supported in all three usage locations?
There was a problem hiding this comment.
not necessarily. The fields are validated individually so if a new value is added they don't have to support it but ideally any new field should apply to all of them.
| 1. **Should we support cross-project KMS keys in the initial implementation?** | ||
| - This would allow using keys from a central "security" project | ||
| - Requires additional IAM configuration and validation complexity | ||
| - Can be deferred to a future enhancement |
There was a problem hiding this comment.
How would you expect the API to evolve to support this in the future?
| 4. **How should we handle the cluster-image-registry-operator changes?** | ||
| - Option A: Hold this enhancement until operator PR is merged | ||
| - Option B: Merge installer changes first, operator support comes in a follow-up release | ||
| - Proposed: Coordinate with operator team, merge in the same release cycle |
There was a problem hiding this comment.
Can the installer team propose the changes to the operator as part of their work? You'd need commitment from the registry team to review
Is anyone from registry reviewing this EP?
|
|
||
| **Downgrading TO a release without this feature:** | ||
| - Cluster continues to function normally | ||
| - Buckets remain encrypted with customer-managed keys |
There was a problem hiding this comment.
You don't need to know anything about the encryption to read from the bucket right? So registry is not impacted?
There was a problem hiding this comment.
that should be true. The service account only needs permission to read so that is more than likely a documentation update (if it doesn't already exist) to ensure the user has this permission when using this feature.
Response to Review CommentsThank you @JoelSpeed for the thorough review! I've addressed your feedback and made some important discoveries during analysis. Here's the status of each comment: ✅ Addressed in Commit b96e1e99Comments 1, 3, 4, 5: API structure, naming, and omitzero
New structure: platform:
gcp:
ignition:
storage:
encryptionKey:
kmsKey:
name: ignition-key
keyRing: openshift-keyring
location: us-east1
registry:
storage:
encryptionKey:
kmsKey:
name: registry-key✅ Resolved by Technical AnalysisComment 2: Day-2 cluster access to these values
Comment 8: Operator changes and registry team coordination
Comment 9: Encryption knowledge for reading
💬 Discussion NeededComment 6: Type reuse concerns with KMSKeyReference
Comment 7: Cross-project KMS keys - API evolution
I've documented detailed responses in my analysis files. Happy to discuss Comments 6 and 7 further or adjust the approach based on your feedback. |
4c6818c to
98ee7ba
Compare
| reviewers: | ||
| - "@rochacbruno" | ||
| - "@patrickdillon" | ||
| approvers: |
There was a problem hiding this comment.
Missing api-approvers metadata, should be a linter flagging that
|
|
||
| 2. **No New Kubernetes API Changes Needed**: The ImageRegistry CR (`configs.imageregistry.operator.openshift.io/cluster`) already has the necessary field. We do not need to add fields to the Infrastructure CR or create new CRDs. | ||
|
|
||
| 3. **No Feature Gates Required**: This is install-time configuration (not runtime cluster features), so feature gates are not appropriate. Install-config fields are naturally opt-in (omit = default behavior). |
There was a problem hiding this comment.
What does your flow look like for testing this feature and making sure that it is GA ready before merge?
We have plenty of install time features that are tested first in tech preview before being promoted to GA, so I'd challenge "feature gates are not appropriate"
There was a problem hiding this comment.
We will have to create a new step in the CI that will test this feature. This should ensure it is "green" or good to go before merging.
|
|
||
| #### Standalone Clusters | ||
|
|
||
| This enhancement is fully applicable to standalone IPI (Installer Provisioned Infrastructure) clusters on GCP. It does not apply to UPI (User Provisioned Infrastructure) as users manage their own storage infrastructure. |
There was a problem hiding this comment.
Or now, what is the expectation for the image registry, do users configure that when they generate the manifests?
98ee7ba to
0723409
Compare
Proposes adding support for customer-managed Cloud KMS keys to encrypt GCS buckets used by the OpenShift installer on GCP. Covers bootstrap ignition bucket and image registry bucket encryption for compliance and regulatory requirements. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Reviewed by: @barbacbd Update GCP KMS enhancement based on analysis findings Key updates: - Remove Infrastructure CR API changes (use existing ImageRegistry CR) - Remove feature gate references (not needed for install-time config) - Document that registry operator already supports KMS since 2019 - Update IAM permissions to scope to specific service accounts only - Simplify to installer-only changes (no cross-repo coordination) - Update graduation criteria to ship as GA (no Tech Preview needed) - Add Key Findings section summarizing discoveries Analysis documented in CORS-4391 revealed: - ImageRegistry CR already has spec.storage.gcs.keyID field (2019) - cluster-image-registry-operator has full KMS support (commit 8c08cc6805) - No new Kubernetes APIs needed - Feature is naturally opt-in via install-config - Similar to AWS/Azure encryption features (all shipped as GA) Scope reduced by ~50%: no openshift/api changes, no operator changes, no feature gates, no cross-repository coordination overhead. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Use nested API structure for KMS configuration Addresses PR review feedback from @JoelSpeed: - Use nested structure: ignition.storage.encryptionKey instead of flat - Use nested structure: registry.storage.encryptionKey instead of flat - Apply omitzero instead of pointers with omitempty - Provides better extensibility for future fields - Clear separation of ignition vs registry configuration This resolves comments about: - API structure (line 98, line 251) - Naming (line 200 - 'key' duplication removed) - Pointer usage (line 251 - now using omitzero) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0723409 to
e5f818c
Compare
|
@barbacbd: all tests passed! 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. |
Proposes adding support for customer-managed Cloud KMS keys
to encrypt GCS buckets used by the OpenShift installer on GCP.
Covers bootstrap ignition bucket and image registry bucket
encryption for compliance and regulatory requirements.
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
Reviewed by: @barbacbd