GithubHelp home page GithubHelp logo

chuckersjp / coreos-iso-maker Goto Github PK

View Code? Open in Web Editor NEW
57.0 6.0 51.0 65 KB

Create a bunch of coreos ISOs for OCP 4.x installs when you need to set static IPs

License: Apache License 2.0

Jinja 100.00%

coreos-iso-maker's Introduction

WARNING! WARNING! WARNING!

It has been brought to my attention that use of coreos-iso-maker may geerate images that may NOT be supported if you plan to install your cluster in FIPS mode. A customer was having issues with a FIPS based cluster that they couldn't update which may or may not be related to their use of this repo. You have been warned!

Also note that in upcoming version of OpenShift, there will be the supported ability customize the ISO installer. See here for more details

coreos-iso-maker V2.10

Update this version: This version supports the new OCP 4.6 ISO. There was a name change as well as a change in the underlying directory structure of the ISO which broke everything so this is no longer backwards compatible. Versions should be tagged as either OCP4.5 (which works with earlier versions as well) or OCP4.6. Make sure you use the correct one or you will like have issues.

My thanks to Steve Ovens for pointing out how broken this became.

A HUGE thanks to ITS4U (https://github.com/its4u) for a number of pull requests that were to fix a lot of the issues with the 4.6 liveCD due to all the changes in the ISO as well as my lack of understanding with some of the variables in use.

As part of ITS4U's work, there is a new parameter for the inventory that defines whether DHCP should be used. Normally, of course, this will be set to false as that is the entire point of this project. But if you have other NICs that make use of it, it can be turned on for those.

Problem definition

Some customers would like to use static IPs for their OCP nodes but don't have a working DHCP server for various reasons. This can be done using the ISO for CoreOS and messing with the boot parameters. However, this is involves lots of error prone typing. This project is designed to work around that and originally created individualized ISOs for each node. In v2.1, it can be used to create a single ISO with a menu item for each node being built. Due to screen space limitations, it is NOT recommend that you use this to create more than 7 nodes at a time (1 bootstrap, 3 master control planes, and 3 worker nodes). It might work, but you might have problems with the display on boot. Caveat user. If you would prefer to have multiple ISOs, there is a separate playbook for that.

Variables to define

In the group_vars/all.yml file, define the following variables:

  • gateway - default router IP
  • netmask - default netmask
  • interface - NIC device name. Defaults to ens192 which is default for VMWare
  • dns - dns server. This can be done as a list. Don't add more than 3.
  • webserver_url - webserver that holds the Ignition file
  • webserver_port - webserver port for the webserver above
  • webserver_ignition_path - Ignition subpath in http server
  • install_drive - drive to install RHCOS on
  • ocp_version - Full OCP version you are going for. 4.4.3
  • iso_checksum - sha256 checksum of the ISO. Currently correct as of 2020-01-23 and OCP 4.3
  • iso_name - Name of the ISO to download. Makes certain assumptions that should be verified
  • rhcos_bios - Name of the BIOS image to boot from. This is how the file is named on your webserver. Make certain assumptions that should be verified.
  • arch - CPU Architecture type. Must be one of x86_64 (default) or ppc64le Can be defined on the commandline with -e

In inventory.yml you will need to define your hosts:

  • bootstrap - bootstrap node and its ipv4 address
  • masters - You will need to define 3 master nodes and their ipv4 address
  • workers - However many worker nodes you want and their corresponding ipv4 addresses. Recommend no more than 3 at a go.

There is a second example file called inventory-multinic.yml for an example of how to setup multiple NIC machines.

You will need to use create individual ignition files and load them to your webserver. This project does NOT currently do that.

Running the Playbook

Once the inventory is created, you can run either of the following commands:

For a single ISO: ansible-playbook playbook-single.yml -K

For multiple ISOs: ansible-playbook playbook-multi.yml -K

The included ansible.cfg file assumes the name of the inventory file is inventory.yml Change it in there if you want to use a different one or include the -i <inventory-filename> option to change it on the command line.

The ISO(s) will be created in the /tmp directory. The -K is to request for the BECOME password which is required to mount an ISO (assuming you don't have passwordless sudo).

Acknowlegements

Special thanks to Shanna Chan for trailblazing these issues (detail here: https://shanna-chan.blog/2019/07/26/openshift4-vsphere-static-ip/) and inspiring its creation.

coreos-iso-maker's People

Contributors

christianh814 avatar chuckersjp avatar hhemied avatar lukyky414 avatar racinrandall avatar worsco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

coreos-iso-maker's Issues

RHOCS 4.3 ISO Boot Parameters

Hi,

The isolinux.cfg file does not change the boot params of the ISO's kernel. It seems like it's not honoring it and the default kernel params are shown.

However, I got it to work though by adding the "{{cmd_args}}" to the grub.cfg
Once the "cmd_args" were added to the grub.cfg I was able to see my static IP configuration and iginition_url and image_url in the boot params and everything was gravy.

It was working fine for 4.2. I will open a PR shortly.

Switch to version 4.6

Hello,

I've worked on switching to the version 4.6 of OpenShift.
The solution is simple (but I didnt find a better way to send a message other than an Issue)
Please take a look at the fork on Its4u:
https://github.com/its4u/coreos-iso-maker

On the branch "v4.6", the solution is:
adding an option on the isolunix file (currently only on single-dhcp): coreos.liveiso=RHCOS-x86_64
because on the playbook: /usr/bin/mkisofs [...] -A 'RHCOS-x86_64' [...]

the coreos.liveiso should be the app id. On the iso, the default is rhcos-46.82.202010091720-0, but since the playbook create another iso, it is another app id.

Not related, but the repo on its4u present 3 fixes:
first (on the branch dhcp), a patch to use dhcp
and (on the branch path), a patch to use custom folder in the web_server to pull ignition file or image file

second (on the branch dhcpANDpath): both patch together
third (on the branch v4.6): using the dhcpANDpath patch, I've added the v4.6 patch.
(maybe some parameters on isolinux are useless, I've put them all just in case).
The grub.cfg file is also useless in 4.6 (at least I didnt need it)

bootstrap_node example

underscores are not allowed in host names. I had someone just change the domain piece of the host names in this role and it failed to install due to underscore in bootstrap_node. Recommend changing to either bootstrap.example.com

Isolinux generation problem

Please make sure all .j2 file have a space after {% include 'arguments.j2' %} . It is important as the next charcater after the include is ignored.

Especially in isolinux.cfg-single.j2, where the End Of Line is ignored, making the menu list broken.

Sorry for the problematic pull request.

Incorrect Ignition URL Kernel Param

Thanks for setting up this repo. Saved me a ton of time creating the ISO's for setting the static IPs.
Just wanted to point out that the param should be "ignition_url" in this line, not image_url

cmd_args: "{{ cmd_args }} coreos.inst.image_url={{ webserver_url }}:{{ webserver_port }}/{{ inventory_hostname_short }}.ign"

Add a little more detail around ignition files

Could you add some more detail to the README with regards to creating individual ignition files. Is there a link to documentation that we could use here or could there be some small description of the process?

Most baremetal UPI and IPI install docs show how to create the generic bootstrap, master, and worker ignition files, but this playbook seems to require an ignition for each individual node on a webserver.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.