- Install the kinD cluster.
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/
kind version- Install kubectl.
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version --client- Create a cluster and verify it.
kind create cluster
kubectl get nodes- Create python environment.
python3.10 -m venv robusta
source robusta/bin/activate- Install the robusta-cli: This step is needed to generate the values file for helm chart installation.
python3 -m pip install -U robusta-cli --no-cache- Generate a generated_values.yaml for the Robusta chart:
# An interactive session where you can configure sinks
# such as receiving alerts to a particular Slack channel, MS Teams.
# This generates a `generated_values.yaml`
robusta gen-config- Install Robusta with helm:
helm repo add robusta https://robusta-charts.storage.googleapis.com && helm repo update
helm install robusta robusta/robusta -f ./generated_values.yaml --set clusterName=<cluster-name>- Deploy a manifest with PV, PVC and Pod.
kubectl apply -f Scenario_1.yamlTask 4: Create your playbook repository, push that to GitHub and use the Github link in your Robusta's generated-values.yaml file.
- Add the following code in the generated.yaml file after setting up the repository.
playbookRepos:
my_extra_playbooks:
url: https://github.com/HamzaXgrid/RobustaPlaybook1.git- Now update the values in the helm.
helm upgrade robusta robusta/robusta --values=generated_values.yaml --set clusterName=kind-mycluster-1- Invoke a trigger using below command.
robusta playbooks trigger List_of_Files_on_PV name=new-pv-pod namespace=default Task 5: Write a function on python which mounts a persistent volume and send the list of files present on that persistent volume to a sink.
The Function is written in my-actions.py file that send the list of files present on that persistent volume to a sink.
- For the scenario1, our action lists the files on PV and sends to sink.
- For the scenario2, our action creates a pod and lists the files on PV and sends to sink.
- For the scenario3, our action sends the notification that no PV is not claimed by any PVC.
robusta playbooks trigger List_of_Files_on_PV name=new-pv-volume
robusta playbooks trigger List_of_Files_on_PV name=task-pv-volume