This commit is contained in:
savagebidoof
2023-08-01 15:39:36 +02:00
parent ae6fa536f6
commit 7144c2d74b
10 changed files with 104 additions and 123 deletions

View File

@ -1,6 +1,6 @@
# Intended for OrangePI5 **(might work on other devices)**
- Tested on [ARMBIAN](https://www.armbian.com/orangepi-5/) Bullseye
- Previously on the [orangepi](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-pi-5.html) official Debian versions, but can't **confirm still works**
- Previously on the [orangepi](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-pi-5.html)
# Files
@ -17,7 +17,9 @@ ksetup/:
- tasks_master.yaml
- tasks_slave.yaml
- tasks_end.yaml
- kubeadm-join.command
- Exported:
- kubeadm-join.command (exported file)
- kubeconfig.conf (exported file)
inventory.yaml: Example inventory
```
@ -36,6 +38,8 @@ For more info regarding Ansible Inventory, refer to their [documentation regardi
It will:
- `apt-get update && apt-get upgrade`
- Install locale tools and `sudo`.
- Set the `loacale` for the ROOT user
- Set the `language` for the ROOT user
- Create the `wheel` group
@ -44,13 +48,18 @@ It will:
- Add the new user to the `wheel` group
- Change the ROOT password
- Disable SSH login to the ROOT user
- Executes `sleep 1 && dhclient -r && dhclient && reboot`. The `dhclient` is for my own usage so **modify it if it bothers you**.
- Reboots the device and ignores if you can't connect back, why? Cause might receive a different IP from the DHCP client. This is convenient for myself.
### Vars
A reminder that the point of this script, is to normalize the process of setting up a **fresh** ARMBIAN OS.
```yaml
# Initial Setup
initial_username: username used to to the first connection
initial_password: password used to to the first connection
# Connect
ansible_user: User used to connect
ansible_password: Password used to connect
@ -99,7 +108,7 @@ _kubeadm_join_command: Placeholder, will be populated at later stages of the scr
- Installs Docker (Debian) and Kubernetes repos.
- Installs `containerd.io`, `kubelet`, `kubeadm`, `kubectl`, `git`, `vim`.
- Sets default config for `containerd` with cGroups enabled.
- Enables some `iptables`.
- Enables some `iptables` modules.
- "Resets" `/etc/hosts` file
#### tasks_master.yaml
@ -107,22 +116,22 @@ _kubeadm_join_command: Placeholder, will be populated at later stages of the scr
##### Will only be executed if the variable `is_master` is set to `True`
- Executes `kubeadm init` aka initializes the node without further arguments assigned.
- Sets the `kubectl` conf to the user specified.
- Deploys `Calico` network plugin (might change in the future)
- Export the `kubeconfig` file.
- Removes `node-role.kubernetes.io/control-plane` taint to allow deploying containers in the control plane node.
- Generates a "join cluster" command and stores it in a file **LOCALLY** as `kubeadm-join.command`, this file will be later used by the slave nodes, who will execute this file's contents.
- Deploys `Calico` CNI network plugin.
- Deploys `MetalLB` CRDs.
- Generates a "join cluster" command and stores it in a file **LOCALLY** as `/Exported/ubeadm-join.command`, this file will be later used by the slave nodes, who will execute this file's contents.
#### tasks_slave.yaml
##### Will only be executed if the variable `is_master` is set to `False`
- Executes the "command" stored in the file `kubeadm-join.command` located **LOCALLY**.
- Executes the "command" stored in the file `./Exported/kubeadm-join.command` located **LOCALLY**.
#### tasks_end.yaml
- As per the moment, only reboots.
# USAGE
## Setup
@ -143,6 +152,16 @@ dd if=Armbian_23.02.2_Orangepi5_bullseye_legacy_5.10.110_minimal.img of=/dev/sdg
### arm_initial_setup.yaml
#### Log in Values
I set up the variables on the `inventory.yaml` file.
```yaml
initial_username: username used to to the first connection
initial_password: password used to to the first connection
```
#### Change the values of the desired variables
@ -168,9 +187,6 @@ ansible_user: "root"
ansible_password: "1234"
```
## Run (?)