Skip to content

Commit

Permalink
v3.0: Support adding new nodes to k3s; Support dns01 challenge for le…
Browse files Browse the repository at this point in the history
…ts encrypt; Graduate home assistant to a live app; Update CI tests (#163)

* initial rework of default issuers for cert manager

plus version bump

* add more tui components for extra nodes

* moved the k3s additional nodes box to a tab on the distro config page

* finish up initial tui pass 1 for new nodes to the cluster

* add totoro placeholder, fix dropdown, and rig up submit button for new nodes for k3s

* add updating yaml for new nodes and actual function for adding new nodes to k3s under k8s_distros

* add more detailed comments in default config file for adding new nodes

* finish up making sure that extra node taints and labels are processed as lists

* make labels have spaces instead of _ for input/dropdown generic widget and add delete from yaml for nodes

* fix deleting a node

* graduating home assitant to prod and adding more docs on affinity and tolerations

* update the cert manager docs to include info on DNS01 challenge type support

* cleaning up handling of dns01 challenge solvers for certmanager ACME issuer type ClusterIssuers

* updating cert-manager app in default config to new spec

* update empty fields checker to pass on certmanager if we're using http01 solver type

* rig up the cli portion of the k3s remote node join cluster functionality

* update docs and screenshots on add news nodes via the tui and config file

* update certmanager docs

* fix broken bool_option widget, update screenshot of new node tab for k3s

* fix wrong variable for solver being used in clusterissuer creation

* fixed forgot to pass in k8s_obj to create_cluster_issuers for cert_manager

* switch from using explicit sensitive values for cert manager

* fix issues with taints/labels for new nodes and fix issue with ssh key unknown when first sshing to new node

* fix issue with sshing into another node by single quoting the command to run on the remote node :)

* update the version to be v3.0 and explain breaking changes in the readme

* clean up cert manager docs, home assistant docs, and readme upgrade docs

* note the home assitant change from demo to live app

* update the join for default ssh key file to be a separate var

* run k3s and kind tests in different jobs

* add a debug line for init dict for cert-manager

* update the ci config files for both k3s and kind to latest config file version for v3

* add k3s kubeconfig variable for ci job

* remove debug line with sensitive info for cert manager

* remove k3s ip debug line

* add a cli test for k3d

* update the contributing docs to mention that we have some ci tests via gha now

* update k3d tests to install k3d

* add confirmation screen doc page and work on bitwarden screenshots

* update docs for bitwarden credentials screen
  • Loading branch information
jessebot authored Mar 15, 2024
1 parent c2454c6 commit e92ae90
Show file tree
Hide file tree
Showing 39 changed files with 3,163 additions and 256 deletions.
1,115 changes: 1,115 additions & 0 deletions .github/smol_k8s_lab_config_k3d.yaml

Large diffs are not rendered by default.

25 changes: 16 additions & 9 deletions .github/smol_k8s_lab_config_k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ k8s_distros:
- "ingress-ready=true"
kubelet-arg:
- "max-pods=150"
# not yet adjustable on k3s at this time
nodes:
control_plane: 1
workers: 0
nodes: {}

k3d:
# set to true to enable deploying a Kubernetes cluster using k3d
Expand Down Expand Up @@ -196,13 +193,23 @@ apps:
# Initialize of the app through smol-k8s-lab
init:
# Deploys staging and prod ClusterIssuers and prompts you for
# cert-manager.argo.secret_keys if they were not set. Switch to false if
# you don't want to deploy any ClusterIssuers
# values if they were not set. Switch to false if you don't want
# to deploy any ClusterIssuers
enabled: true
argo:
secret_keys:
# Used for letsencrypt-staging, to generate certs
values:
# Used for to generate certs and alert you if they're going to expire
email: "[email protected]"
# choose between "http01" or "dns01"
cluster_issuer_acme_challenge_solver: http01
# only needed if cluster_issuer_challenge_solver set to dns01
# currently only cloudflare is supported
cluster_issuer_acme_dns01_provider: cloudflare
sensitive_values:
# can be passed in as env vars if you pre-pend CERT_MANAGER_
# e.g. CERT_MANAGER_CLOUDFLARE_API_TOKEN
- CLOUDFLARE_API_TOKEN
argo:
secret_keys: {}
# git repo to install the Argo CD app from
repo: "https://github.com/small-hack/argocd-apps"
# path in the argo repo to point to. Trailing slash very important!
Expand Down
20 changes: 15 additions & 5 deletions .github/smol_k8s_lab_config_kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,23 @@ apps:
# Initialize of the app through smol-k8s-lab
init:
# Deploys staging and prod ClusterIssuers and prompts you for
# cert-manager.argo.secret_keys if they were not set. Switch to false if
# you don't want to deploy any ClusterIssuers
# values if they were not set. Switch to false if you don't want
# to deploy any ClusterIssuers
enabled: true
argo:
secret_keys:
# Used for letsencrypt-staging, to generate certs
values:
# Used for to generate certs and alert you if they're going to expire
email: "[email protected]"
# choose between "http01" or "dns01"
cluster_issuer_acme_challenge_solver: http01
# only needed if cluster_issuer_challenge_solver set to dns01
# currently only cloudflare is supported
cluster_issuer_acme_dns01_provider: cloudflare
sensitive_values:
# can be passed in as env vars if you pre-pend CERT_MANAGER_
# e.g. CERT_MANAGER_CLOUDFLARE_API_TOKEN
- CLOUDFLARE_API_TOKEN
argo:
secret_keys: {}
# git repo to install the Argo CD app from
repo: "https://github.com/small-hack/argocd-apps"
# path in the argo repo to point to. Trailing slash very important!
Expand Down
70 changes: 68 additions & 2 deletions .github/workflows/test-smol-k8s-lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on:
pull_request:
paths-ignore:
- ".github/**"
- "mkdocs.yaml"
- "README.md"
- "docs/**"
jobs:
smol_k8s_lab_test:
test_kind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -16,7 +17,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
Expand All @@ -39,7 +40,72 @@ jobs:
source .venv/bin/activate
smol-k8s-lab -c .github/smol_k8s_lab_config_kind.yaml
test_k3s:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install smol-k8s-lab via poetry
run: poetry install

- name: Install Argo CD cli
run: |
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
- name: test smol-k8s-lab with k3s
run: |
source .venv/bin/activate
export KUBECONFIG="/home/runner/.config/kube/config"
smol-k8s-lab -c .github/smol_k8s_lab_config_k3s.yaml
test_k3d:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install smol-k8s-lab via poetry
run: poetry install

- name: Install Argo CD cli
run: |
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
- name: Install k3d
run: |
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
- name: test smol-k8s-lab with k3d
run: |
source .venv/bin/activate
export KUBECONFIG="/home/runner/.config/kube/config"
smol-k8s-lab -c .github/smol_k8s_lab_config_k3d.yaml
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If it's a code fix, please:

We also utilize the [Bitwarden cli], for a password manager so you never have to see/know your Argo CD password.

NOTE: We're open to unit, integration, and ci testing btw! We just don't have any because we weren't stable enough to justify them yet. 🤦
NOTE: We're open to unit and integration tests btw! We just don't have anything but ci via Github Actions, because we weren't stable enough to justify them yet. 🤦

### Prereqs

Expand Down
Loading

0 comments on commit e92ae90

Please sign in to comment.