This is the first step in the setup process for this project. Our project requires an infrastructure to deploy a kubernetes cluster.
An automated creation of resources on an Openstack cluster. Ansible is used here as the automation tool
Code location:
openstack_infra/roles/os_instance/
: Ansible role for create/delete openstack instances
Ansible Playbook: infra_setup.yaml
Command: ansible-playbook -i inventory/infra/hosts.ini -v infra_setup.yaml
Variables defined in file: os-infra.yml
- This command will call infra_setup.yaml playbook, which will execute the Ansible role os_instance
- Role task tasks/main.yaml will be called and then it will call tasks/create.yaml
- Script openstack_instance.py will be used to create instances defined as following variables:
- Kubernetes control nodes:
k8s_ctl_instances
- Flavour defined in
k8s_ctl_instance_flavour
- Security group defined in
k8s_instance_security_groups
- Flavour defined in
- Kubernetes worker nodes:
k8s_wrk_instances
- Flavour defined in
k8s_wrk_instance_flavour
- Security group defined in
k8s_instance_security_groups
- Flavour defined in
- DNS and Load-balancer node:
k8s_lb_instance
- Flavour defined in
k8s_instance_flavour
- Security group defined in
k8s_instance_dns_security_groups
- Flavour defined in
- NFS server node:
k8s_nfs_instance
- Flavour defined in
k8s_instance_flavour
- Security group defined in
k8s_instance_nfs_security_groups
- Flavour defined in
- Other details for instances:
- Image name defined in
k8s_instance_image
- SSH key defined in
k8s_instance_image_key
- Image name defined in
- Kubernetes control nodes:
- An ansible hosts config will be created for cluster setup with IP addresses of created instances at
inventory/cluster/hosts.ini
- IMPORTANT: This file will later be used by ClusterSetup step.
- Template used to create this file: cluster.hosts.ini
- An example of created file can be found here: cluster_hosts.ini
- An ansible hosts config will be created for fabric setup with IP addresses of created instances at
inventory/blockchain/hosts.ini
- IMPORTANT: This file will later be used by FabricSetup step.
- Template used to create this file: blockchain.hosts.ini
- An example of created file can be found here: cluster_hosts.ini
Ansible Playbook: infra_delete.yaml
Command to delete infrastructure: ansible-playbook -i inventory/infra/hosts.ini -v infra_delete.yaml
Variables defined in file: os-infra.yml
- This command will call infra_delete.yaml playbook, which will execute the Ansible role os_instance
- Role task tasks/main.yaml will be called and then it will call tasks/delete.yaml
- Script openstack_instance.py will be used to delete instances defined as following variables:
- Kubernetes control nodes:
k8s_ctl_instances
- Kubernetes worker nodes:
k8s_wrk_instances
- DNS and Load-balancer node:
k8s_lb_instance
- NFS server node:
k8s_nfs_instance
- Kubernetes control nodes: