...
Fig 1: Illustration of the proposed workflow
...
Workflow Summary/Description
- Create BPA CRD (Created only once and just creates the BPA resource kind)
Create the BPA Custom Resource
The BPA Operator continues to watch the k8s API server and once it sees that a new BPA CR object has been created, it queries the k8s API server for the Baremetal hosts lists. The baremetal hosts lists contains information about the compute nodes provisioned including the IP address, CPU, memory..etc of each host.
The BPA operator looks into the baremetal hosts list returned and decides on the roles of the compute nodes based on the CPU and memory (Other features may be added as we proceed). The resource requirements for master and worker nodes are defined in the BPA CR object.
The BPA operator then creates the hosts.ini file using the assigned roles and their corresponding IP addresses.
The BPA operator then installs kubernetes using kubespray on the compute nodes thus creating an active kubernetes cluster. During installation, it would continue to check the status of the installation
On successful completion of the k8s cluster installation, the BPA operator would save the application-k8s kubeconfig file in order to access the k8s cluster and make changes such as software updates or add a worker node for future purposes.
BPA CRD
The BPA CRD tells the Kubernetes API how to expose the provisioning custom resource object. The CRD yaml file is applied using
“kubectl create -f bpa_v1alpha1_provisioning_crd.yaml” See below for the CRD definition.5.1. BPA
BPA CRD Yaml File (*_crd.yaml)
Code Block | ||
---|---|---|
| ||
apiVersion: apiextensions.k8s.io/v1beta1 |
...
kind: CustomResourceDefinition |
...
metadata: |
...
name: provisionings.bpa.akraino.org |
...
spec: |
...
group: bpa.akraino.org |
...
names:
kind: Provisioning
listKind: ProvisioningList
plural: provisionings
singular: provisioning
shortNames:
- bpa
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description:
type: string
kind:
description:
type: string
metadata:
type: object
spec:
type: object
status:
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
...
names: kind: Provisioning listKind: ProvisioningList plural: provisionings singular: provisioning shortNames: - bpa scope: Namespaced subresources: status: {} validation: openAPIV3Schema: properties: apiVersion: description: type: string kind: description: type: string metadata: type: object spec: type: object status: type: object version: v1alpha1 versions: - name: v1alpha1 served: true storage: true |
5.2. Provisioning Agent Object Definition( *_types,go)
The provisioning_types.go file is the API for the provisioning agent custom resource.
...