feat: add kubernetes roles
This commit is contained in:
@@ -3,3 +3,6 @@ plugin: community.general.incus
|
|||||||
strict: true
|
strict: true
|
||||||
remotes:
|
remotes:
|
||||||
- local:home-infrastructure
|
- local:home-infrastructure
|
||||||
|
groups:
|
||||||
|
control_planes: "'master' in inventory_hostname"
|
||||||
|
workers: "'worker' in inventory_hostname"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
- name: Install required provision packages
|
- name: Install required packages
|
||||||
ansible.builtin.import_tasks: packages.yaml
|
ansible.builtin.import_tasks: packages.yaml
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Upgrade all packages
|
- name: Install Python 3 Dependencies
|
||||||
ansible.builtin.package:
|
ansible.builtin.apt:
|
||||||
name: '*'
|
pkg:
|
||||||
state: latest
|
- python3-debian
|
||||||
|
state: present
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Install Kubernetes APT repository
|
||||||
|
ansible.builtin.import_tasks: repo.yaml
|
||||||
|
|
||||||
|
- name: Install Kubernetes packages
|
||||||
|
ansible.builtin.import_tasks: packages.yaml
|
||||||
|
|
||||||
|
- name: Configure networking
|
||||||
|
ansible.builtin.import_tasks: networking.yaml
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Enable sysctl 'net.ipv4.ip_forward'
|
||||||
|
ansible.posix.sysctl:
|
||||||
|
name: net.ipv4.ip_forward
|
||||||
|
value: 1
|
||||||
|
sysctl_set: true
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- name: Install Kubernetes packages
|
||||||
|
ansible.builtin.apt:
|
||||||
|
pkg:
|
||||||
|
- kubeadm
|
||||||
|
- kubelet
|
||||||
|
- containerd
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
|
- name: Activate containerd service
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: containerd
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Add Kubernetes APT repository
|
||||||
|
ansible.builtin.deb822_repository:
|
||||||
|
name: kubernetes
|
||||||
|
types: deb
|
||||||
|
uris: https://pkgs.k8s.io/core:/stable:/v1.36/deb/
|
||||||
|
suites: /
|
||||||
|
signed_by: https://pkgs.k8s.io/core:/stable:/v1.36/deb/Release.key
|
||||||
|
state: present
|
||||||
+6
-1
@@ -1,5 +1,10 @@
|
|||||||
---
|
---
|
||||||
- name: Common
|
- name: Bootstrap
|
||||||
hosts: all
|
hosts: all
|
||||||
roles:
|
roles:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
|
- name: Setup Kubernetes nodes
|
||||||
|
hosts: all
|
||||||
|
roles:
|
||||||
|
- kubernetes_node
|
||||||
|
|||||||
+2
-2
@@ -7,8 +7,8 @@ locals {
|
|||||||
ext_disk_size = "16GiB"
|
ext_disk_size = "16GiB"
|
||||||
network_cidr = "10.150.0.1/24"
|
network_cidr = "10.150.0.1/24"
|
||||||
|
|
||||||
master_count = 2
|
master_count = 1
|
||||||
worker_count = 0
|
worker_count = 1
|
||||||
|
|
||||||
image = "ubuntu/26.04"
|
image = "ubuntu/26.04"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user