parent
8fb4eaf610
commit
2cc4fd0be0
19
README.md
19
README.md
|
@ -31,3 +31,22 @@ ansible-playbook -i production -J k3s-servers.yml
|
||||||
|
|
||||||
This will run the [./k3s-servers.yml](./k3s-servers.yml) playbook and execute
|
This will run the [./k3s-servers.yml](./k3s-servers.yml) playbook and execute
|
||||||
its roles.
|
its roles.
|
||||||
|
|
||||||
|
## After successful k3s installation
|
||||||
|
|
||||||
|
To access our Kubernetes cluster from our host machine to work on it via
|
||||||
|
flux and such we need to manually copy a k3s config from one of our server nodes to our host machine.
|
||||||
|
Then we need to install `kubectl` on our host machine and optionally `kubectx` if we're already
|
||||||
|
managing other Kubernetes instances.
|
||||||
|
Then we replace the localhost address inside of the config with the IP of our load balancer.
|
||||||
|
Finally we'll need to set the KUBECONFIG variable.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir ~/.kube/
|
||||||
|
scp k3s-server00:/etc/rancher/k3s/k3s.yaml ~/.kube/config
|
||||||
|
chown $USER ~/.kube/config
|
||||||
|
sed -i "s/127.0.0.1/192.168.20.22/" ~/.kube/config
|
||||||
|
export KUBECONFIG=~/.kube/config
|
||||||
|
```
|
||||||
|
|
||||||
|
Install flux and continue in the flux repository.
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
---
|
|
||||||
- include_tasks: installation.yml
|
|
||||||
- include_tasks: apps.yml
|
|
|
@ -14,3 +14,17 @@ stream {
|
||||||
proxy_pass k3s_servers;
|
proxy_pass k3s_servers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
upstream k3s_servers {
|
||||||
|
{% for ip in k3s_server_ips %}
|
||||||
|
server {{ ip }};
|
||||||
|
{% endfor %}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
location / {
|
||||||
|
proxy_pass http://k3s_servers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue