-
Notifications
You must be signed in to change notification settings - Fork 319
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
OCPBUGS-42579: Add network policies for konnectivity server and ignition server proxy #4840
Conversation
@davidvossel: This pull request references Jira Issue OCPBUGS-42579, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In 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 APPROVED This pull-request has been approved by: davidvossel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/jira refresh |
@davidvossel: This pull request references Jira Issue OCPBUGS-42579, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira ([email protected]), skipping review request. In 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey David, thanks for the PR. It's there any chance to add a unitTest around the netpol reconciliation to identify the policy is placed properly when is in or out of the KAS?
@@ -151,6 +151,13 @@ func (r *HostedClusterReconciler) reconcileNetworkPolicies(ctx context.Context, | |||
}); err != nil { | |||
return fmt.Errorf("failed to reconcile ignition nodeport network policy: %w", err) | |||
} | |||
// Reconcile nodeport-ignition-procy Network Policy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/nodeport-ignition-procy/nodeport-ignition-proxy/
|
||
// Reconcile nodeport-konnectivity Network Policy when konnectivity is hosted in the kas pod | ||
policy = networkpolicy.NodePortKonnectivityKASNetworkPolicy(controlPlaneNamespaceName) | ||
if _, err := createOrUpdate(ctx, r.Client, policy, func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will create the policy always, we need to identify where is konnectivity and then place the netpol accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to identify where is konnectivity and then place the netpol accordingly.
how? the hypershift operator isn't responsible for laying down the konnectivity agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right. I had an eye in the security people that maybe they will concern to have that gate opened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's there any chance to add a unitTest around the netpol reconciliation to identify the policy is placed properly when is in or out of the KAS?
i don't believe the hypershift operator has knowledge of where the konnectivity server is placed.
|
||
// Reconcile nodeport-konnectivity Network Policy when konnectivity is hosted in the kas pod | ||
policy = networkpolicy.NodePortKonnectivityKASNetworkPolicy(controlPlaneNamespaceName) | ||
if _, err := createOrUpdate(ctx, r.Client, policy, func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to identify where is konnectivity and then place the netpol accordingly.
how? the hypershift operator isn't responsible for laying down the konnectivity agent.
Signed-off-by: David Vossel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far. This also will cover this other bug OCPBUGS-39317. I will mark it as dup and remark it will be solved with this PR.
|
||
// Reconcile nodeport-konnectivity Network Policy when konnectivity is hosted in the kas pod | ||
policy = networkpolicy.NodePortKonnectivityKASNetworkPolicy(controlPlaneNamespaceName) | ||
if _, err := createOrUpdate(ctx, r.Client, policy, func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right. I had an eye in the security people that maybe they will concern to have that gate opened.
/lgtm |
@davidvossel: all tests passed! Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@davidvossel: Jira Issue OCPBUGS-42579: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-42579 has been moved to the MODIFIED state. In 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. |
[ART PR BUILD NOTIFIER] Distgit: hypershift |
/cherry-pick release-4.17 release-4.16 release-4.15 release-4.14 |
@davidvossel: new pull request created: #4865 In 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 kubernetes-sigs/prow repository. |
This fixes two issues that impact HCP with the NodePort publishing strategy.
This is resolved by adding a new network policy that allows access to the konnectivity server when it is hosted within the kas pod (which is how this is currently deployed in 4.17)