Ansible 2.9+ needs to be installed in your computer to run this. Python3 as well.
python -m pip install --user ansible
Details on the requirements to create a Kubernetes cluster on each cloud provider are described in the following sub-pages:
Note: This is work in progress.
Follow these steps to provision a Kubernetes cluster.
-
Clone this repository:
git clone https://github.com/nleiva/ansible-kubernetes.git
-
Make your cloud provider credentials available as environment variables (
export
). See AKS, EKS, or GKE for more details.
export <credential>='...'
- Run the Playbook and wait a couple of minutes while your Kubernetes cluster is being provisioned. Define the cloud provider via the variable
cloud_provider
(either;aws
,azure
, orgcp
).
ansible-playbook main.yml -v --extra-vars "cloud_provider=azure"
See ACM for details.
ansible-playbook main.yml -v --extra-vars "acm_import=true cloud_provider=aws"
Follow these steps to delete a Kubernetes cluster.
- Run the Playbook with the variable
delete
set totrue
.Define the cloud provider via the variablecloud_provider
(either;aws
,azure
, orgcp
).
ansible-playbook main.yml -v --extra-vars "delete=true cloud_provider=azure"
You need ansible-navigator installed. Here is an example to create an AKS cluster with it.
ansible-navigator run main.yml -v --extra-vars "cloud_provider=azure"
Note: I use podman as my container engine (container-engine
). You can change to another alternative in the ansible navigator config file.