IR-350: add tls security profile configuration for the image registry operator#8011
IR-350: add tls security profile configuration for the image registry operator#8011ricardomaraschini wants to merge 2 commits intoopenshift:mainfrom
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (15)
📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis pull request adds a ConfigMap named Sequence Diagram(s)sequenceDiagram
participant HCP as HostedControlPlane controller
participant Adapter as adaptControllerConfig
participant CM as ConfigMap (image-registry-controller-config)
participant K8s as Kubernetes API (Deployment/Pod)
participant Operator as cluster-image-registry-operator
HCP->>Adapter: provide WorkloadContext (HCP.Spec.Configuration)
Adapter->>CM: create/modify Data["config.yaml"] (servingInfo, TLS settings)
Adapter-->>HCP: return success/error
CM->>K8s: stored via manifests (applied)
K8s->>K8s: mount ConfigMap into Pod volume
K8s->>Operator: start process with args --config=/var/run/configmaps/.../config.yaml --files=...
Operator->>CM: read config file at startup
Operator-->>K8s: operate using provided servingInfo/TLS settings
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
Status, support, documentation and community
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
configure the cluster-image-registry-operator to use the tls security profile settings from the hostedcontrolplane resource. this ensures the operator's serving endpoint uses ciphers and minimum tls version that match the cluster's security requirements. implementation: - add configmap adapter to generate genericcontrollerconfig with tls settings derived from hcp.spec.configuration.tlssecurityprofile - mount the config via --config flag on the operator deployment - reuse existing config.ciphersuites() and config.mintlsversion() helper functions for consistency with other control plane components
we have changed the image registry deployment and added a new config map to the equation. we need to regenerate the testdata to incorporate these changes.
6a2b484 to
ecb7bea
Compare
|
@ricardomaraschini: 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. |
|
/retest |
|
@ricardomaraschini: This pull request references IR-350 which is a valid jira issue. 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. |
control-plane-operator/controllers/hostedcontrolplane/v2/registryoperator/configmap.go
Show resolved
Hide resolved
| return fmt.Errorf("failed to json unmarshal config: %w", err) | ||
| } | ||
|
|
||
| asMap["apiVersion"] = configv1.GroupVersion.String() |
There was a problem hiding this comment.
Oh, configv1.GenericControllerConfig does not define metav1.TypeMeta field. Compared to GenericOperatorConfig.
There was a problem hiding this comment.
You are right. I guess we could simply not set it out then.
There was a problem hiding this comment.
It needs to be set so the CVO knows which kind it is. Otherwise, it's a blind guess. Also, no field to validate the kind and version against.
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox, ricardomaraschini The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Configure the
cluster-image-registry-operatorto use the TLS security profile settings from the HostedCluster resource. This ensures the operator's serving endpoint uses ciphers and minimum TLS version that match the cluster's security requirements.Implementation:
configv1.GenericControllerConfigwith TLS settings derived fromhcp.spec.configuration.apiServer.tlsSecurityProfile.--configflag on the operator deployment.config.CipherSuites()andconfig.minTLSVersion()helper functions for consistency with other control plane components.Special notes for your reviewer:
This PR is expected to fail as it depends on openshift/cluster-image-registry-operator#1297 being merged.
Checklist:
Summary by CodeRabbit