Skip to content
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

USHIFT-2444: Router enable/disable #3095

Merged
merged 15 commits into from
Apr 4, 2024

Conversation

pacevedom
Copy link
Contributor

Which issue(s) this PR addresses:

Closes #

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 1, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 1, 2024

@pacevedom: This pull request references USHIFT-2444 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.16.0" version, but no target version was set.

In response to this:

Which issue(s) this PR addresses:

Closes #

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.

@openshift-ci openshift-ci bot requested review from pliurh and pmtk March 1, 2024 16:56
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2024
@pacevedom
Copy link
Contributor Author

/hold
Found a race condition in the disable test.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2024
@pacevedom
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2024
@pacevedom
Copy link
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2024
@pacevedom pacevedom force-pushed the USHIFT-2444 branch 3 times, most recently from fc32f9e to 2ef56cd Compare March 5, 2024 13:17
@pacevedom
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 5, 2024
assets/components/openshift-router/deployment.yaml Outdated Show resolved Hide resolved
pkg/assets/handler.go Show resolved Hide resolved
pkg/assets/rbac.go Show resolved Hide resolved
pkg/config/ingress.go Outdated Show resolved Hide resolved
@@ -20,6 +20,8 @@ etcd:
ingress:
routeAdmissionPolicy:
namespaceOwnership: InterNamespaceAllowed
# Default router status, can be Enabled or Disabled.
status: Enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a comment for this field, but not the one above it? This is auto-generated, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #3148

pkg/config/config.go Outdated Show resolved Hide resolved
@pmtk
Copy link
Member

pmtk commented Mar 27, 2024

/retest

@@ -128,6 +128,23 @@ func startIngressController(ctx context.Context, cfg *config.Config, kubeconfigP
cm = "components/openshift-router/configmap.yaml"
servingKeypairSecret = "components/openshift-router/serving-certificate.yaml"
)

if cfg.Ingress.Status == config.StatusRemoved {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think a log would be useful here or already existing logs are enough?
I see there's log in the Handler but it doesn't say what it does (aka whether it's an applier or deleter).
There are some recorders in library-go but do they log to stdout or it's only k8s events?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Right before deleting you may see this:

Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.898763  241561 rbac.go:198] Handling rbac components/openshift-router/cluster-role-binding.yaml
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.911522  241561 recorder_logging.go:44] &Event{ObjectMeta:{dummy.17c30e08b64532ab  dummy    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},InvolvedObject:ObjectReference{Kind:Pod,Namespace:dummy,Name:dummy,UID:,APIVersion:v1,ResourceVersion:,FieldPath:,},Reason:ClusterRoleBindingDeleted,Message:Deleted ClusterRoleBinding.rbac.authorization.k8s.io/openshift-ingress-router,Source:EventSource{Component:,Host:,},FirstTimestamp:2024-04-04 12:48:33.911435947 +0200 CEST m=+24.091934968,LastTimestamp:2024-04-04 12:48:33.911435947 +0200 CEST m=+24.091934968,Count:1,Type:Normal,EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,Action:,Related:nil,ReportingController:,ReportingInstance:,}
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.912268  241561 rbac.go:198] Handling rbac components/openshift-router/cluster-role.yaml
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.916534  241561 recorder_logging.go:44] &Event{ObjectMeta:{dummy.17c30e08b691d022  dummy    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},InvolvedObject:ObjectReference{Kind:Pod,Namespace:dummy,Name:dummy,UID:,APIVersion:v1,ResourceVersion:,FieldPath:,},Reason:ClusterRoleDeleted,Message:Deleted ClusterRole.rbac.authorization.k8s.io/openshift-ingress-router,Source:EventSource{Component:,Host:,},FirstTimestamp:2024-04-04 12:48:33.916456994 +0200 CEST m=+24.096956014,LastTimestamp:2024-04-04 12:48:33.916456994 +0200 CEST m=+24.096956014,Count:1,Type:Normal,EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,Action:,Related:nil,ReportingController:,ReportingInstance:,}
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.916554  241561 rbac.go:198] Handling rbac components/openshift-router/cluster-role-aggregate-route.yaml
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.920654  241561 recorder_logging.go:44] &Event{ObjectMeta:{dummy.17c30e08b6d0e1e5  dummy    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},InvolvedObject:ObjectReference{Kind:Pod,Namespace:dummy,Name:dummy,UID:,APIVersion:v1,ResourceVersion:,FieldPath:,},Reason:ClusterRoleDeleted,Message:Deleted ClusterRole.rbac.authorization.k8s.io/aggregate-route,Source:EventSource{Component:,Host:,},FirstTimestamp:2024-04-04 12:48:33.920590309 +0200 CEST m=+24.101089338,LastTimestamp:2024-04-04 12:48:33.920590309 +0200 CEST m=+24.101089338,Count:1,Type:Normal,EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,Action:,Related:nil,ReportingController:,ReportingInstance:,}
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.920676  241561 rbac.go:198] Handling rbac components/openshift-router/cluster-role-system-router.yaml
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.924116  241561 recorder_logging.go:44] &Event{ObjectMeta:{dummy.17c30e08b705e295  dummy    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},InvolvedObject:ObjectReference{Kind:Pod,Namespace:dummy,Name:dummy,UID:,APIVersion:v1,ResourceVersion:,FieldPath:,},Reason:ClusterRoleDeleted,Message:Deleted ClusterRole.rbac.authorization.k8s.io/system:router,Source:EventSource{Component:,Host:,},FirstTimestamp:2024-04-04 12:48:33.924063893 +0200 CEST m=+24.104562915,LastTimestamp:2024-04-04 12:48:33.924063893 +0200 CEST m=+24.104562915,Count:1,Type:Normal,EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,Action:,Related:nil,ReportingController:,ReportingInstance:,}
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.924672  241561 core.go:144] Applying corev1 api components/openshift-router/namespace.yaml
Apr 04 12:48:33 microshift-dev microshift[241561]: infrastructure-services-manager I0404 12:48:33.929807  241561 recorder_logging.go:44] &Event{ObjectMeta:{dummy.17c30e08b75ca237  dummy    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},InvolvedObject:ObjectReference{Kind:Pod,Namespace:dummy,Name:dummy,UID:,APIVersion:v1,ResourceVersion:,FieldPath:,},Reason:NamespaceDeleted,Message:Deleted Namespace/openshift-ingress,Source:EventSource{Component:,Host:,},FirstTimestamp:2024-04-04 12:48:33.929749047 +0200 CEST m=+24.110248060,LastTimestamp:2024-04-04 12:48:33.929749047 +0200 CEST m=+24.110248060,Count:1,Type:Normal,EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,Action:,Related:nil,ReportingController:,ReportingInstance:,}

