Collection of supplementary Airship images
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Andrii Ostapenko 62fee9ee1d Update lma charts definitions 2 weeks ago
..
config Bootstrap container for openstack provider (capo) 9 months ago
resource Bootstrap container for openstack provider (capo) 9 months ago
Dockerfile Bootstrap container for openstack provider (capo) 9 months ago
Makefile Allow image builder and bootstrap_capo proxy customization 8 months ago
README.md Bootstrap container for openstack provider (capo) 9 months ago
bootstrap-env.list Bootstrap container for openstack provider (capo) 9 months ago
clouds.yaml Bootstrap container for openstack provider (capo) 9 months ago
go.mod Bootstrap container for openstack provider (capo) 9 months ago
go.sum Bootstrap container for openstack provider (capo) 9 months ago
main.go Bootstrap container for openstack provider (capo) 9 months ago
openstack-config.yaml Bootstrap container for openstack provider (capo) 9 months ago

README.md

Openstack Bootstrap Container

This project contains the Go application as well as the shell scripts and configuration files for implementing the Openstack Bootstrap container.

The Openstack Bootstrap container is responsible to create or delete a Kubernetes (K8S) cluster on Openstack. The K8S cluster is created using kubeadm.

Go Application

The Go application is the container orchestrator that is responsible for translating commands into actions: create, delete, help.

The Go application reads the Ephemeral cluster configuration file (e.g., openstack-config.yaml) and converts the attributes into environment variables. These environment variables are used by the shell scripts to create or delete the K8S cluster.

To build this Go application, execute the following commands:

go install .
go build -o capo-ephemeral

Shell Scripts

The shell scripts make use of openstack cli commands to create and delete K8S cluster. The other alternative that was considered was to use magnum container orchestration APIs. In order to keep things generic, openstack cli command was chosen to create and delete the K8S cluster.

Create K8S Cluster script

The create-k8s-cluster.sh script creates a K8S cluster using the information provided in the Ephemeral cluster configuration file. It passes user-data.sh script in the openstack server create command to execute series of steps to initiate creation of the K8S cluster at boot time. Once the cluster is created, its kubeconfig file is copied to the container's volume mount, "sharing" it with the host.

Delete K8S Cluster script

The delete-k8s-cluster.sh script deletes the underlying VM and the K8S cluster using the information provided in the Ephemeral cluster configuration file.

Dockerfile

The Dockerfile is used to build the Openstack Bootstrap container image. Execute the following command to build the Bootstrap container image:

make docker

Pre-requisite

  • Devstack is installed.

  • The most recent version of the 64-bit amd64-arch QCOW2 image for Ubuntu 18.04 is used for creating the ephemeral cluster. The image is available here for download and should be available in the devstack environment.

  • ~/.airship/ directory on host machine contains clouds.yaml and openstack-config.yaml files.

  • airship configuration file is updated with ephemeral cluster configuration information.

Appendix

Required Configuration

Ephemeral Cluster Configuration

$ cat openstack-config.yaml
apiVersion: v1
kind: OpenstackCloudConfig
metadata:
    name: capi-openstack
credentials:
    credential: clouds.yaml
    cloudName: devstack
spec:
    cluster:
        machineSize: ds4G
        kubeconfig: capo.kubeconfig
        securityGroup: bootstrap-sec-grp

Airship Configuration

$ cat ~/.airship/config
apiVersion: airshipit.org/v1alpha1
bootstrapInfo:
  ephemeral:
    container:
      image: quay.io/airshipit/capo-bootstrap:latest
      name: capo-bootstrap
      volume: /home/stack/.airship:/kube
    ephemeralCluster:
      config: openstack-config.yaml