Skip to content

Commit

Permalink
refactor: update directory paths
Browse files Browse the repository at this point in the history
  • Loading branch information
slipperypenguin committed Feb 22, 2025
1 parent b6315e8 commit 1211c1a
Show file tree
Hide file tree
Showing 42 changed files with 287 additions and 212 deletions.
9 changes: 6 additions & 3 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[env]
_.python.venv = { path = "{{config_root}}/.venv", create = true }
KUBERNETES_DIR = '{{config_root}}/kubernetes'
BOOTSTRAP_DIR = '{{config_root}}/bootstrap'
KUBECONFIG = "{{config_root}}/kubeconfig"
KUBERNETES_DIR = '{{config_root}}/kubernetes'
ROOT_DIR = "{{config_root}}"
SCRIPTS_DIR = '{{config_root}}/scripts'
SOPS_AGE_KEY_FILE = "{{config_root}}/age.key"
TALOSCONFIG = "{{config_root}}/kubernetes/bootstrap/talos/clusterconfig/talosconfig"
TALOS_DIR = '{{config_root}}/talos'
TALOSCONFIG = "{{config_root}}/talos/clusterconfig/talosconfig"

[tasks.deps]
description = "Install dependencies"
Expand All @@ -15,7 +19,6 @@ python = "3.13"
uv = "latest"
# Operations tools
"aqua:budimanjojo/talhelper" = "3.0.19"
"aqua:charmbracelet/gum" = "0.15.2"
"aqua:cloudflare/cloudflared" = "2025.2.0"
"aqua:FiloSottile/age" = "1.2.1"
"aqua:fluxcd/flux2" = "2.4.0"
Expand Down
11 changes: 4 additions & 7 deletions .taskfiles/bootstrap/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ tasks:
- test -f {{.ROOT_DIR}}/.sops.yaml
- test -f {{.SOPS_AGE_KEY_FILE}}
- test -f {{.TALHELPER_DIR}}/talconfig.yaml
- which talhelper sops
- which talhelper talosctl sops

apps:
desc: Bootstrap apps into the Talos cluster
cmds:
- bash {{.KUBERNETES_DIR}}/bootstrap/apps/resources/prepare.sh
- helmfile --file {{.KUBERNETES_DIR}}/bootstrap/apps/helmfile.yaml apply --skip-diff-on-install --suppress-diff
cmd: bash {{.SCRIPTS_DIR}}/bootstrap-apps.sh
preconditions:
- test -f {{.KUBECONFIG}}
- test -f {{.KUBERNETES_DIR}}/bootstrap/apps/helmfile.yaml
- test -f {{.KUBERNETES_DIR}}/bootstrap/apps/resources/prepare.sh
- test -f {{.ROOT_DIR}}/.sops.yaml
- test -f {{.SCRIPTS_DIR}}/bootstrap-apps.sh
- test -f {{.SOPS_AGE_KEY_FILE}}
- which helmfile
4 changes: 2 additions & 2 deletions .taskfiles/utils/resources/kubeconform.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail

set -euo pipefail

KUBERNETES_DIR=$1

Expand Down
7 changes: 4 additions & 3 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ set: [pipefail]
shopt: [globstar]

vars:
BOOTSTRAP_DIR: '{{.ROOT_DIR}}/bootstrap'
KUBERNETES_DIR: '{{.ROOT_DIR}}/kubernetes'
PRIVATE_DIR: '{{.ROOT_DIR}}/.private'
TALHELPER_DIR: '{{.ROOT_DIR}}/kubernetes/bootstrap/talos'
TALOSCONFIG: '{{.ROOT_DIR}}/kubernetes/bootstrap/talos/clusterconfig/talosconfig'
SCRIPTS_DIR: '{{.ROOT_DIR}}/scripts'
TALOS_DIR: '{{.ROOT_DIR}}/talos'
TALOSCONFIG: '{{.ROOT_DIR}}/talos/clusterconfig/talosconfig'

