⚠️ This was designed only to be used on a Dev environment for education propose: Be very careful here! You can read the official documentation for more information.
These tools need to be installed on your local machine or the computer that will run Ansible:
🔨 As part of this deployment, we need to change our local host file (/etc/hosts). My host files on my MacBook is located at /etc/hosts.
Add the below entry to the file.
10.10.50.11 myapi.com
This automation will deploy 2 Kubernetes nodes and 1 Kubernetes master as shown below.
Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource.
I'll deploy the Nginx Ingress to control all traffic from myapi.com/ to go to svcnginx Kubernetes services.
Execute at the root directory:
sudo vagrant up --no-provision && sudo vagrant provision
You can access the master VM executing the below command on the current folder
vagrant ssh k8s-master
This command will ssh
to k8s-master VM.
Once the ansible deployment finishes, you can access http://myapi.com
.
sudo vagrant destroy -f
Ingress Nginx pods
Ingress Nginx rule
Ingress Nginx svc
Nginx Website svc