-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Devin Buhl <devin@buhl.casa>
- Loading branch information
Showing
33 changed files
with
537 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
ci_test: true | ||
|
||
bootstrap_distribution: talos | ||
bootstrap_github_username: onedr0p | ||
bootstrap_github_repository_name: flux-cluster-template | ||
bootstrap_github_repository_branch: main | ||
bootstrap_age_public_key: $BOOTSTRAP_AGE_PUBLIC_KEY | ||
bootstrap_timezone: Etc/UTC | ||
bootstrap_acme_email: fake | ||
bootstrap_acme_production_enabled: false | ||
bootstrap_flux_github_webhook_token: fake | ||
bootstrap_cloudflare_domain: fake | ||
bootstrap_cloudflare_token: fake | ||
bootstrap_cloudflare_account_tag: fake | ||
bootstrap_cloudflare_tunnel_secret: fake | ||
bootstrap_cloudflare_tunnel_id: fake | ||
bootstrap_node_cidr: 10.10.10.0/24 | ||
bootstrap_kube_api_addr: 10.10.10.254 | ||
bootstrap_kube_api_hostname: fake | ||
bootstrap_k8s_gateway_addr: 10.10.10.253 | ||
bootstrap_external_ingress_addr: 10.10.10.252 | ||
bootstrap_internal_ingress_addr: 10.10.10.251 | ||
bootstrap_cilium_loadbalancer_mode: dsr | ||
bootstrap_ipv6_enabled: false | ||
bootstrap_cluster_cidr: 10.42.0.0/16 | ||
bootstrap_service_cidr: 10.43.0.0/16 | ||
bootstrap_local_storage_path: /var/openebs/local | ||
bootstrap_nodes: | ||
master: | ||
- name: k8s-0 | ||
address: 10.10.10.100 | ||
username: fake | ||
diskSerial: fake | ||
- name: k8s-1 | ||
address: 10.10.10.101 | ||
username: fake | ||
diskSerial: fake | ||
- name: k8s-2 | ||
address: 10.10.10.102 | ||
username: fake | ||
diskSerial: fake | ||
worker: | ||
- name: k8s-3 | ||
address: 10.10.10.103 | ||
username: fake | ||
diskSerial: fake | ||
- name: k8s-4 | ||
address: 10.10.10.104 | ||
username: fake | ||
diskSerial: fake | ||
- name: k8s-5 | ||
address: 10.10.10.105 | ||
username: fake | ||
diskSerial: fake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
# yaml-language-server: $schema=https://taskfile.dev/schema.json | ||
version: "3" | ||
|
||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
# yaml-language-server: $schema=https://taskfile.dev/schema.json | ||
version: "3" | ||
|
||
vars: | ||
TALOS_DIR: "{{.ROOT_DIR}}/kubernetes/talos" | ||
TALHELPER_SECRET_FILE: "{{.TALOS_DIR}}/talhelper.sops.yaml" | ||
TALHELPER_CONFIG_FILE: "{{.TALOS_DIR}}/talconfig.yaml" | ||
|
||
tasks: | ||
|
||
gensecret: | ||
desc: Generate talos secret | ||
prompt: This will overwrite the existing secret... continue? | ||
dir: "{{.TALOS_DIR}}" | ||
cmds: | ||
- talhelper gensecret > {{.TALHELPER_SECRET_FILE}} | ||
- task: :sops:.encrypt-file | ||
vars: | ||
file: "{{.TALHELPER_SECRET_FILE}}" | ||
preconditions: | ||
- { msg: "Missing talhelper config file", sh: "test -f {{.TALHELPER_CONFIG_FILE}}" } | ||
|
||
genconfig: | ||
desc: Generate talos config | ||
dir: "{{.TALOS_DIR}}" | ||
cmd: talhelper genconfig | ||
preconditions: | ||
- { msg: "Missing talhelper config file", sh: "test -f {{.TALHELPER_CONFIG_FILE}}" } | ||
|
||
apply-config: | ||
desc: Apply talos config on a node | ||
dir: "{{.TALOS_DIR}}" | ||
cmd: talhelper gencommand apply --extra-flags=--insecure | bash | ||
|
||
bootstrap: | ||
desc: Bootstrap the talos cluster | ||
dir: "{{.TALOS_DIR}}" | ||
cmd: talhelper gencommand bootstrap | bash | ||
|
||
kubeconfig: | ||
desc: Generate talos kubeconfig | ||
prompt: This will overwrite the existing kubeconfig... continue? | ||
dir: "{{.TALOS_DIR}}" | ||
cmd: talosctl kubeconfig {{.ROOT_DIR}} --force | ||
|
||
apply-extras: | ||
desc: Apply extras | ||
dir: "{{.TALOS_DIR}}" | ||
cmds: | ||
- kubectl --kubeconfig {{.KUBECONFIG_FILE}} kustomize --enable-helm ./cni | kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename - | ||
- kubectl --kubeconfig {{.KUBECONFIG_FILE}} kustomize --enable-helm ./kubelet-csr-approver | kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename - | ||
preconditions: | ||
- { msg: "Missing kubeconfig", sh: "test -f {{.KUBECONFIG_FILE}}" } | ||
|
||
upgrade-talos: | ||
desc: Upgrade talos on a node | ||
cmd: talosctl --nodes {{.node}} upgrade --image {{.image}} --preserve=true --reboot-mode=powercycle | ||
vars: | ||
image: '{{ or .image (fail "Argument (image) is required") }}' | ||
node: '{{ or .node (fail "Argument (node) is required") }}' | ||
preconditions: | ||
- { msg: "Node not found", sh: "talosctl --nodes {{.node}} get machineconfig" } | ||
|
||
upgrade-k8s: | ||
desc: Upgrade k8s on a node | ||
cmd: talosctl --nodes {{.node}} upgrade-k8s --to {{.to}} | ||
vars: | ||
node: '{{ or .node (fail "Argument (node) is required") }}' | ||
to: '{{ or .to (fail "Argument (to) is required") }}' | ||
preconditions: | ||
- { msg: "Node not found", sh: "talosctl --nodes {{.node}} get machineconfig" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ moreutils | |
sops | ||
stern-bin | ||
talhelper-bin | ||
talosctl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
bootstrap/templates/kubernetes/apps/kube-system/kubelet-csr-approver/app/helmrelease.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#% if bootstrap_distribution == "talos" %# | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2beta2 | ||
kind: HelmRelease | ||
metadata: | ||
name: kubelet-csr-approver | ||
spec: | ||
interval: 30m | ||
chart: | ||
spec: | ||
chart: kubelet-csr-approver | ||
version: 1.0.6 | ||
sourceRef: | ||
kind: HelmRepository | ||
name: postfinance | ||
namespace: flux-system | ||
install: | ||
remediation: | ||
retries: 3 | ||
upgrade: | ||
cleanupOnFail: true | ||
remediation: | ||
retries: 3 | ||
uninstall: | ||
keepHistory: false | ||
values: | ||
providerRegex: | | ||
^k(m|w)\d\d?$ | ||
#% endif %# |
7 changes: 7 additions & 0 deletions
7
...trap/templates/kubernetes/apps/kube-system/kubelet-csr-approver/app/kustomization.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#% if bootstrap_distribution == "talos" %# | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./helmrelease.yaml | ||
#% endif %# |
22 changes: 22 additions & 0 deletions
22
bootstrap/templates/kubernetes/apps/kube-system/kubelet-csr-approver/ks.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#% if bootstrap_distribution == "talos" %# | ||
--- | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app kubelet-csr-approver | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: kube-system | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
path: ./kubernetes/apps/kube-system/kubelet-csr-approver/app | ||
prune: false # never should be deleted | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-kubernetes | ||
wait: false | ||
interval: 30m | ||
retryInterval: 1m | ||
timeout: 5m | ||
#% endif %# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.