env:
KUBERNETES_DIR: '{{.KUBERNETES_DIR}}'
KUBECONFIG: '{{.ROOT_DIR}}/kubeconfig'
SOPS_AGE_KEY_FILE: '{{.ROOT_DIR}}/age.key'
TALOSCONFIG: '{{.TALOSCONFIG}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,40 @@ releases:
namespace: kube-system
chart: cilium/cilium
version: 1.16.6
values: ['{{ requiredEnv "KUBERNETES_DIR" }}/apps/kube-system/cilium/app/helm-values.yaml']
values: ['{{ requiredEnv "ROOT_DIR" }}/kubernetes/apps/kube-system/cilium/app/helm-values.yaml']

- name: coredns
namespace: kube-system
chart: oci://ghcr.io/coredns/charts/coredns
version: 1.39.0
values: ['{{ requiredEnv "KUBERNETES_DIR" }}/apps/kube-system/coredns/app/helm-values.yaml']
values: ['{{ requiredEnv "ROOT_DIR" }}/kubernetes/apps/kube-system/coredns/app/helm-values.yaml']
needs: ['kube-system/cilium']

- name: cert-manager
namespace: cert-manager
chart: jetstack/cert-manager
version: v1.17.1
values: ['{{ requiredEnv "KUBERNETES_DIR" }}/apps/cert-manager/cert-manager/app/helm-values.yaml']
values: ['{{ requiredEnv "ROOT_DIR" }}/kubernetes/apps/cert-manager/cert-manager/app/helm-values.yaml']
needs: ['kube-system/coredns']

- name: external-secrets
namespace: external-secrets
chart: oci://ghcr.io/external-secrets/charts/external-secrets
version: 0.14.2
values: ['{{ requiredEnv "KUBERNETES_DIR" }}/apps/external-secrets/external-secrets/app/helm-values.yaml']
values: ['{{ requiredEnv "ROOT_DIR" }}/kubernetes/apps/external-secrets/external-secrets/app/helm-values.yaml']
needs: ['cert-manager/cert-manager']

- name: flux-operator
namespace: flux-system
chart: oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator
version: 0.14.0
values: ['{{ requiredEnv "KUBERNETES_DIR" }}/apps/flux-system/flux-operator/app/helm-values.yaml']
values: ['{{ requiredEnv "ROOT_DIR" }}/kubernetes/apps/flux-system/flux-operator/app/helm-values.yaml']
needs: ['cert-manager/cert-manager']

- name: flux-instance
namespace: flux-system
chart: oci://ghcr.io/controlplaneio-fluxcd/charts/flux-instance
version: 0.14.0
wait: false
values: ['{{ requiredEnv "KUBERNETES_DIR" }}/apps/flux-system/flux-operator/instance/helm-values.yaml']
values: ['{{ requiredEnv "ROOT_DIR" }}/kubernetes/apps/flux-system/flux-operator/instance/helm-values.yaml']
needs: ['flux-system/flux-operator']
2 changes: 1 addition & 1 deletion kubernetes/apps/actions-runner-system/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: actions-runner-system
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./actions-runner-controller/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/cert-manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: cert-manager
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./cert-manager/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/default/echo-server/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
labels:
app.kubernetes.io/name: *app
components:
- ../../../../flux/components/gatus/external
- ../../../../components/gatus/external
interval: 30m
path: ./kubernetes/apps/default/echo-server/app
postBuild:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/apps/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./echo-server/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/external-secrets/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: external-secrets
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./external-secrets/ks.yaml
- ./onepassword/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/flux-system/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: flux-system
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./flux-operator/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/kube-system/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kube-system
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./cilium/ks.yaml
- ./coredns/ks.yaml
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/apps/network/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: network
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./external/ks.yaml
- ./internal/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/observability/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: observability
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./gatus/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/openebs-system/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: openebs-system
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./openebs/ks.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/volsync-system/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: volsync-system
components:
- ../../flux/components/common
- ../../components/common
resources:
- ./snapshot-controller/ks.yaml
180 changes: 0 additions & 180 deletions kubernetes/bootstrap/apps/resources/prepare.sh

This file was deleted.

Loading

0 comments on commit 1211c1a

Please sign in to comment.