# Get offline packages

``` shell
make
tar czf tep-installer.tar.gz tep-installer
```

# Deploy Kubernetes environment

1. Copy tep-installer.tar.gz to the control machine.

2. Install Docker on the control machine

``` shell
tar xzf tep-installer.tar.gz
cd tep-installer
sudo yum install -y *.rpm
sudo systemctl enable --now docker
```

3. Load tep-installer image and run it

``` shell
sudo docker load -i tep-installer.tar
sudo docker run --rm --entrypoint=cp -v $PWD/conf:/temp tep-installer:latest -r /installer/inventory/group_vars /installer/inventory/inventory.ini.example /temp
sudo docker run -d --restart=always -p "9000:9000" --name=tep-installer -v $PWD/conf:/installer/inventory tep-installer:latest
```

4. Edit configuration files under *conf* directory

``` shell
sudo cp conf/inventory.ini.example conf/inventory.ini
sudo vi conf/inventory.ini
```

See more configurations in *conf/group_vars* and customize them to suit your need.

5. Deploy the k8s cluster

* Using SSH key

``` shell
sudo docker cp <ssh-key> tep-installer:/root/.ssh/id_rsa
sudo docker exec -t tep-installer ansible-playbook playbooks/deploy_cluster.yml --user <user> --become
```
If the `user` cannot run `sudo` without password, you must add an extra argument `-K` which will prompt you to type *password*.


* Using password
``` shell
sudo docker exec -t tep-installer ansible-playbook playbooks/deploy_cluster.yml --user <user> --become -k
```
If the `user` cannot run `sudo` without password, you must add an extra argument `-K` which will prompt you to type *password*.

> **Note:** If the control machine is also one of the k8s node, the deploy process may be interrupted by docker daemon restart. In this case, please try to deploy again.