And then the whole process unravels and you may see logs from the deployment removal

Apr 04 12:48:43 microshift-dev microshift[241561]: kubelet I0404 12:48:43.885332  241561 kubelet.go:2445] "SyncLoop DELETE" source="api" pods=["openshift-ingress/router-default-6bbdd96d5-gcrjw"]
Apr 04 12:48:44 microshift-dev microshift[241561]: kube-controller-manager I0404 12:48:44.006699  241561 garbagecollector.go:688] "Deleting item" item="[discovery.k8s.io/v1/EndpointSlice, namespace: openshift-ingress, name: router-default-vkr4s, uid: f2d6e713-156d-4431-ac75-c33917be2636]" propagationPolicy="Background"
Apr 04 12:48:44 microshift-dev microshift[241561]: kube-controller-manager I0404 12:48:44.102360  241561 replica_set.go:676] "Finished syncing" kind="ReplicaSet" key="openshift-ingress/router-default-6bbdd96d5" duration="9.643µs"
Apr 04 12:49:14 microshift-dev microshift[241561]: kubelet I0404 12:49:14.493753  241561 kubelet.go:2461] "SyncLoop (PLEG): event for pod" pod="openshift-ingress/router-default-6bbdd96d5-gcrjw" event={"ID":"6f9354b8-441d-4769-8f83-d7656978163d","Type":"ContainerDied","Data":"f19347a7f94065fd2bb23d9beecc6909721021f00def8cd1dbbbe5aa97d6ee9f"}
Apr 04 12:49:15 microshift-dev microshift[241561]: kubelet I0404 12:49:15.565430  241561 kubelet.go:2445] "SyncLoop DELETE" source="api" pods=["openshift-ingress/router-default-6bbdd96d5-gcrjw"]
Apr 04 12:49:15 microshift-dev microshift[241561]: kubelet I0404 12:49:15.573106  241561 kubelet.go:2439] "SyncLoop REMOVE" source="api" pods=["openshift-ingress/router-default-6bbdd96d5-gcrjw"]

Would this be enough?

@pmtk
Copy link
Member

pmtk commented Apr 4, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 4, 2024
Copy link
Contributor

openshift-ci bot commented Apr 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pacevedom, pmtk

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented Apr 4, 2024

@pacevedom: 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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit e3543eb into openshift:main Apr 4, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants