-
r0zehnal0vak authoredf1e95c12
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
README.md 2.50 KiB
Prerequisites:
- terraform - install
- Form to access group project - https://projects.cloud.muni.cz/
Create Infrastructure
Create openstack application credentials:
- On tab Identity > application credentials
- + create application credential
- Give a name > Create Applicaiton Credential
- Download file! (The application credential secret will not be available after closing this page, so you must capture it now or download it. If you lose this secret, you must generate a new application credential)
git clone git@gitlab.ics.muni.cz:cloud/kubernetes/kubernetes-infra-example.git
If required you may change the values as needed. (like infrastructure name, cluster size (master nodes, worker nodes groups), etc.)
~/kubernetes-infra-example/terraform/main.tf
- Give a path to your public ssh key at:
ssh_public_key = "~/.ssh/id_rsa.pub"
cd ~/kubernetes-infra-example/terraform/
terraform init
source ~/path/to/credentials.sh
terraform apply
Create Kubernetes Cluster
cd ~/kubernetes-infra-example/ansible/group_vars/all/
- All possible group vars are in Kubespray project.
- In
openstack.yml
modify the application credentials, can be the same credentials as already created.
Install Kubernetes
Prerequisites:
cd ~/kubernetes-infra-example/ansible/01-playbook/
sudo pip install -r requirements.txt
ansible-galaxy install -r requirements.yml
Run ansible playbook:
cd ~/kubernetes-infra-example/ansible/01-playbook/
ansible-playbook -i ../ansible_inventory --user=ubuntu --become --become-user=root play.yml
Access via config
- Kubeconfig is located in the artifacts directory, you can copy the config file to
~/.kube
directory for local access.
Access with SSH
- If you need to access the cluster
- Bastion ansible_hosts at
~/kubernetes-infra-example/ansible/ansible_inventory
ssh -J ubuntu@<bastion_ip_address> ubuntu@<control-node_ip_address>
# For example:
# ssh -J ubuntu@195.113.167.169 ubuntu@10.10.10.26
sudo -i
kubectl get nodes
Nginx Ingress Controller
Prerequisites:
- helm - install
helm repo add nginx-stable https://helm.nginx.com/stable
helm repo update
helm install nginx-ingress nginx-stable/nginx-ingress --set rbac.create=true
kubectl get service