Giter Club home page Giter Club logo

pilot-light's Introduction

Pilot Light - Reverse DNS-based Ignition Server for OpenShift

Imagine you want to install OpenShift with the Bare Metal UPI Installation method and you have an environment which does NOT allow you to:

  • Pass Ignition or Afterburner Configuration to your Machines
  • Set DHCP/PXE boot parameters
  • Boot from ISO

...but you CAN:

  • Map and set Static IPs
  • Manage forward and reverse DNS for your Machines
  • Boot a QCow2 or similar VM Image that has the /ignition.firstboot file modified with:
    • A specific DNS server (your with Reverse A records), eg nameserver=10.128.10.10
    • The ignition url set to point to a server, eg coreos.inst.ignition_url=http://10.128.10.10:8082/ignition-generator
    • Learn how to modify a Qcow2 file easily here: https://kenmoini.com/blog/modify_disk_images_with_guestfish/

...then Pilot Light is for you!

What Pilot Light Does

Pilot Light is a simple Golang application, which when supplied a config.yml file and an install-config.yaml for an OpenShift bare metal install, will generate the needed manifests and Ignition Configs for the cluster and serve them via an HTTP server for Machines that match a hostname pattern as matched from a Reverse DNS query.

How to Use Pilot Light

$ ./pilot-light [-config file]

1. Generate The OpenShift Bare Metal UPI install-config.yaml file

An example install-config.yaml file looks like the following, making sure to change the baseDomain, metadata.name, pullSecret, and sshKey:

apiVersion: v1
baseDomain: example.com
compute:
- hyperthreading: Enabled
  name: worker
  replicas: 0
controlPlane:
  hyperthreading: Enabled
  name: master
  replicas: 3
metadata:
  name: test
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  networkType: OpenShiftSDN
  serviceNetwork:
  - 172.30.0.0/16
platform:
  none: {}
fips: false
pullSecret: '{"auths": ...}'
sshKey: 'ssh-ed25519 AAAA...'

2. Generate the Pilot Light config.yml file

A sample config.yml looks like this:

pilot_light:
  version: 0.0.1

  asset_directory: ./.generated/
  dns_server: 10.128.10.10:53
  install_config_path: ./install-config.yaml
  masters_schedulable: false
  default_ignition_file: bootstrap

  server:
    host: 0.0.0.0
    path: "/generate-manifest"
    port: 8082
    timeout:
      server: 30
      read: 15
      write: 10
      idle: 5

  database:
    type: local
    path: db.sqlite

  ignition_sets:
    - name: bootstrap
      type: bootstrap
      hostname_format: bootstrap

    - name: control plane
      type: master
      hostname_format: master

    - name: application
      type: worker
      hostname_format: worker

3. Run Pilot Light

Running Pilot Light will do the following:

  1. Create a Generation Directory and subdirectories
  2. Copy over the install-config.yaml file to a conf directory
  3. Download the OpenShift Install binary, unpack it, create manifests
  4. [Optional] Set Control Plane nodes to not run workloads
  5. Create the Ignition Configs
  6. Start an HTTP Server
  7. Respond to requests, do a reverse DNS lookup, match hostnames to Ignition Configs

pilot-light's People

Contributors

kenmoini avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

pilot-light's Issues

Custom DNS is ignored

For some reason when deployed to CentOS/RHEL the Golang DNS dialer is ignored and system /etc/resolv.conf DNS servers are still used.

Add Custom FCCT Config Option to ignition_sets

So get this...use Pilot Light for a self-assembling environment based on DNS.
Add an extra custom_fcct_config key to the ignition_sets - include fcct into the functions of the program.
Then, pass that key to a file, fcct it up to ignition, serve OpenShift and custom CoreOS workloads assembled from Pilot Light.

A great example of this would be for the Pilot Light server itself, or HAProxy and DNS. This would speed up provisioning of complex OpenShift environments, like the ones driven into IBM Cloud via RHPDS.

Add disconnected/offline capabilities

This could be done by checking for a openshift-install-preprovided-path var in the config.yml file and skipping the download if it is there and the path is testable as a valid openshift-install binary path

Add better logging

Ability to log to multiple standard facilities, eg:

pilot_light:
  logging:
    - mode: stdout
      sinks:
        - name: sys_stdout
          target: stdout
        - name: file_stdout
          target: /var/log/pilot-light.log
    - mode: stderr
      sinks:
        - name: sys_stderr
          target: stderr
        - name: file_stderr
          target: /var/log/pilot-light-errors.log

Or something, idk, how does journald work again?

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.