Skip to content
Snippets Groups Projects
Commit 007864c1 authored by Ing. Klára Moravcová's avatar Ing. Klára Moravcová
Browse files

Merge branch 'update-readme' into 'master'

updated README.md

See merge request !1
parents ebfbf89b 2e7a6d3d
No related branches found
No related tags found
1 merge request!1updated README.md
Prerequisites:
terraform
## Prerequisites:
- terraform - [install](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)</br>
- Form to access group project - https://projects.cloud.muni.cz/
pip requirments.txt
## Create Infrastructure
Create openstack application credentials: </br>
- 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.)</br>
- <code>~/kubernetes-infra-example/terraform/main.tf</code>
- Give a path to your public ssh key at: <code>ssh_public_key = "~/.ssh/id_rsa.pub"</code>
```
cd ~/kubernetes-infra-example/terraform/
terraform init
source ~/path/to/credentials.sh
terraform apply
```
## Create Kubernetes Cluster
- <code>cd ~/kubernetes-infra-example/ansible/group_vars/all/</code>
- All possible group vars are in [Kubespray](https://github.com/kubernetes-sigs/kubespray) project.
- In <code>openstack.yml</code> modify the application credentials, can be the same credentials as already created.
#### Install Kubernetes
Prerequisites: </br>
```
cd ~/kubernetes-infra-example/ansible/01-playbook/
sudo pip install -r requirements.txt
ansible-galaxy install -r requirements.yml
```
Run ansible playbook: </br>
```
cd ~/kubernetes-infra-example/ansible/01-playbook/
ansible-playbook -i ~/kubernetes-infra-example/ansible/ansible_inventory --user=ubuntu --become --become-user=root play.yml
```
1. group project (quotas?)
1. create openstack application credentials
1. git clone kubernetes-infra-example
1. application credential -> group_vars
1. terraform - main - values
1. source application credentials
1. terraform apply
1. ansible/ group_vars (all possible group vars are in kubespray project)
1. application credential -> group_vars -> all -> openstack
2. Install Kubernetes - ansible-playbook -i ~/kubernetes-example/ansible/ansible_inventory --user=ubuntu --become --become-user=root play.yml
\ No newline at end of file
#### Access with SSH </br>
- Bastion ansible_hosts at <code>~/kubernetes-infra-example/ansible/ansible_inventory</code>
```
ssh -J ubuntu@195.113.167.169 ubuntu@10.10.10.26
sudo -i
kubectl get nodes
```
\ No newline at end of file
ansible==8.5.0
cryptography==41.0.4
jinja2==3.1.2
jmespath==1.0.1
MarkupSafe==2.1.3
netaddr==0.9.0
pbr==5.11.1
ruamel.yaml==0.17.35
ruamel.yaml.clib==0.2.8
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment