Skip to content

Commit 429ba72

Browse files
fix(post): Fixed ansible docs
1 parent 5e55c2b commit 429ba72

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

_posts/2022-03-26-k3s-etcd-ansible.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tags: k3s rancher etcd ansible cloud-image metallb kube-vip
1010

1111
Setting up k3s is hard. That's why we made it easy. Today we'll set up a High Availability K3s cluster using etcd, MetalLB, kube-vip, and Ansible. We'll automate the entire process giving you an easy, repeatable way to create a k3s cluster that you can run in a few minutes.
1212

13-
A HUGE THANKS to our sponsor, Micro Center!
13+
A HUGE THANKS to our sponsor, Micro Center!
1414

1515
New Customers Exclusive – Get a Free 240gb SSD at Micro Center: <https://micro.center/1043bc>
1616

@@ -28,28 +28,10 @@ Next, you'll need to fork and clone [the repo](https://github.com/techno-tim/k3s
2828
git clone https://github.com/techno-tim/k3s-ansible
2929
```
3030

31-
Next, you'll want to copy the `sample` directory within the `inventory` directory.
31+
Next, you'll want to `cd` into the repo and copy the `sample` directory within the `inventory` directory.
3232

3333
```bash
34-
cp -R k3s-ansible/inventory/sample inventory/my-cluster
35-
```
36-
37-
Next, copy the `roles` directory into your playbook directory.
38-
39-
```bash
40-
cp -R k3s-ansible/roles playbooks/roles
41-
```
42-
43-
Now copy the `site.yml` to your playbooks directory.
44-
45-
```bash
46-
cp k3s-ansible/site.yml playbooks/site.yml
47-
```
48-
49-
For later on, we will also need the `reset.yml` playbook.
50-
51-
```bash
52-
cp k3s-ansible/reset.yml playbooks/reset.yml
34+
cp -R inventory/sample inventory/my-cluster
5335
```
5436

5537
## Installing k3s
@@ -92,7 +74,7 @@ extra_agent_args: "--kubelet-arg node-status-update-frequency=5s"
9274
Start provisioning of the cluster using the following command:
9375
9476
```bash
95-
ansible-playbook ./playbooks/site.yml -i ./inventory/my-cluster/hosts.ini
77+
ansible-playbook ./site.yml -i ./inventory/my-cluster/hosts.ini
9678
```
9779

9880
**note: add --ask-pass --ask-become-pass if you are using password SSH login**
@@ -104,7 +86,7 @@ After deployment control plane will be accessible via virtual ip address which i
10486
To remove k3s from the nodes. These nodes should be rebooted afterwards due to VIP still being present
10587

10688
```bash
107-
ansible-playbook ./playbooks/reset.yml -i ./inventory/my-cluster/hosts.ini
89+
ansible-playbook ./reset.yml -i ./inventory/my-cluster/hosts.ini
10890
```
10991

11092
## kube config
@@ -132,7 +114,7 @@ kubectl get nodes
132114
Deploying a sample `nginx` workload
133115

134116
```bash
135-
kubectl apply -f k3s-ansible/example/deployment.yml
117+
kubectl apply -f example/deployment.yml
136118
```
137119

138120
Check to be sure it was deployed
@@ -144,7 +126,7 @@ kubectl describe deployment nginx
144126
Deploying a sample `nginx` service with a `LoadBalancer`
145127

146128
```bash
147-
kubectl apply -f k3s-ansible/example/service.yml
129+
kubectl apply -f example/service.yml
148130
```
149131

150132
Check service and be sure it has an IP from metal lb as defined in `inventory/my-cluster/group_vars/all.yml`
@@ -164,8 +146,8 @@ You should see the `nginx` welcome page.
164146
You can clean this up by running
165147

166148
```bash
167-
kubectl delete -f k3s-ansible/example/deployment.yml
168-
kubectl delete -f k3s-ansible/example/service.yml
149+
kubectl delete -f example/deployment.yml
150+
kubectl delete -f example/service.yml
169151
```
170152

171153
## What's next?

0 commit comments

Comments
 (0)