noseka1 / openshift-auto-upi

OpenShift Automated User-Provided Infrastructure
Apache License 2.0
98 stars 51 forks source link

Modify manifest to mark control-plane as unschedulable #21

Closed hashnao closed 3 years ago

hashnao commented 3 years ago

Fixes noseka1/openshift-auto-upi#20

noseka1 commented 3 years ago

@hashnao Thanks for the pull request. Currently, it is possible to mark the control-plane unschedulable by putting this file https://github.com/noseka1/openshift-auto-upi/blob/master/docs/examples/ignition/filetranspiler/bootstrap/opt/openshift/manifests/cluster-scheduler-01-config.yml in the right place so that it's applied by the filetranspiler.

I like the more straight forward approach suggested by your pull request. I will need to think about it a bit more.

hashnao commented 3 years ago

I didn't realize that mastersSchedulable can be set in the scheduler policy file. I agree with your idea as the scheduler is more flexible than directly modifying the manifest file, so I think it is enough to add documentation about cluster-scheduler-01-config.yml. I'll do that later.

noseka1 commented 3 years ago

@hashnao Sounds great. I created a card https://github.com/noseka1/openshift-auto-upi/projects/3#card-46038094 for adding the documentation. If you can implement it that would be awesome.

hashnao commented 3 years ago

@noseka1 I've drafted the doc, so can you move it to In Progress?

noseka1 commented 3 years ago

@hashnao Great! I moved the card to "In Progress". Let me know when ready for the review. Thanks.

hashnao commented 3 years ago

@noseka1 Thanks, I'm ready for the review!

hashnao commented 3 years ago

@noseka1 Hi, can you review the commits, if you haven't?

noseka1 commented 3 years ago

@hashnao I verified that the method you described in this pull request works, i.e. one can drop the yaml files into the manifests directory and it will be picked up by the installer when generating the ignition file. I have to say that I didn't know about this method before, don't know if this method is documented anywhere.

I was suggesting an alternative method which is already implemented in openshift-auto-upi. This method leverages the filetranspiler tool https://github.com/ashcrow/filetranspiler. The filetranspiler must be installed on the helper node, https://github.com/noseka1/openshift-auto-upi/blob/master/docs/customizing_ignition_configs.md. After that:

$ mkdir -p files/ignition/filetranspiler/bootstrap/opt/openshift/manifests
$ cp docs/examples/ignition/filetranspiler/bootstrap/opt/openshift/manifests/cluster-scheduler-01-config.yml files/ignition/filetranspiler/bootstrap/opt/openshift/manifests/cluster-scheduler-01-config.yml

To enable the ignition modification for the boostrap node, add to the openshift_cluster_hosts.yml file:

openshift_cluster_hosts:
  - hostname: bootstrap
    ignition_transform:
      filetranspiler_roots:
        - files/ignition/filetranspiler/bootstrap

Then run the installation as usual, for example:

$ ansible-playbook openshift_libvirt_fwcfg.yml

The non-schedulable master configuration will be included in the ignition file and applied to the cluster.

The filetranspiler method is able to add files to an arbitrary location on the node. In contrast, the method described in this pull request is able to only add files to the manifest directory if my understanding is correct. The filetranspiler method as being more powerful is hence preferred.

Let me know your thoughts.

hashnao commented 3 years ago

@noseka1 Thanks, I totally missed adding the filetranspiler tool, so I added it. I also left the comment about modifying the <installation_directory>/manifests/cluster-scheduler-02-config.yml file after generating the Kubernetes manifests using openshift-install create manifests because I think this method is simpler than the filetranspiler method and some may prefer it as it's described in the official doc.

noseka1 commented 3 years ago

@hashnao Regarding the filetranspiler method, the instructions in the commit differ from the commands I posted above. Note that the transpiler method is not touching the files in openshift-auto-upi-workspace. Could you please update the commit to match the instructions I provided above?

The second method of manually modifying the generated manifests sounds good to me. I would put the two options into two separate sections each with its own title, though. That could make the distinction even more clear.

hashnao commented 3 years ago

@noseka1 My apologies, I thought the filetranspiler uses the workspace directory, so updated the path you provided. Thanks for the advice about making the two options clearer. I updated the instruction as well.

noseka1 commented 3 years ago

@hashnao Thanks a lot for the great work! I merged it in.