-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement ocp postprocess hostname rename #82
Implement ocp postprocess hostname rename #82
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mresvanis The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c29dca2
to
54e02b1
Compare
/test e2e-aws-ovn-single-node-recert-parallel e2e-aws-ovn-single-node-recert-serial baremetalds-sno-recert-cluster-rename |
/test e2e-aws-ovn-single-node-recert-parallel |
f6a617c
to
8dbd414
Compare
.replace(original_hostname, hostname); | ||
tokio::spawn(async move { | ||
async move { | ||
fs::rename(original_path, new_path)?; |
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 should have a function similar to commit_file so it can be avoided during a dry run
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.
Of course, I completely neglected the dry run option. I'll try to update this 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.
I didn't add a function like commit_rename
because we only need it here, but I can do that if you think it makes sense for the long term. WDYT?
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 prefer a separate function just because I don't want to concern rename code with the concept of dry run
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.
But I'll just do it separately later as part of a refactor of all the rename code, too much repetition. I'm afraid to touch it right now because we have no IBI/IBU 0-rollout tests, but once we'll do I'll be able to make changes with confidence
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.
Got it, this makes sense, I'm working on adding the recert hostname change 0-rollout CI job (not IBI/IBU at this point, just recert, but I think until we have an IBI/IBU e2e job, we can already increase our confidence starting with this recert specific job).
cbd5714
to
8dac639
Compare
This change ensures that unnecessary and time-consuming OCP control-plane component rollouts are skipped. The latter are triggered by the node's hostname change, which occurs when applying an IBU seed image onto the target SNO. Specifically, the changes are: - add a new recert configuration argument of type string, i.e. --hostname with which the new hostname is provided - add a hostname_rename mod, which implements the following changes: - replace all occurrences of the previous (seed node) hostname in etcd - replace all occurrences of the previous (seed node) hostname in the filesystem Signed-off-by: Michail Resvanis <[email protected]>
8dac639
to
792ed73
Compare
/test ? |
@omertuc: The following commands are available to trigger required jobs:
Use
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/test-infra repository. |
/test baremetalds-sno-recert-cluster-rename |
@mresvanis: The following test failed, say
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. |
This failure is typical, ignore |
This change leverages recert's latest OCP post-process hostname feature, which makes OCP's control-plane cluster operators (i.e. etcd, kube-apiserver, kube-controller-manager, kube-scheduler) happy, so that the latter won't trigger additional revisions. Thus reducing the time OCP needs to stabilize after recert. For more details please check here: - rh-ecosystem-edge/recert#82 Signed-off-by: Michail Resvanis <[email protected]>
This change leverages recert's latest OCP post-process hostname feature, which makes OCP's control-plane cluster operators (i.e. etcd, kube-apiserver, kube-controller-manager, kube-scheduler) happy, so that the latter won't trigger additional revisions. Thus reducing the time OCP needs to stabilize after recert. For more details please check here: - rh-ecosystem-edge/recert#82 Signed-off-by: Michail Resvanis <[email protected]>
This change leverages recert's latest OCP post-process hostname feature, which makes OCP's control-plane cluster operators (i.e. etcd, kube-apiserver, kube-controller-manager, kube-scheduler) happy, so that the latter won't trigger additional revisions. Thus reducing the time OCP needs to stabilize after recert. For more details please check here: - rh-ecosystem-edge/recert#82 Signed-off-by: Michail Resvanis <[email protected]>
This PR adds the changes required to the
ocp_postprocess
module, in order to skip the unnecessary and time-consuming OCP control-plane component rollouts. The latter get triggered by the node'shostname
change, which occurs when applying an IBU seed image onto the target SNO.The changes are:
string
, i.e.--hostname
with which the newhostname
is providedNODE_IP
in the etcd relatedconfigmaps
, in addition to thehostname
, which is currently done in the filesystem by the LCA post-pivot. It's probably a good idea to do it here, so that we can change it both in etcd and the filesystem. In that sense, this argument could be refactored to--hostname-rename <hostname>:<IP>
(?)hostname_rename
mod, which implements the following changes:hostname
inetcd
secrets/openshift-etcd/etcd-all-certs
and its revisionsoperator.openshift.io/kubeapiservers/cluster
operator.openshift.io/kubecontrollermanagers/cluster
operator.openshift.io/kubeschedulers/cluster
secrets/openshift-etcd/etcd-peer
and its revisionssecrets/openshift-etcd/etcd-serving
secrets/openshift-etcd/etcd-serving-metrics
configmaps/openshift-etcd/etcd-pod
and its revisionsconfigmaps/openshift-etcd/restore-etcd-pod
configmaps/openshift-etcd/etcd-scripts
hostname
in the filesystem/etc/kubernetes/static-pod-resources/etcd-*
env var names and values of env vars, i.e.s/NODE_<hostname>/NODE_<new-hostname>/g; s/<hostname/<new-hostname>/g
/etc/kubernetes/manifests/etcd-*
env var names and env var values, i.e.s/NODE_<hostname>/NODE_<new-hostname>/g; s/<hostname>/<new-hostname>/g
/etc/kubernetes/static-pod-resources/kube-apiserver-pod-*
, i.e.s/--node-name=<hostname>/--node-name=<new-hostname>/g
/etc/kubernetes/static-pod-resources/etcd-certs/secrets/etcd-all-certs/*.{crt,key}
/etc/kubernetes/static-pod-resources/etcd-member/etcd-all-certs/*.{crt,key}
/etc/kubernetes/static-pod-resources/etcd-pod-*/secrets/etcd-all-certs/*.{crt,key}
hostname
inetcd
keys and values, that are irrelevant to skipping the control-plane component rollouts but still useful in order to not leave any leftovers when moving to the seed image to the target SNO