[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
[s4s] - Sh*t 4chan Says


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


Writing an ansible playbook that will automatically configure a kubernetes cluster
>>
ok
>>
lame is a whore
>>
>>13173786
lamb is a whore
>>
>>13173367
It takes a surprising amount of time to write good configurations.
I'm almost done with my main arr stack, then I'll probably move on to some thorough testing, and network configurations.
>>
>>13173367
---
- name: Prepare all Kubernetes nodes
hosts: k8s
become: true
vars:
kubernetes_version: "1.34"

tasks:
- name: Disable swap immediately
ansible.builtin.command: swapoff -a
when: ansible_swaptotal_mb > 0

- name: Disable swap permanently
ansible.builtin.replace:
path: /etc/fstab
regexp: '^(\s*[^#]\S+\s+\S+\s+swap\s+.*)$'
replace: '# \1'

- name: Load required kernel modules
community.general.modprobe:
name: "{{ item }}"
state: present
loop:
- overlay
- br_netfilter

- name: Configure Kubernetes networking
ansible.builtin.copy:
dest: /etc/sysctl.d/99-kubernetes.conf
mode: "0644"
content: |
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1

- name: Apply sysctl configuration
ansible.builtin.command: sysctl --system

- name: Install prerequisites
ansible.builtin.apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gpg
state: present
update_cache: true

- name: Create Kubernetes keyring directory
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
mode: "0755"

- name: Add Kubernetes repository key
ansible.builtin.get_url:
url: "https://pkgs.k8s.io/core:/stable:/v{{ kubernetes_version }}/deb/Release.key"
dest: /etc/apt/keyrings/kubernetes-apt-keyring.asc
mode: "0644"

- name: Add Kubernetes repository
ansible.builtin.apt_repository:
repo: >-
deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.asc]
https://pkgs.k8s.io/core:/stable:/v{{ kubernetes_version }}/deb/ /
filename: kubernetes
state: present

>etc
>>
>>13173822
who ‘s that

Your fortune: Good Luck
>>
>>13173367
i want to plap lain



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.