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

cmd/openshift-install/create: One shot console access #5336

Merged

Conversation

wking
Copy link
Member

@wking wking commented Oct 27, 2021

The console may become optional (openshift/enhancements#922), so teach the installer to handle its absence gracefully.

We've waited on the console since way back in ff53523 (#806). Back then, install-complete timing was much less organized, and since e17ba3c (#1132) we've blocked on ClusterVersion going Available=True. So the current dependency chain is:

  1. Console route admission blocks console operator from going Available=True in its ClusterOperator.
  2. Console ClusterOperator blocks cluster-version operator from going Available=True in ClusterVersion.
  3. ClusterVersion blocks installer's waitForInitializedCluster.

So we no longer need to wait for the route to show up, and can fail fast if we get a clear IsNotFound. I'm keeping a bit of polling so we don't fail an install on a temporary network hiccup.

We don't want to drop the console check entirely, because when it is found, we want:

  • To continue to log that access pathway on install-complete.
  • To continue to append the router CA to the kubeconfig.

That latter point has been done since 4033577 (#1242). The motication in that commit message is not explicit, but the idea is to support folks who [naively run oc login with the kubeadmin kubeconfig][2] (despite that kubeconfig already having cluster-root access) when the console route's cert's CA happens to be something that the user's local trust store doesn't include by default.

consoleRouteTimeout := 10 * time.Minute
logrus.Infof("Waiting up to %v for the openshift-console route to be created...", consoleRouteTimeout)
consoleRouteTimeout := 2 * time.Minute
logrus.Infof("Checking to see if there is a route at %s/%s...", consoleNamespace, consoleRouteName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think that there is any value is checking for the console ClusterOperator to determine whether the installer should expect the console route?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would backstop "console operator flubbed their Available handling and claimed Available=True before the route was ready". I'd consider that flub a pretty big console bug though. I guess that means I think it's not the installer's job to backstop the console operator, and that if the console folks are concerned about this potential console failure mode, they could add coverage to their console-specific e2e suite or the OCP-scoped e2e suite to ensure it doesn't happen.

But I'm not too committed to that separation of concerns, so if you'd like a ClusterOperator check as an installer-side backstop, I can add that in.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a problem with the approach that you are taking, given that we are now stopping immediately when the console route is not found.

My only gripe is that we are then warning the user that there is no console in the cases where the console is not installed, but that is not relevant yet since we don't yet support not installing the console.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2021

@wking: PR needs rebase.

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.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2021
@wking
Copy link
Member Author

wking commented Dec 2, 2021

I can revive this if/when folks want it, just let me know. Until then, I'm not going to try to keep on top of rebases, so closing.

The console may become optional [1], so teach the installer to handle
its absence gracefully.

We've waited on the console since way back in ff53523 (add logs at
end of install for kubeadmin, consoleURL, 2018-12-06, openshift#806).  Back
then, install-complete timing was much less organized, and since
e17ba3c (cmd: wait for the cluster to be initialized, 2019-01-25, openshift#1132)
we've blocked on ClusterVersion going Available=True. So the current
dependency chain is:

1. Console route admission blocks console operator from going
   Available=True in its ClusterOperator.
2. Console ClusterOperator blocks cluster-version operator from
   going Available=True in ClusterVersion.
3. ClusterVersion blocks installer's waitForInitializedCluster.

So we no longer need to wait for the route to show up, and can fail
fast if we get a clear IsNotFound.  I'm keeping a bit of polling so we
don't fail an install on a temporary network hiccup.

We don't want to drop the console check entirely, because when it is
found, we want:

* To continue to log that access pathway on install-complete.
* To continue to append the router CA to the kubeconfig.

That latter point has been done since 4033577 (append router CA to
cluster CA in kubeconfig, 2019-02-12, openshift#1242).  The motivation in that
commit message is not explicit, but the idea is to support folks who
naively run 'oc login' with the kubeadmin kubeconfig [2] (despite that
kubeconfig already having cluster-root access) when the console
route's cert's CA happens to be something that the user's local trust
store doesn't include by default.

[1]: openshift/enhancements#922
[2]: openshift#1541 (comment)
@wking
Copy link
Member Author

wking commented Aug 1, 2022

Re-opened and rebased onto master with dca82df -> b05f71a now that openshift/console-operator#665 is failing on the lack of this change or something similar.

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 1, 2022
@patrickdillon
Copy link
Contributor

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 25, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2022
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 2 against base HEAD 48e67a7 and 8 for PR HEAD b05f71a in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 25, 2022

@wking: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-crc dca82df link false /test e2e-crc
ci/prow/e2e-aws-workers-rhel8 dca82df link false /test e2e-aws-workers-rhel8
ci/prow/e2e-aws-workers-rhel7 dca82df link false /test e2e-aws-workers-rhel7
ci/prow/e2e-metal-ipi-ovn-ipv6 dca82df link false /test e2e-metal-ipi-ovn-ipv6
ci/prow/openstack-manifests dca82df link true /test openstack-manifests
ci/prow/e2e-aws-upgrade dca82df link true /test e2e-aws-upgrade
ci/prow/e2e-ibmcloud b05f71a link false /test e2e-ibmcloud
ci/prow/e2e-libvirt b05f71a link false /test e2e-libvirt

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-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 2 against base HEAD a556a89 and 7 for PR HEAD b05f71a in total

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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants