This is the repository for automatically deploying the KubeEdge to OpenStack based cloud using ansible and terraform.
Overall deployment automation architecture of IoT platform:
The following components are necessary for setting up and interacting with the cluster:
- VMs creation (1 Master, 1 Worker, 1 Edge; can be changed in
variables.tf
) - Docker
- Kubernetes usig Kubeadm
- Flannel used as CNI
- Helm
- Keadm v1.9.1 both on Master and Edge
- Keadm logs enabled both on Master and Edge
- Edgemesh both on Master and Edge (https://edgemesh.netlify.app/guide/getting-started.html#dependencies)
- Monitoring: Prometheus, Grafana, Kubernetes Metrics Server for edge
- OpenFaaS
- Sedna
- Clone the repository and go to the root directory:
git https://github.com/ansjin/KubeEdge-Openstack-Ansible-Automation
cd KubeEdge-Openstack-Ansible-Automation
- Create a key-pair in the cloud
TODO
- Replace the key variables in the config files accordingly
variables.tf (instance_keypair_name)
variables.tf (ssh_key_file)
ansible/ansible.cfg (private_key_file)
# all below should be equivalent to openstack_user_name
terraform.tfvars (openstack_user_name)
terraform.tfvars (openstack_tenant_name)
terraform.tfvars (openstack_project_name)
terraform.tfvars (openstack_project_id)
- Download the credentials from the cloud and source it
source xxxxxxx-openrc.sh
- Initialize the terraform providers
terraform init
- Bootstrap the cluster
terraform apply -auto-approve
- Destroy the cluster
terraform destroy -auto-approve
cd ansible
ansible-playbook master.yml -vvvv
ansible-playbook worker.yml -vvvv
ansible-playbook master-after-join.yml -vvvv
# ansible-playbook -i cloud_hosts.ini --start-at-task "Install K8s dashboard" master.yml -vvvv
- Kubernetes Dashboard (http://MASTER_PUBLIC_IP:32007)
- Grafana Dashboard (http://MASTER_PUBLIC_IP:32006)
- Prometheus Configuration for Grafana (http://MASTER_PUBLIC_IP:32009)
NOTE: It takes about 10 min for Terraform to run + 5 min for all the Pods to be Running/Completed.