Skip to content

This is the repository for automatically deploying the KubeEdge to OpenStack based cloud using ansible and terraform.

License

Notifications You must be signed in to change notification settings

Function-Delivery-Network/KubeEdge-Openstack-Ansible-Automation

Repository files navigation

KubeEdge-Openstack-Ansible-Automation

This is the repository for automatically deploying the KubeEdge to OpenStack based cloud using ansible and terraform.

Deployment Architecture

Overall deployment automation architecture of IoT platform:

Requirements

The following components are necessary for setting up and interacting with the cluster:

Currently following are enabled/deployment as part of this automation

  • 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

Get Started

  1. Clone the repository and go to the root directory:
git https://github.com/ansjin/KubeEdge-Openstack-Ansible-Automation
cd KubeEdge-Openstack-Ansible-Automation
  1. Create a key-pair in the cloud

TODO

  1. 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)
  1. Download the credentials from the cloud and source it
source xxxxxxx-openrc.sh
  1. Initialize the terraform providers
terraform init
  1. Bootstrap the cluster
terraform apply -auto-approve
  1. Destroy the cluster
terraform destroy -auto-approve

Run Ansible Commands Separately

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

Dashboard Links

  • 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.

About

This is the repository for automatically deploying the KubeEdge to OpenStack based cloud using ansible and terraform.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published