Installing the Ecosystem on Kubernetes
If you want to run scalable, highly available testing for enterprise level workloads, use the Kubernetes Operator to install your Galasa Ecosystem in a cloud environment. Running Galasa in a scalable cloud environment, rather than on a Docker engine, means that you are not limited by the size of the virtual machine.
If you are looking to create a local proof of concept, you might want to first install a Galasa Ecosystem on a Docker engine by using the Docker Operator.
- The Kubernetes command-line tool kubectl must be installed on the machine that is used to deploy the operator and must be configured to point at your Kubernetes cluster.
- You must have a Kubernetes cluster at version 1.16 or higher. You can check the version number by running the
About the Kubernetes Operator
Like the Docker Operator, the Kubernetes Operator installs the Galasa Ecosystem, but in addition, it also maintains the state of the ecosystem and the services it brings up.
The Kubernetes Operator is made up of two components: the
CustomResourceDefinition (CRD) and the operator deployment. The CRD allows a Galasa ecosystem to be defined in your Kubernetes cluster and the operator is responsible for instantiating and maintaining the defined ecosystem.
The Kubernetes Operator requires a high privilege level, so for security reasons, the operator is scoped to a namespace rather than cluster wide. Create your own namespace for your operator to run in and for the ecosystem to be hosted. Creating your own namespace avoids cross-contamination and improves security.
Installing the Galasa Ecosystem in a Kubernetes cluster
You can install the operator by using the release.yaml that is provided in the galasa-kubernetes-operator repository in GitHub. This repository contains the YAML that is required to define the custom resource definition object, service account, role, and role binding that the operator needs to perform work.
Complete the following steps to install the Galasa Ecosystem in a Kubernetes cluster.
Installing the Operator
- Installing the operator by using
release.yamlbrings up the operator and defines all serviceAccounts, Roles and Role bindings inside a new namespace that is called
Galasa. Run the following command after changing
<GALASA_VERSION>to be the version that you want to install:
kubectl apply -f https://raw.githubusercontent.com/galasa-dev/kubernetes-operator/main/releases/<GALASA_VERSION>/release.yaml
You can download the release.yaml sample to make any changes that are required to enable the yaml to work with your environment.
- Check that the pod is started cleanly by running the
kubectl get podcommand. The following service is displayed with a status of Running:
NAME READY STATUS galasa-ecosystem-kubernetes-operator-6cb9d79fb5-7zn6f 1/1 Running
The operator and custom resource definitions are now installed and ready to bring up a Galasa Ecosystem.
Bringing up the Galasa Ecosystem
Bring up the ecosystem by using the basic.yaml sample that is provided with Galasa.
externalhostnamevalue in the sample to the IP address or hostname of your Kubernetes cluster. The Kubernetes Operator needs this information to configure the Galasa Ecosystem to self-register services.
Update any other default configurations that are required for the sample to work with your cluster and ensure that the Galasa version number in the sample is the latest version number. Take a look at the ecosystem_with_overrides.yaml sample for some examples of attributes that can be edited.
Install the basic.yaml sample by running the following command:
kubectl apply -f basic.yaml
The installation takes a few minutes.
- Check the status by running the following command:
kubectl get galasaecosystem
The following example shows the information that is returned:
NAME READY BOOTSTRAPURL GRAFANAURL galasa-ecosystem true http://<HOSTNAME>:32319/bootstrap http://<HOSTNAME>:31091/galasa-grafana
Note that the command returns the Bootstrap endpoint, which you can paste into your Eclipse Galasa plugin to run SimBank tests for verifying the installation. The Grafana endpoint is also returned, and can be used to view ecosystem performance information.
- Check that the pods are brought up successfully on the ecosystem namespace by running the
kubectl get podscommand. The following services are displayed with a status of Running:
NAME READY STATUS galasa-ecosystem-apiserver-6d848f4689-5w7sw 1/1 Running galasa-ecosystem-cps-0 1/1 Running galasa-ecosystem-engine-controller-6fbb6bfc46-z6659 1/1 Running galasa-ecosystem-grafana-5dd447dd8f-tsz7h 1/1 Running galasa-ecosystem-metrics-bb865dff-f7xdj 1/1 Running galasa-ecosystem-prometheus-c85cdbb97-s8rhc 1/1 Running galasa-ecosystem-ras-0 1/1 Running galasa-ecosystem-resource-monitor-b7669c6b7-bq4x7 1/1 Running galasa-ecosystem-kubernetes-operator-6cb9d79fb5-7zn6f 1/1 Running
Verifying the installation
You can verify the installation by connecting to an Eclipse session, reconfiguring Galasa to point to the Galasa Ecosystem, and running the SimBank tests that are provided with Galasa.
To reconfigure Galasa to point to the Galasa Ecosystem that you created, you need to edit the bootstrap. The bootstrap contains the information that Galasa needs to bring up a framework in the Eclipse environment to connect to an ecosystem.
In Eclipse, you can edit the bootstrap and run the SimBank tests by completing the following steps:
- Select Eclipse > Preferences > Galasa
- Update Bootstrap URI to point to the Bootstrap URL that is returned by running the
kubectl get galasaecosystemcommand.
- Apply and close the preferences.
- Initialise the framework by selecting Galasa > Initialise Galasa Framework from the Eclipse main menu.
- Select Galasa > Submit tests to automation option from the Eclipse menu.
- Select the four SimBank tests to run them in parallel and click Finish.
- Click the Galasa icon on the Eclipse toolbar to view the status of test runs U1, U2, U3, and U4. Valid values for the runs are acknowledged, queued, allocated, running, and finished. The tests run in parallel rather than consecutively.
- Check the logs by running the
- Check the Galasa version number in the sample is correct by running the
kubectl describe pod <podname>command. If the version number is not the latest one, update the version number in the sample and apply the update.
- If an 'unknown fields' error message is displayed, you can turn off validation by using the