Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Software CR is another component of the Binary Provisioning Agent(BPA). The Software CR will install the required software, drivers and perform software updates on the hosts that make up the kubernetes cluster after the BPA controller has successfully installed kubernetes on the host. The required software and versions are specified in a configmap and the configmap name is specified in the custom resource when it is being createdthe software CR under the master and worker sub sections respectively. Software in the master section will be installed on all master nodes in the cluster and software in the worker section will be installed on all worker nodes in the cluster. If the software version is not specified, the latest version in that repository will be installed.

When the Software CR is created and the Kubernetes cluster has successfully  been installed, the BPA controller looks up the matching software custom resource (cluster name in the Software CR must match cluster name in the provisioning CR), gets the configmap name software list and then installs the software (and/or updates) that are defined in the specified host hosts via SSH.

Draft Software CRD

...

Code Block
package v1alpha1

import (
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.

// SoftwareSpec defines the desired state of Software
// +k8s:openapi-gen=true
type SoftwareSpec struct {
        // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
        // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
        // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
        MasterSoftware  SoftwareConfigMap stringmap[string][]interface `json:"masterSoftware,omitempty"`
        WorkerSoftware map[string][]interface `json:"SoftwareConfigMapNameworkerSoftware,requiredomitempty"`
}

// SoftwareStatus defines the observed state of Software
// +k8s:openapi-gen=true
type SoftwareStatus struct {
        // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
        // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
        // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Software is the Schema for the softwares API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
type Software struct {
        metav1.TypeMeta   `json:",inline"`
        metav1.ObjectMeta `json:"metadata,omitempty"`

        Spec   SoftwareSpec   `json:"spec,omitempty"`
        Status SoftwareStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// SoftwareList contains a list of Software
type SoftwareList struct {
        metav1.TypeMeta `json:",inline"`
        metav1.ListMeta `json:"metadata,omitempty"`
        Items           []Software `json:"items"`
}

func init() {
        SchemeBuilder.Register(&Software{}, &SoftwareList{})
}

SoftwareConfigMapMasterSoftware : This corresponds to SoftwareConfigMapName to the masterSoftware section in the SW sample CR (see sample file below). The Software Config Map will contain a list of software and versions to install and update for each node type (master or worker).. It has a map containing the various software with or without required versions. 

WorkerSoftware: This corresponds to the workerSoftware section in the sample CR file below. It has a map containing the various software with or without required versions. 

Sample Software CR YAML files

Code Block
languageyml
apiVersion: bpa.akraino.org/v1alpha1
kind: Software
metadata:
  name: example-software
  labels:
    cluster: cluster-abcxyz
    owner: c1
spec:
  SoftwareConfigMapNamename: example-software-sample-configmap

Sample Software ConfigMap

Code Block
languageyml
apiVersion: v1
kind: ConfigMap
metadata
spec:
  masterSoftware:
  name:  software-sample-configmap
data:
  master: |
- curl
    - htop
    - jq:
        curl:""
version: 1.5+dfsg-1ubuntu0.1
    - htopmaven:""
    tmux:""
    golang-go:"v12.1"version: 3.3.9-3
  workerworkerSoftware:
 |
   - curl:""
    - htop:""
    jq:""- tmux
    tmux:""- jq


Cluster IP Address Configmap

In order for the BPA controller to install the software specified in the software CR via SSH, it would need to have saved the IP address of The config map above is an example of how config map used by the software custom resource. The software specified under master would be installed on all master nodes and the software specified under worker would be installed on all the worker nodes. If a version is specified, that version of the software will be installed, if no version is specified as in the cases where "" is used above, the latest version would be installed from the apt repository.