tree: cae7d0ebb85b2cf911cec894c85988ddf155d887 [path history] [tgz]
  1. Jenkins-JNLP-Slave-Agent/
  2. Templates/
  3. XCAT-Kubernetes-Container/
  4. init-openbmc-k8s-env.sh
  5. kubernetes-launch.sh
  6. README.md
  7. storage-setup.sh
kubernetes/README.md

Running Builds Script with Kubernetes

The following are required to run scripts with Kubernetes integration:

  • Access to a Kubernetes cluster.
  • External storage that is mountable to the Kubernetes cluster.
  • Kubectl installed and configured on the machine running the scripts.

All the scripts use a similar formula to launch to Kubernetes:

  1. The script is run with a valid launch variable in the environment.
  2. The script then invokes the kubernetes-launch.sh script by sourcing it.
  3. The launch script then uses the template to generate the appropriate YAML file.
  4. The generated YAML is then used to launch the object into the specified Kubernetes cluster.
  5. Once the object is launched the script will end or will do optional tailing of the logs or deletion of the object from the API once Docker container run completes.

The steps to run the script with Kubernetes integration are also similar for all scripts:

  1. Look at the variables used by the script and by the templates.
  2. Export the variables that you would like to be different from the defaults in the script, kubernetes-launch-script, and template. Alternatively, you can edit the defaults in the files locally.
  3. Run the script.

OpenBMC Build

QEMU build

Useful links:

Kubernetes (K8s) is an open source container orchestration system.

If you would like to know more regarding Kubernetes look over these:

Persistent Data Storage

Since Kubernetes works using various nodes to run the builds it is best to use NFS or GlusterFS storage so that data will not be bound to one machine directly. This lets us not care about what node is currently running the container while maintaining access to the data we want.

PVs and PVCs are the way Kubernetes Mounts directories to containers. A script used to launch an NFS mount PV and PVC pair can be found here. There is one caveat to using external storage mounts, the folders used to do the actual build cannot be mounted to an external file system.