fix: Update README and change SSH_PASSWORD to SUDO_PASSWORD

Signed-off-by: Devin Buhl <devin.kray@gmail.com>
This commit is contained in:
Devin Buhl committed 2021-09-28 07:41:27 -04:00
1 parent 6f5eeaebd3
commit a770d9661d
4 files changed
+32 -23

No files matched your search

+8 -3
View File
@@ -40,7 +40,7 @@ export BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS=""
#
# Ansible hosts - repeat this block as many times as you need,
# incrementing the last digit on the variable for each node
# incrementing the last digit on the variable name for each node
#
# Host IP Address to the control plane node
@@ -48,7 +48,12 @@ export BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS=""
export BOOTSTRAP_ANSIBLE_HOST_ADDR_0=""
# User Ansible will log into the nodes
export BOOTSTRAP_ANSIBLE_SSH_USERNAME_0=""
# Password Ansible will log into the nodes
export BOOTSTRAP_ANSIBLE_SSH_PASSWORD_0=""
# Password Ansible will use to esculate to sudo
export BOOTSTRAP_ANSIBLE_SUDO_PASSWORD_0=""
# Set this node as a control node (true/false)
export BOOTSTRAP_ANSIBLE_CONTROL_NODE_0=""
# export BOOTSTRAP_ANSIBLE_HOST_ADDR_1=""
# export BOOTSTRAP_ANSIBLE_SSH_USERNAME_1=""
# export BOOTSTRAP_ANSIBLE_SUDO_PASSWORD_1=""
# export BOOTSTRAP_ANSIBLE_CONTROL_NODE_1=""
+22 -7
View File
@@ -27,7 +27,13 @@ Feel free to read up on any of these technologies before you get started to be m
- [traefik](https://traefik.io) - ingress controller
- [hajimari](https://github.com/toboshii/hajimari) - start page with ingress discovery
- [system-upgrade-controller](https://github.com/rancher/system-upgrade-controller) - upgrade k3s
- [reloader](https://github.com/stakater/Reloader) - restart pod when configmap or secret changes
- [reloader](https://github.com/stakater/Reloader) - restart pods when configmap or secret changes
For provisioning the following tools will be used:
- [Ubuntu](https://ubuntu.com/download/server) - this is a pretty universal operating system that supports running all kinds of home related workloads in Kubernetes
- [Ansible](https://www.ansible.com) - this will be used to provision the Ubuntu operating system to be ready for Kubernetes and also to install k3s
- [Terraform](https://www.terraform.io) - in order to help with the DNS settings this will be used to provision a Cloudflare domain and DNS settings
## :memo:&nbsp; Prerequisites
@@ -41,26 +47,35 @@ Feel free to read up on any of these technologies before you get started to be m
:round_pushpin: You should install the below CLI tools on your workstation. Make sure you pull in the latest versions.
#### Required
| Tool | Purpose |
|--------------------------------------------------------------------|---------------------------------------------------------------------|
| [ansible](https://www.ansible.com) | Preparing Ubuntu for Kubernetes and installing k3s |
| [direnv](https://github.com/direnv/direnv) | Exports env vars based on present working directory |
| [flux](https://toolkit.fluxcd.io/) | Operator that manages your k8s cluster based on your Git repository |
| [GnuPG](https://gnupg.org/) | Encrypts and signs your data |
| [gnupg](https://gnupg.org/) | Encrypts and signs your data |
| [go-task](https://github.com/go-task/task) | A task runner / simpler Make alternative written in Go |
| [helm](https://helm.sh/) | Manage Kubernetes applications |
| [ipcalc](http://jodies.de/ipcalc) | Used to verify settings in the configure script |
| [jq](https://stedolan.github.io/jq/) | Used to verify settings in the configure script |
| [kubectl](https://kubernetes.io/docs/tasks/tools/) | Allows you to run commands against Kubernetes clusters |
| [kustomize](https://kustomize.io/) | Template-free way to customize application configuration |
| [pinentry](https://gnupg.org/related_software/pinentry/index.html) | Allows GnuPG to read passphrases and PIN numbers |
| [sops](https://github.com/mozilla/sops) | Encrypts k8s secrets with GnuPG |
| [terraform](https://www.terraform.io) | Prepare a Cloudflare domain to be used with the cluster |
#### Optional
| Tool | Purpose |
|--------------------------------------------------------------------|---------------------------------------------------------------------|
| [helm](https://helm.sh/) | Manage Kubernetes applications |
| [kustomize](https://kustomize.io/) | Template-free way to customize application configuration |
| [pre-commit](https://github.com/pre-commit/pre-commit) | Runs checks pre `git commit` |
| [prettier](https://github.com/prettier/prettier) | Prettier is an opinionated code formatter. |
| [SOPS](https://github.com/mozilla/sops) | Encrypts k8s secrets with GnuPG |
| [terraform](https://www.terraform.io) | Prepare a Cloudflare domain to be used with the cluster |
### :warning:&nbsp; pre-commit
It is advisable to install [pre-commit](https://pre-commit.com/) and the pre-commit hooks that come with this repository.
[sops-pre-commit](https://github.com/k8s-at-home/sops-pre-commit) will check to make sure you are not by accident commiting your secrets un-encrypted.
[sops-pre-commit](https://github.com/k8s-at-home/sops-pre-commit) will check to make sure you are not by accident committing your secrets un-encrypted.
After pre-commit is installed on your machine run:
+2 -2
View File
@@ -215,7 +215,7 @@ verify_ansible_hosts() {
node_id=$(echo "${var}" | awk -F"_" '{print $5}')
node_addr="BOOTSTRAP_ANSIBLE_HOST_ADDR_${node_id}"
node_username="BOOTSTRAP_ANSIBLE_SSH_USERNAME_${node_id}"
node_password="BOOTSTRAP_ANSIBLE_SSH_PASSWORD_${node_id}"
node_password="BOOTSTRAP_ANSIBLE_SUDO_PASSWORD_${node_id}"
node_control="BOOTSTRAP_ANSIBLE_CONTROL_NODE_${node_id}"
_has_envar "${node_addr}"
@@ -245,7 +245,7 @@ generate_ansible_host_secrets() {
node_id=$(echo "${var}" | awk -F"_" '{print $5}')
{
node_username="BOOTSTRAP_ANSIBLE_SSH_USERNAME_${node_id}"
node_password="BOOTSTRAP_ANSIBLE_SSH_PASSWORD_${node_id}"
node_password="BOOTSTRAP_ANSIBLE_SUDO_PASSWORD_${node_id}"
printf "kind: Secret\n"
printf "ansible_user: %s\n" "${!node_username}"
printf "ansible_become_pass: %s\n" "${!node_password}"
-11
View File
@@ -1,11 +0,0 @@
---
kubernetes:
children:
master:
hosts:
k8s-0:
ansible_host: 192.168.42.10
worker:
hosts:
k8s-1:
ansible_host: 192.168.42.13