Skip to content

Commit

Permalink
Add missing steps
Browse files Browse the repository at this point in the history
Closes #18
  • Loading branch information
edwardtheharris committed Aug 11, 2024
1 parent a5997bd commit 0239121
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
8 changes: 6 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

abstract: >-
The readme for some Ansible roles for managing bare metal k8s clusters.
authors: Xander Harris
authors:
- name: Xander Harris
email: [email protected]
date: 2024-03-08
title: Ansible Bare Metal K8S
title: Readme
---

[![wakatime](https://wakatime.com/badge/github/edwardtheharris/ansible-kcp.svg)](https://wakatime.com/badge/github/edwardtheharris/ansible-kcp)

## Assumptions

The default configuration assumes a vault password exists at
Expand Down
2 changes: 2 additions & 0 deletions roles/join/files/modules-k8s.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
overlay
br_netfilter
3 changes: 3 additions & 0 deletions roles/join/files/sysctl-k8s.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
20 changes: 20 additions & 0 deletions roles/join/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
---
- name: Configure netfilter and ip
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
mode: ug+rw,o-rwx
loop:
- src: modules-k8s.conf
dest: /etc/modules-load.d/k8s.conf
- src: sysctl-k8s.conf
dest: /etc/sysctl.d/k8s.conf
- name: Enable deployed updates
ansible.builtin.shell:
cmd: sysctl --system
- name: Enable kubelet
ansible.builtin.service:
state: restarted
name: kubelet
enabled: true
- name: Load join command
ansible.builtin.shell:
cmd: grep -A 3 'kubeadm join' roles/join/files/join.md | head -3
Expand Down
11 changes: 11 additions & 0 deletions roles/reset/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
# :start-at: "- name: Reset existing cluster\n"
# :end-at: " register: reset_out\n"
# ```
- name: Ensure required programs
community.general.pacman:
executable: yay
extra_args: '--noconfirm'
name: "{{ item }}"
state: present
loop:
- kubeadm
- kubelet
- kubectl
- kubie
- name: Reset existing cluster
ansible.builtin.command:
cmd: kubeadm reset -f &> /root/reset.md
Expand Down

0 comments on commit 0239121

Please sign in to comment.