This folder contains the Ansible playbook used to automate all the manual steps in building and deploying the example Hello Go app located elsewhere in this repository.
The Ansible playbook assumes you have the following installed on your workstation:
You will also need to install a Python dependencies via Python Pip:
pip3 install openshift
Once they are installed, you can run the playbook with:
ansible-playbook -i inventory main.yml
Once you're finished testing the Hello Go app in the Kubernetes cluster, you can clean it up by deleting the entire Minikube cluster with minikube delete
, or you can run the following commands to delete just the necessary resources and leave the Minikube cluster running:
kubectl delete service hello-go
kubectl delete deployment hello-go
The above commands assume you have kubectl
installed.
There are two playbooks used to demonstrate scaling resources with Ansible:
scale-k8s_scale.yml
: Scales the hello-go deployment using Ansible'sk8s_scale
module.scale-strategic-merge.yml
: Scales the hello-go deployment using Ansible'sk8s
module and thestrategic-merge
merge strategy.
Run the playbooks with:
ansible-playbook -i inventory scale-[type].yml