feat!: change some task names for better user experiance

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2023-07-06 16:29:17 -04:00
1 parent dfee1cbb97
commit 0d17e11709
4 files changed
+62 -52

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ vars:
tasks: tasks:
init: deps:
desc: Install / Upgrade Ansible galaxy deps desc: Install / Upgrade Ansible galaxy deps
dir: "{{.ANSIBLE_DIR}}" dir: "{{.ANSIBLE_DIR}}"
cmds: cmds:
+28
View File
@@ -0,0 +1,28 @@
---
version: "3"
tasks:
deps:
desc: Install workstation dependencies with Brew
cmd: brew install {{.DEPS}} {{.CLI_ARGS}}
preconditions:
- sh: command -v brew
msg: |
Homebrew is not installed. Using MacOS, Linux or WSL?
Head over to https://brew.sh to get up and running.
vars:
DEPS: >-
age
ansible
cilium-cli
cloudflare/cloudflare/cloudflared
direnv
fluxcd/tap/flux
go-task/tap/go-task
helm
kubernetes-cli
kustomize
python
sops
stern
+21 -29
View File
@@ -64,14 +64,14 @@ There is a decent guide [here](https://www.linuxtechi.com/how-to-install-debian-
- Keep ssh server checked - Keep ssh server checked
``` ```
2. (Post install) Enable SSH for root user 2. [Post install] Enable SSH for root user
```sh ```sh
sed -i 's/#\?\(PermitRootLogin\s*\).*$/\1yes/' /etc/ssh/sshd_config sed -i 's/#\?\(PermitRootLogin\s*\).*$/\1yes/' /etc/ssh/sshd_config
systemctl restart sshd systemctl restart sshd
``` ```
3. (Post install) Add SSH keys (or use `ssh-copy-id` on the client that is connecting) 3. [Post install] Add SSH keys (or use `ssh-copy-id` on the client that is connecting)
```sh ```sh
mkdir -m 700 ~/.ssh mkdir -m 700 ~/.ssh
@@ -79,7 +79,7 @@ There is a decent guide [here](https://www.linuxtechi.com/how-to-install-debian-
chmod 600 ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
``` ```
4. (Post install) If you cannot run `apt update` without errors, try removing CD/DVD as apt source 4. [Post install] If you cannot run `apt update` without errors, try removing CD/DVD as apt source
```sh ```sh
sed -i '1d' /etc/apt/sources.list sed -i '1d' /etc/apt/sources.list
@@ -97,17 +97,6 @@ According to the documentation [here](https://raspi.debian.net/defaults-and-sett
3. Add/change `root_pw` to your desired root password 3. Add/change `root_pw` to your desired root password
4. Add/change `hostname` to your desired hostname 4. Add/change `hostname` to your desired hostname
## 📂 Repository structure
The Git repository contains the following directories under `kubernetes` and are ordered below by how Flux will apply them.
```sh
📁 kubernetes # Kubernetes cluster defined as code
├─📁 bootstrap # Flux installation
├─📁 flux # Main Flux configuration of repository
└─📁 apps # Apps deployed into the cluster grouped by namespace
```
## 🚀 Lets go ## 🚀 Lets go
Very first step will be to create a new **public** repository by clicking the big green **Use this template** button on this page. Very first step will be to create a new **public** repository by clicking the big green **Use this template** button on this page.
@@ -120,7 +109,7 @@ Clone **your new repo** to you local workstation and `cd` into it.
📍 Install the **most recent version** of the CLI tools below. If you are **having trouble with future steps**, it is very likely you don't have the most recent version of these CLI tools. The most troublesome are `ansible`, `go-task`, and `sops`. 📍 Install the **most recent version** of the CLI tools below. If you are **having trouble with future steps**, it is very likely you don't have the most recent version of these CLI tools. The most troublesome are `ansible`, `go-task`, and `sops`.
1. Install the following CLI tools on your workstation, if you are **NOT** using [Homebrew](https://brew.sh/) **ignore** steps 2 & 3. 1. Install the following CLI tools on your workstation, if you are using [Homebrew](https://brew.sh/) skip this step and move onto 2 & 3.
- **Required**: [age](https://github.com/FiloSottile/age), [ansible](https://www.ansible.com), [flux](https://toolkit.fluxcd.io/), [cloudflared](https://github.com/cloudflare/cloudflared), [go-task](https://github.com/go-task/task), [direnv](https://github.com/direnv/direnv), [kubectl](https://kubernetes.io/docs/tasks/tools/), [python3](https://www.python.org/), [python-pip3](https://pypi.org/project/pip/), [sops](https://github.com/getsops/sops) - **Required**: [age](https://github.com/FiloSottile/age), [ansible](https://www.ansible.com), [flux](https://toolkit.fluxcd.io/), [cloudflared](https://github.com/cloudflare/cloudflared), [go-task](https://github.com/go-task/task), [direnv](https://github.com/direnv/direnv), [kubectl](https://kubernetes.io/docs/tasks/tools/), [python3](https://www.python.org/), [python-pip3](https://pypi.org/project/pip/), [sops](https://github.com/getsops/sops)
@@ -132,10 +121,10 @@ Clone **your new repo** to you local workstation and `cd` into it.
brew install go-task/tap/go-task brew install go-task/tap/go-task
``` ```
3. [Homebrew] Install workstation dependencies 3. [Homebrew] Install the other workstation dependencies
```sh ```sh
task init task brew:deps
``` ```
### 🔐 Setting up Age ### 🔐 Setting up Age
@@ -209,26 +198,29 @@ In order to expose services to the internet you will need to create a [Cloudflar
📍 The `template/vars/config.yaml` file contains necessary configuration that is needed by Ansible and Flux. The `template/vars/addons.yaml` file allows you to customize which additional apps you want deployed in your cluster. These files are added to the `.gitignore` file and will not be tracked by Git. 📍 The `template/vars/config.yaml` file contains necessary configuration that is needed by Ansible and Flux. The `template/vars/addons.yaml` file allows you to customize which additional apps you want deployed in your cluster. These files are added to the `.gitignore` file and will not be tracked by Git.
1. Copy the configuration file and start filling out all the variables. 1. Copy the configuration and addons files and start filling out all the variables.
**All are required** unless otherwise noted in the comments.
```sh ```sh
cp template/vars/config.sample.yaml template/vars/config.yaml task init
``` ```
2. Copy the addons file and enable any you want included. 2. Once done run the following command which will verify and generate all the files needed to continue.
```sh
cp template/vars/addons.sample.yaml template/vars/addons.yaml
```
3. Once done run the following command which will verify and generate all the files needed to continue.
```sh ```sh
task configure task configure
``` ```
### 📂 Repository structure
The configure script will have created the following directories under `./kubernetes`.
```sh
📁 kubernetes # Kubernetes cluster defined as code
├─📁 bootstrap # Flux installation (not tracked by Flux)
├─📁 flux # Main Flux configuration of repository
└─📁 apps # Apps deployed into the cluster grouped by namespace
```
### ⚡ Preparing Debian Server with Ansible ### ⚡ Preparing Debian Server with Ansible
📍 Here we will be running an Ansible Playbook to prepare Debian server for running a Kubernetes cluster. 📍 Here we will be running an Ansible Playbook to prepare Debian server for running a Kubernetes cluster.
@@ -240,7 +232,7 @@ In order to expose services to the internet you will need to create a [Cloudflar
2. Install the Ansible deps 2. Install the Ansible deps
```sh ```sh
task ansible:init task ansible:deps
``` ```
3. Verify Ansible can view your config 3. Verify Ansible can view your config
+12 -22
View File
@@ -12,32 +12,22 @@ env:
includes: includes:
ansible: .taskfiles/AnsibleTasks.yaml ansible: .taskfiles/AnsibleTasks.yaml
brew: .taskfiles/BrewTasks.yaml
cluster: .taskfiles/ClusterTasks.yaml cluster: .taskfiles/ClusterTasks.yaml
tasks: tasks:
default: task -l
init: init:
desc: Initialize workstation dependencies with Brew desc: Initialize configuration files
cmd: brew install {{.DEPS}} {{.CLI_ARGS}} dir: "{{.TEMPLATE_DIR}}"
preconditions: cmds:
- sh: command -v brew - cp -n vars/addons.sample.yaml vars/addons.yaml
msg: | - cp -n vars/config.sample.yaml vars/config.yaml
Homebrew is not installed. Using MacOS, Linux or WSL? status:
Head over to https://brew.sh to get up and running. - test -f "{{.TEMPLATE_DIR}}/vars/addons.yaml"
vars: - test -f "{{.TEMPLATE_DIR}}/vars/config.yaml"
DEPS: >-
age
ansible
cilium-cli
cloudflare/cloudflare/cloudflared
direnv
fluxcd/tap/flux
go-task/tap/go-task
helm
kubernetes-cli
kustomize
python
sops
stern
configure: configure:
desc: Configure repository from Ansible vars desc: Configure repository from Ansible vars