tblakex01 / windows-machine-config-bootstrapper

Windows MCO for OpenShift that handles addition of Windows nodes to the cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows Machine Config Bootstrapper

Bootstrapper is the entity responsible for bootstrapping a Windows node. The current scope of this component is to perform an one shot configuration of the Windows node to ensure that it can be become a worker node. Following are the jobs that the bootstrapper does:

  • Parse the worker ignition file to get the bootstrap kubeconfig
  • Ensures that the kubelet gets the correct kubelet config
  • Perform CNI configuration
  • Run the kubelet as a windows service

Once the bootstrapper has been run and the CSR associated with the Windows node is approved, the Windows node will have a taint called os=Windows:NoSchedule, only the pods with matching toleration can be scheduled onto the Windows node. An example pod spec with the toleration would be:

tolerations:
  - key: "os"
    operator: "Equal"
    value: "Windows"
    effect: "NoSchedule"

This will be remotely invoked from a Ansible script or can be run locally

Requirements

  • Must be run on Windows server 2019
  • Must be run as administrator
  • A worker ignition file generated by the cluster must be on disk
  • The kubelet you wish to use must be on disk. Currently we support v1.16.2
  • If running on AWS, the Windows instance must have the same tags as the other worker nodes in the cluster
  • For CNI, the following is required:

Usage

make build
wmcb initialize-kubelet --ignition-file $IGNITION_FILE_PATH --kubelet-path $KUBELET_PATH
wmcb configure-cni --cni-dir $CNI_BIN_DIR --cni-config $CNI_CONFIG

configure-cni needs to be executed only after initialize-kubelet is executed. If initialize-kubelet is executed after configure-cni is executed, all the CNI options will be removed. This is to give the user a chance to change network configuration to something other than CNI after the initial setup.

Testing

Windows Machine Config Bootstrapper

End to end testing

The following environment variables need to be set for running the end to end tests:

  • ARTIFACT_DIR
    • This can be set to any directory
  • AWS_SHARED_CREDENTIALS_FILE
    • Set this to point to your AWS credentials file
  • KUBE_SSH_KEY_PATH
    • The ssh key used to bring up the VM
  • KUBECONFIG
    • The kubeconfig of the OpenShift cluster

Once the above variables are set, you can run the unit and end to end tests by executing:

$ hack/run-wmcb-ci-e2e-test.sh

The hack script can be given the following options:

  • -v option takes a list of VM credentials in the order of instance-id,ip-address,password. The username defaults to Administrator. This allows you to run the tests against existing set of VMs.

    $ hack/run-wmcb-ci-e2e-test.sh -v"aws-instance-id-1,3.135.234.23,password,aws-instance-id-2,3.135.234.23,password"
  • -s option allows you to skip the framework setup. The assumption here is that the framework setup has already been run on the VM.

    $ hack/run-wmcb-ci-e2e-test.sh -v"aws-instance-id,1.2.34.23,password" -s

Ansible

Follow the instructions in tools/ansible/README.md, and ensure the playbook completes successfully.

About

Windows MCO for OpenShift that handles addition of Windows nodes to the cluster

License:Apache License 2.0


Languages

Language:Go 97.3%Language:PowerShell 1.5%Language:Shell 0.7%Language:Makefile 0.4%