feat: replace ansible templating with makejinja (#1156)
This commit is contained in:
1 parent
a4731906d9
commit
f9481d6202
114 files changed
+555
-906
No files matched your search
@@ -6,7 +6,7 @@ PATH_add "$(expand_path ./.venv/bin)"
|
|||||||
export VIRTUAL_ENV="$(expand_path ./.venv)"
|
export VIRTUAL_ENV="$(expand_path ./.venv)"
|
||||||
export ANSIBLE_COLLECTIONS_PATH=$(expand_path ./.venv/galaxy)
|
export ANSIBLE_COLLECTIONS_PATH=$(expand_path ./.venv/galaxy)
|
||||||
export ANSIBLE_ROLES_PATH=$(expand_path ./.venv/galaxy/ansible_roles)
|
export ANSIBLE_ROLES_PATH=$(expand_path ./.venv/galaxy/ansible_roles)
|
||||||
export ANSIBLE_VARS_ENABLED="host_group_vars,community.sops.sops"
|
export ANSIBLE_VARS_ENABLED="host_group_vars"
|
||||||
export ANSIBLE_LOCALHOST_WARNING="False"
|
export ANSIBLE_LOCALHOST_WARNING="False"
|
||||||
export ANSIBLE_INVENTORY_UNPARSED_WARNING="False"
|
export ANSIBLE_INVENTORY_UNPARSED_WARNING="False"
|
||||||
export K8S_AUTH_KUBECONFIG="$(expand_path ./kubeconfig)"
|
export K8S_AUTH_KUBECONFIG="$(expand_path ./kubeconfig)"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ bootstrap_cloudflare_account_tag: fake
|
|||||||
bootstrap_cloudflare_tunnel_secret: fake
|
bootstrap_cloudflare_tunnel_secret: fake
|
||||||
bootstrap_cloudflare_tunnel_id: fake
|
bootstrap_cloudflare_tunnel_id: fake
|
||||||
bootstrap_node_cidr: 10.10.10.0/24
|
bootstrap_node_cidr: 10.10.10.0/24
|
||||||
bootstrap_kubeapi_addr: 10.10.10.254
|
bootstrap_kube_api_addr: 10.10.10.254
|
||||||
bootstrap_k8s_gateway_addr: 10.10.10.253
|
bootstrap_k8s_gateway_addr: 10.10.10.253
|
||||||
bootstrap_external_ingress_addr: 10.10.10.252
|
bootstrap_external_ingress_addr: 10.10.10.252
|
||||||
bootstrap_internal_ingress_addr: 10.10.10.251
|
bootstrap_internal_ingress_addr: 10.10.10.251
|
||||||
@@ -30,7 +30,19 @@ bootstrap_nodes:
|
|||||||
- name: k8s-0
|
- name: k8s-0
|
||||||
address: 10.10.10.100
|
address: 10.10.10.100
|
||||||
username: fake
|
username: fake
|
||||||
worker:
|
|
||||||
- name: k8s-1
|
- name: k8s-1
|
||||||
address: 10.10.10.101
|
address: 10.10.10.101
|
||||||
username: fake
|
username: fake
|
||||||
|
- name: k8s-2
|
||||||
|
address: 10.10.10.102
|
||||||
|
username: fake
|
||||||
|
worker:
|
||||||
|
- name: k8s-3
|
||||||
|
address: 10.10.10.103
|
||||||
|
username: fake
|
||||||
|
- name: k8s-4
|
||||||
|
address: 10.10.10.104
|
||||||
|
username: fake
|
||||||
|
- name: k8s-5
|
||||||
|
address: 10.10.10.105
|
||||||
|
username: fake
|
||||||
@@ -16,7 +16,7 @@ bootstrap_cloudflare_account_tag: fake
|
|||||||
bootstrap_cloudflare_tunnel_secret: fake
|
bootstrap_cloudflare_tunnel_secret: fake
|
||||||
bootstrap_cloudflare_tunnel_id: fake
|
bootstrap_cloudflare_tunnel_id: fake
|
||||||
bootstrap_node_cidr: 10.10.10.0/24
|
bootstrap_node_cidr: 10.10.10.0/24
|
||||||
bootstrap_kubeapi_addr: 10.10.10.254
|
bootstrap_kube_api_addr: 10.10.10.254
|
||||||
bootstrap_k8s_gateway_addr: 10.10.10.253
|
bootstrap_k8s_gateway_addr: 10.10.10.253
|
||||||
bootstrap_external_ingress_addr: 10.10.10.252
|
bootstrap_external_ingress_addr: 10.10.10.252
|
||||||
bootstrap_internal_ingress_addr: 10.10.10.251
|
bootstrap_internal_ingress_addr: 10.10.10.251
|
||||||
@@ -30,7 +30,19 @@ bootstrap_nodes:
|
|||||||
- name: k8s-0
|
- name: k8s-0
|
||||||
address: 10.10.10.100
|
address: 10.10.10.100
|
||||||
username: fake
|
username: fake
|
||||||
worker:
|
|
||||||
- name: k8s-1
|
- name: k8s-1
|
||||||
address: 10.10.10.101
|
address: 10.10.10.101
|
||||||
username: fake
|
username: fake
|
||||||
|
- name: k8s-2
|
||||||
|
address: 10.10.10.102
|
||||||
|
username: fake
|
||||||
|
worker:
|
||||||
|
- name: k8s-3
|
||||||
|
address: 10.10.10.103
|
||||||
|
username: fake
|
||||||
|
- name: k8s-4
|
||||||
|
address: 10.10.10.104
|
||||||
|
username: fake
|
||||||
|
- name: k8s-5
|
||||||
|
address: 10.10.10.105
|
||||||
|
username: fake
|
||||||
@@ -16,7 +16,7 @@ bootstrap_cloudflare_account_tag: fake
|
|||||||
bootstrap_cloudflare_tunnel_secret: fake
|
bootstrap_cloudflare_tunnel_secret: fake
|
||||||
bootstrap_cloudflare_tunnel_id: fake
|
bootstrap_cloudflare_tunnel_id: fake
|
||||||
bootstrap_node_cidr: 10.10.10.0/24
|
bootstrap_node_cidr: 10.10.10.0/24
|
||||||
bootstrap_kubeapi_addr: 10.10.10.254
|
bootstrap_kube_api_addr: 10.10.10.254
|
||||||
bootstrap_k8s_gateway_addr: 10.10.10.253
|
bootstrap_k8s_gateway_addr: 10.10.10.253
|
||||||
bootstrap_external_ingress_addr: 10.10.10.252
|
bootstrap_external_ingress_addr: 10.10.10.252
|
||||||
bootstrap_internal_ingress_addr: 10.10.10.251
|
bootstrap_internal_ingress_addr: 10.10.10.251
|
||||||
@@ -30,7 +30,19 @@ bootstrap_nodes:
|
|||||||
- name: k8s-0
|
- name: k8s-0
|
||||||
address: 10.10.10.100
|
address: 10.10.10.100
|
||||||
username: fake
|
username: fake
|
||||||
worker:
|
|
||||||
- name: k8s-1
|
- name: k8s-1
|
||||||
address: 10.10.10.101
|
address: 10.10.10.101
|
||||||
username: fake
|
username: fake
|
||||||
|
- name: k8s-2
|
||||||
|
address: 10.10.10.102
|
||||||
|
username: fake
|
||||||
|
worker:
|
||||||
|
- name: k8s-3
|
||||||
|
address: 10.10.10.103
|
||||||
|
username: fake
|
||||||
|
- name: k8s-4
|
||||||
|
address: 10.10.10.104
|
||||||
|
username: fake
|
||||||
|
- name: k8s-5
|
||||||
|
address: 10.10.10.105
|
||||||
|
username: fake
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
ci_test: true
|
||||||
|
|
||||||
|
bootstrap_distribution: k3s
|
||||||
|
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: # left blank to not use kube-vip
|
||||||
|
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
|
||||||
@@ -40,6 +40,7 @@ jobs:
|
|||||||
- k0s
|
- k0s
|
||||||
- k3s-ipv4
|
- k3s-ipv4
|
||||||
- k3s-ipv6
|
- k3s-ipv6
|
||||||
|
- k3s-no-kube-vip
|
||||||
addon-files: ["addons"]
|
addon-files: ["addons"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -109,7 +110,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run configure
|
- name: Run configure
|
||||||
shell: bash
|
shell: bash
|
||||||
run: task --yes configure
|
run: task configure --yes
|
||||||
|
|
||||||
- name: Run kubeconform
|
- name: Run kubeconform
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -124,4 +125,4 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
task repo:clean
|
task repo:clean
|
||||||
task --yes repo:reset
|
task repo:reset --yes
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
# Trash
|
# Trash
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ env:
|
|||||||
VIRTUAL_ENV: "{{.ROOT_DIR}}/.venv"
|
VIRTUAL_ENV: "{{.ROOT_DIR}}/.venv"
|
||||||
ANSIBLE_COLLECTIONS_PATH: "{{.ROOT_DIR}}/.venv/galaxy"
|
ANSIBLE_COLLECTIONS_PATH: "{{.ROOT_DIR}}/.venv/galaxy"
|
||||||
ANSIBLE_ROLES_PATH: "{{.ROOT_DIR}}/.venv/galaxy/ansible_roles"
|
ANSIBLE_ROLES_PATH: "{{.ROOT_DIR}}/.venv/galaxy/ansible_roles"
|
||||||
ANSIBLE_VARS_ENABLED: "host_group_vars,community.sops.sops"
|
ANSIBLE_VARS_ENABLED: "host_group_vars"
|
||||||
ANSIBLE_LOCALHOST_WARNING: "False"
|
ANSIBLE_LOCALHOST_WARNING: "False"
|
||||||
ANSIBLE_INVENTORY_UNPARSED_WARNING: "False"
|
ANSIBLE_INVENTORY_UNPARSED_WARNING: "False"
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ tasks:
|
|||||||
kubeconfig:
|
kubeconfig:
|
||||||
desc: Gets k0s cluster kubeconfig
|
desc: Gets k0s cluster kubeconfig
|
||||||
cmds:
|
cmds:
|
||||||
- k0sctl kubeconfig --config k0s-config.yaml > kubeconfig
|
- k0sctl kubeconfig --config {{.ROOT_DIR}}/k0s-config.yaml > kubeconfig
|
||||||
preconditions:
|
preconditions:
|
||||||
- { msg: "k0s-config.yaml not found", sh: "test -f {{.ROOT_DIR}}/k0s-config.yaml" }
|
- { msg: "k0s-config.yaml not found", sh: "test -f {{.ROOT_DIR}}/k0s-config.yaml" }
|
||||||
|
|
||||||
apply:
|
apply:
|
||||||
desc: Apply k0s cluster k0s-config.yaml
|
desc: Apply k0s cluster k0s-config.yaml
|
||||||
cmds:
|
cmds:
|
||||||
- k0sctl apply --config k0s-config.yaml
|
- k0sctl apply --config {{.ROOT_DIR}}/k0s-config.yaml
|
||||||
- task: kubeconfig
|
- task: kubeconfig
|
||||||
preconditions:
|
preconditions:
|
||||||
- { msg: "k0s-config.yaml not found", sh: "test -f {{.ROOT_DIR}}/k0s-config.yaml" }
|
- { msg: "k0s-config.yaml not found", sh: "test -f {{.ROOT_DIR}}/k0s-config.yaml" }
|
||||||
@@ -25,7 +25,7 @@ tasks:
|
|||||||
reset:
|
reset:
|
||||||
desc: Resets the k0s cluster
|
desc: Resets the k0s cluster
|
||||||
cmds:
|
cmds:
|
||||||
- k0sctl reset --config k0s-config.yaml
|
- k0sctl reset --config {{.ROOT_DIR}}/k0s-config.yaml
|
||||||
- task: :ansible:run
|
- task: :ansible:run
|
||||||
vars:
|
vars:
|
||||||
playbook: cluster-nuke
|
playbook: cluster-nuke
|
||||||
|
|||||||
@@ -12,28 +12,28 @@ tasks:
|
|||||||
- rm -rf {{.ROOT_DIR}}/.github/workflows/e2e.yaml
|
- rm -rf {{.ROOT_DIR}}/.github/workflows/e2e.yaml
|
||||||
# Move bootstrap directory to gitignored directory
|
# Move bootstrap directory to gitignored directory
|
||||||
- mkdir -p {{.ROOT_DIR}}/.private
|
- mkdir -p {{.ROOT_DIR}}/.private
|
||||||
- mv {{.ROOT_DIR}}/bootstrap {{.ROOT_DIR}}/.private/bootstrap-{{now | date "150405"}}
|
- mv {{.BOOTSTRAP_DIR}} {{.ROOT_DIR}}/.private/bootstrap-{{now | date "150405"}}
|
||||||
# Update renovate.json5
|
# Update renovate.json5
|
||||||
- sed -i {{if eq OS "darwin"}}''{{end}} 's/(..\.j2)\?(..\.j2)\?//g' {{.ROOT_DIR}}/.github/renovate.json5
|
- sed -i {{if eq OS "darwin"}}''{{end}} 's/(..\.j2)\?(..\.j2)\?//g' {{.ROOT_DIR}}/.github/renovate.json5
|
||||||
- sed -i {{if eq OS "darwin"}}''{{end}} '/addons/d' {{.ROOT_DIR}}/.github/renovate.json5
|
- sed -i {{if eq OS "darwin"}}''{{end}} '/addons/d' {{.ROOT_DIR}}/.github/renovate.json5
|
||||||
preconditions:
|
preconditions:
|
||||||
- { msg: "bootstrap dir not found", sh: "test -d {{.ROOT_DIR}}/bootstrap" }
|
- { msg: "bootstrap dir not found", sh: "test -d {{.BOOTSTRAP_DIR}}" }
|
||||||
- { msg: "renovate.json5 not found", sh: "test -f {{.ROOT_DIR}}/.github/renovate.json5" }
|
- { msg: "renovate.json5 not found", sh: "test -f {{.ROOT_DIR}}/.github/renovate.json5" }
|
||||||
|
|
||||||
reset:
|
reset:
|
||||||
desc: Remove templated configuration files
|
desc: Reset templated configuration files
|
||||||
prompt: Remove templated configuration files... continue?
|
prompt: Reset templated configuration files... continue?
|
||||||
cmds:
|
cmds:
|
||||||
- rm -rf {{.ROOT_DIR}}/.sops.yaml
|
- rm -rf {{.ROOT_DIR}}/.sops.yaml
|
||||||
- rm -rf {{.ROOT_DIR}}/k0s-config.yaml
|
- rm -rf {{.ROOT_DIR}}/k0s-config.yaml
|
||||||
- rm -rf {{.ROOT_DIR}}/ansible
|
- rm -rf {{.ANSIBLE_DIR}}
|
||||||
- rm -rf {{.ROOT_DIR}}/kubernetes
|
- rm -rf {{.KUBERNETES_DIR}}
|
||||||
|
|
||||||
reset-repo:
|
force-reset:
|
||||||
desc: Set repo back to HEAD
|
desc: Reset repo back to HEAD
|
||||||
prompt: Set repo back to HEAD... continue?
|
prompt: Reset repo back to HEAD... continue?
|
||||||
cmds:
|
cmds:
|
||||||
- task: reset
|
- task: reset
|
||||||
- git reset --hard HEAD
|
- git reset --hard HEAD
|
||||||
- git clean -f -d
|
- git clean -f -d
|
||||||
- git pull
|
- git pull origin main
|
||||||
@@ -12,7 +12,6 @@ tasks:
|
|||||||
|
|
||||||
encrypt:
|
encrypt:
|
||||||
desc: Encrypt a secret
|
desc: Encrypt a secret
|
||||||
aliases: ["e"]
|
|
||||||
summary: |
|
summary: |
|
||||||
Args:
|
Args:
|
||||||
file: Path to file to encrypt (required)
|
file: Path to file to encrypt (required)
|
||||||
@@ -23,15 +22,13 @@ tasks:
|
|||||||
- { msg: "Sops config not found", sh: "test -f {{.ROOT_DIR}}/.sops.yaml" }
|
- { msg: "Sops config not found", sh: "test -f {{.ROOT_DIR}}/.sops.yaml" }
|
||||||
- { msg: "Age key not found", sh: "test -f {{.ROOT_DIR}}/age.key" }
|
- { msg: "Age key not found", sh: "test -f {{.ROOT_DIR}}/age.key" }
|
||||||
|
|
||||||
decrypt:
|
encrypt:all:
|
||||||
desc: Decrypt a secret
|
desc: Encrypt all Kubernetes SOPS secrets
|
||||||
aliases: ["d"]
|
cmds:
|
||||||
summary: |
|
- for: { var: file }
|
||||||
Args:
|
task: encrypt
|
||||||
file: Path to file to decrypt (required)
|
vars:
|
||||||
cmd: sops --decrypt --in-place {{.SECRET}}
|
file: '{{.ITEM}}'
|
||||||
vars:
|
vars:
|
||||||
claim: '{{ or .file (fail "Argument (file) is required") }}'
|
file:
|
||||||
preconditions:
|
sh: find {{.KUBERNETES_DIR}} -type f -name "*.sops.*"
|
||||||
- { msg: "Sops config not found", sh: "test -f {{.ROOT_DIR}}/.sops.yaml" }
|
|
||||||
- { msg: "Age key not found", sh: "test -f {{.ROOT_DIR}}/age.key" }
|
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
age
|
age
|
||||||
cilium-cli
|
|
||||||
cloudflared-bin
|
cloudflared-bin
|
||||||
direnv
|
direnv
|
||||||
flux-bin
|
flux-bin
|
||||||
|
go-task
|
||||||
|
go-yq
|
||||||
helm
|
helm
|
||||||
jq
|
jq
|
||||||
k0sctl-bin
|
k0sctl-bin
|
||||||
k9s
|
|
||||||
kubeconform
|
kubeconform
|
||||||
kubectl-bin
|
kubectl-bin
|
||||||
kustomize
|
kustomize
|
||||||
moreutils
|
moreutils
|
||||||
sops
|
sops
|
||||||
stern-bin
|
stern-bin
|
||||||
go-task
|
|
||||||
go-yq
|
|
||||||
@@ -1,18 +1,15 @@
|
|||||||
tap "fluxcd/tap"
|
tap "fluxcd/tap"
|
||||||
tap "go-task/tap"
|
tap "go-task/tap"
|
||||||
tap "k0sproject/tap"
|
tap "k0sproject/tap"
|
||||||
tap "kubecolor/tap"
|
|
||||||
brew "age"
|
brew "age"
|
||||||
brew "cilium-cli"
|
|
||||||
brew "cloudflared"
|
brew "cloudflared"
|
||||||
brew "direnv"
|
brew "direnv"
|
||||||
brew "fluxcd/tap/flux"
|
brew "fluxcd/tap/flux"
|
||||||
|
brew "go-task/tap/go-task"
|
||||||
brew "helm"
|
brew "helm"
|
||||||
brew "jq"
|
brew "jq"
|
||||||
brew "k0sproject/tap/k0sctl"
|
brew "k0sproject/tap/k0sctl"
|
||||||
brew "k9s"
|
|
||||||
brew "kubeconform"
|
brew "kubeconform"
|
||||||
brew "kubecolor/tap/kubecolor"
|
|
||||||
brew "kubernetes-cli"
|
brew "kubernetes-cli"
|
||||||
brew "kustomize"
|
brew "kustomize"
|
||||||
brew "moreutils"
|
brew "moreutils"
|
||||||
|
|||||||
@@ -14,8 +14,18 @@ tasks:
|
|||||||
Head over to https://brew.sh to get up and running.
|
Head over to https://brew.sh to get up and running.
|
||||||
- { msg: "Brewfile not found", sh: "test -f {{.ROOT_DIR}}/.taskfiles/Workstation/Brewfile" }
|
- { msg: "Brewfile not found", sh: "test -f {{.ROOT_DIR}}/.taskfiles/Workstation/Brewfile" }
|
||||||
|
|
||||||
yay:
|
paru:
|
||||||
desc: Install workstation dependencies with Paru
|
desc: Install workstation dependencies with Paru
|
||||||
|
cmd: paru -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages | xargs)
|
||||||
|
preconditions:
|
||||||
|
- sh: command -v paru
|
||||||
|
msg: |
|
||||||
|
Paru is not installed. Using ArchLinux?
|
||||||
|
Head over to https://github.com/Morganamilo/paru to get up and running.
|
||||||
|
- { msg: "ArchPackages not found", sh: "test -f {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages" }
|
||||||
|
|
||||||
|
yay:
|
||||||
|
desc: Install workstation dependencies with Yay
|
||||||
cmd: yay -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages | xargs)
|
cmd: yay -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages | xargs)
|
||||||
preconditions:
|
preconditions:
|
||||||
- sh: command -v yay
|
- sh: command -v yay
|
||||||
|
|||||||
+28
-1
@@ -47,6 +47,33 @@ tasks:
|
|||||||
configure:
|
configure:
|
||||||
desc: Configure repository from Ansible vars
|
desc: Configure repository from Ansible vars
|
||||||
prompt: Any conflicting config in the root kubernetes and ansible directories will be overwritten... continue?
|
prompt: Any conflicting config in the root kubernetes and ansible directories will be overwritten... continue?
|
||||||
cmd: ./.venv/bin/ansible-playbook {{.BOOTSTRAP_DIR}}/configure.yaml
|
cmds:
|
||||||
|
- task: .validate
|
||||||
|
- task: .template
|
||||||
|
- task: sops:encrypt:all
|
||||||
|
|
||||||
|
.validate:
|
||||||
|
internal: true
|
||||||
|
cmd: ./.venv/bin/ansible-playbook {{.BOOTSTRAP_DIR}}/validate.yaml
|
||||||
env:
|
env:
|
||||||
ANSIBLE_DISPLAY_SKIPPED_HOSTS: "false"
|
ANSIBLE_DISPLAY_SKIPPED_HOSTS: "false"
|
||||||
|
preconditions:
|
||||||
|
- { msg: "addons file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/addons.yaml" }
|
||||||
|
- { msg: "config file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/config.yaml" }
|
||||||
|
|
||||||
|
.template:
|
||||||
|
internal: true
|
||||||
|
cmds:
|
||||||
|
- ./.venv/bin/makejinja
|
||||||
|
--input "{{.BOOTSTRAP_DIR}}/templates"
|
||||||
|
--output "{{.ROOT_DIR}}"
|
||||||
|
--data "{{.BOOTSTRAP_DIR}}/vars/config.yaml"
|
||||||
|
--data "{{.BOOTSTRAP_DIR}}/vars/addons.yaml"
|
||||||
|
--import-path "{{.BOOTSTRAP_DIR}}/scripts"
|
||||||
|
--loader "loader:Loader"
|
||||||
|
--jinja-suffix ".j2" --quiet --force
|
||||||
|
- find {{.ANSIBLE_DIR}} {{.KUBERNETES_DIR}} -type d -empty -delete
|
||||||
|
preconditions:
|
||||||
|
- { msg: "addons file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/addons.yaml" }
|
||||||
|
- { msg: "config file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/config.yaml" }
|
||||||
|
- { msg: "loader file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/scripts/loader.py" }
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Cluster Installation
|
|
||||||
hosts: localhost
|
|
||||||
connection: local
|
|
||||||
gather_facts: false
|
|
||||||
vars_files:
|
|
||||||
- vars/config.yaml
|
|
||||||
- vars/addons.yaml
|
|
||||||
tasks:
|
|
||||||
- name: Get absolute path to this Git repository # noqa: command-instead-of-module
|
|
||||||
ansible.builtin.command: git rev-parse --show-toplevel
|
|
||||||
changed_when: false
|
|
||||||
check_mode: false
|
|
||||||
register: repository
|
|
||||||
failed_when: repository.rc != 0
|
|
||||||
|
|
||||||
- name: Set facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
repository_path: "{{ repository.stdout }}"
|
|
||||||
|
|
||||||
- name: Override kubeapi address when there is a single master node and no address is defined
|
|
||||||
when: bootstrap_nodes.master | length == 1 and not bootstrap_kubeapi_addr
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
bootstrap_kube_vip_enabled: false
|
|
||||||
bootstrap_kubeapi_addr: "{{ bootstrap_nodes.master[0].address }}"
|
|
||||||
|
|
||||||
- name: Verify configuration
|
|
||||||
ansible.builtin.include_tasks: tasks/validation/main.yaml
|
|
||||||
|
|
||||||
- name: Template Sops configuration
|
|
||||||
ansible.builtin.include_tasks: tasks/sops/main.yaml
|
|
||||||
|
|
||||||
- name: Template k0s configuration
|
|
||||||
when: bootstrap_distribution == "k0s"
|
|
||||||
ansible.builtin.include_tasks: tasks/k0s/main.yaml
|
|
||||||
|
|
||||||
- name: Template Ansible configuration
|
|
||||||
when: bootstrap_distribution == "k0s" or bootstrap_distribution == "k3s"
|
|
||||||
ansible.builtin.include_tasks: tasks/ansible/main.yaml
|
|
||||||
|
|
||||||
- name: Template Kubernetes configuration
|
|
||||||
ansible.builtin.include_tasks: tasks/kubernetes/main.yaml
|
|
||||||
|
|
||||||
- name: Template Kubernetes addon configuration
|
|
||||||
ansible.builtin.include_tasks: tasks/addons/main.yaml
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import netaddr, bcrypt
|
||||||
|
|
||||||
|
def nthhost(value: str, query: int) -> str:
|
||||||
|
value = netaddr.IPNetwork(value)
|
||||||
|
|
||||||
|
try:
|
||||||
|
nth = int(query)
|
||||||
|
if value.size > nth:
|
||||||
|
return str(value[nth])
|
||||||
|
|
||||||
|
except ValueError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
return value
|
||||||
|
|
||||||
|
def encrypt(value: str) -> str:
|
||||||
|
return bcrypt.hashpw(value.encode(), bcrypt.gensalt(rounds=10)).decode("ascii")
|
||||||
|
|
||||||
|
class Loader:
|
||||||
|
def filters(self):
|
||||||
|
return [nthhost, encrypt]
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: coredns
|
|
||||||
addon_namespace: kube-system
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: csi-driver-nfs
|
|
||||||
addon_namespace: storage
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: discord-template-notifier
|
|
||||||
addon_namespace: default
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: grafana
|
|
||||||
addon_namespace: observability
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: homepage
|
|
||||||
addon_namespace: default
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: kube-prometheus-stack
|
|
||||||
addon_namespace: observability
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: kubernetes-dashboard
|
|
||||||
addon_namespace: observability
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
- name: Process optional coredns
|
|
||||||
when: bootstrap_distribution == "k3s"
|
|
||||||
ansible.builtin.include_tasks: coredns.yaml
|
|
||||||
|
|
||||||
- name: Process addon csi-driver-nfs
|
|
||||||
when: csi_driver_nfs.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: csi_driver_nfs.yaml
|
|
||||||
|
|
||||||
- name: Process addon homepage
|
|
||||||
when: homepage.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: homepage.yaml
|
|
||||||
|
|
||||||
- name: Process addon grafana
|
|
||||||
when: grafana.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: grafana.yaml
|
|
||||||
|
|
||||||
- name: Process addon kubernetes-dashboard
|
|
||||||
when: kubernetes_dashboard.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: kubernetes_dashboard.yaml
|
|
||||||
|
|
||||||
- name: Process addon kube-prometheus-stack
|
|
||||||
when: kube_prometheus_stack.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: kube_prometheus_stack.yaml
|
|
||||||
|
|
||||||
- name: Process addon system-upgrade-controller
|
|
||||||
when:
|
|
||||||
- bootstrap_distribution == "k3s"
|
|
||||||
- system_upgrade_controller.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: system_upgrade_controller.yaml
|
|
||||||
|
|
||||||
- name: Process addon weave-gitops
|
|
||||||
when: weave_gitops.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: weave_gitops.yaml
|
|
||||||
|
|
||||||
- name: Process addon discord-template-notifier
|
|
||||||
when: discord_template_notifier.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: discord_template_notifier.yaml
|
|
||||||
|
|
||||||
- name: Process addon volsync
|
|
||||||
when: volsync.enabled | default(false)
|
|
||||||
ansible.builtin.include_tasks: volsync.yaml
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: system-upgrade-controller
|
|
||||||
addon_namespace: tools
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: volsync
|
|
||||||
addon_namespace: storage
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set addon facts
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
addon_name: weave-gitops
|
|
||||||
addon_namespace: flux-system
|
|
||||||
|
|
||||||
- name: Ensure directories exist for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template unencrypted files for {{ addon_namespace }}/{{ addon_name }}
|
|
||||||
when: item.state == 'file' and 'sops' not in item.path
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template encrypted files
|
|
||||||
when: item.state == 'file' and 'sops' in item.path
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/apps/{{ addon_namespace }}/{{ addon_name }}/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/addons/{{ addon_name }}/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure Ansible k3s directories exist
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/ansible/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree:
|
|
||||||
- "../templates/ansible/shared/"
|
|
||||||
- "../templates/ansible/{{ bootstrap_distribution }}/"
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template Ansible unencrypted files
|
|
||||||
when:
|
|
||||||
- "item.state == 'file'"
|
|
||||||
- "'sops' not in item.path"
|
|
||||||
- "'.DS_Store' not in item.path"
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/ansible/{{ item.path | regex_replace('.j2$', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree:
|
|
||||||
- "../templates/ansible/shared/"
|
|
||||||
- "../templates/ansible/{{ bootstrap_distribution }}/"
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template Ansible encrypted files
|
|
||||||
when:
|
|
||||||
- "item.state == 'file'"
|
|
||||||
- "'sops' in item.path"
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/ansible/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree:
|
|
||||||
- "../templates/ansible/shared/"
|
|
||||||
- "../templates/ansible/{{ bootstrap_distribution }}/"
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Template k0s configuration file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "templates/k0s/k0s-config.yaml.j2"
|
|
||||||
dest: "{{ repository_path }}/k0s-config.yaml"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure Kubernetes directories exist
|
|
||||||
when: item.state == 'directory'
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ repository_path }}/kubernetes/{{ item.path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
with_community.general.filetree: ["../templates/kubernetes/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template Kubernetes unencrypted files
|
|
||||||
when:
|
|
||||||
- "item.state == 'file'"
|
|
||||||
- "'.DS_Store' not in item.path"
|
|
||||||
- "'sops' not in item.path"
|
|
||||||
- "'cluster-settings-user.yaml.j2' not in item.path"
|
|
||||||
- "'cluster-secrets-user.yaml.j2' not in item.path"
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/kubernetes/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Check if the cluster user settings file already exists
|
|
||||||
stat:
|
|
||||||
path: "{{ repository_path }}/kubernetes/flux/vars/cluster-settings-user.yaml"
|
|
||||||
register: cluster_settings_user
|
|
||||||
|
|
||||||
- name: Template Kubernetes user cluster settings
|
|
||||||
when:
|
|
||||||
- "item.state == 'file'"
|
|
||||||
- "'cluster-settings-user.yaml' in item.path"
|
|
||||||
- "not cluster_settings_user.stat.exists"
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/kubernetes/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Check if the cluster user secrets file already exists
|
|
||||||
stat:
|
|
||||||
path: "{{ repository_path }}/kubernetes/flux/vars/cluster-secrets-user.yaml"
|
|
||||||
register: cluster_secrets_user
|
|
||||||
|
|
||||||
- name: Template Kubernetes user cluster secrets
|
|
||||||
when:
|
|
||||||
- "item.state == 'file'"
|
|
||||||
- "'cluster-secrets-user.yaml' in item.path"
|
|
||||||
- "not cluster_secrets_user.stat.exists"
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ repository_path }}/kubernetes/{{ item.path | regex_replace('.j2$', '') }}"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
with_community.general.filetree: ["../templates/kubernetes/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
|
|
||||||
- name: Template Kubernetes encrypted files
|
|
||||||
when:
|
|
||||||
- "item.state == 'file'"
|
|
||||||
- "'sops' in item.path"
|
|
||||||
community.sops.sops_encrypt:
|
|
||||||
path: "{{ repository_path }}/kubernetes/{{ item.path | replace('.j2', '') }}"
|
|
||||||
encrypted_regex: ^(data|stringData)$
|
|
||||||
age: ["{{ bootstrap_age_public_key }}"]
|
|
||||||
content_yaml: "{{ lookup('ansible.builtin.template', item.src, lstrip_blocks=true) | from_yaml }}"
|
|
||||||
mode: "0644"
|
|
||||||
force: true
|
|
||||||
with_community.general.filetree: ["../templates/kubernetes/"]
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.path }}"
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Template Sops configuration file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "templates/.sops.yaml.j2"
|
|
||||||
dest: "{{ repository_path }}/.sops.yaml"
|
|
||||||
mode: "0644"
|
|
||||||
lstrip_blocks: true
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: Check for required CLI tools
|
- name: Check if required CLI tools are present
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
command -v {{ item }} >/dev/null 2>&1
|
command -v {{ item }} >/dev/null 2>&1
|
||||||
loop: [age, cloudflared, flux, sops, kubeconform, kustomize, jq]
|
loop: [age, cloudflared, flux, sops, jq]
|
||||||
changed_when: false
|
changed_when: false
|
||||||
check_mode: false
|
check_mode: false
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
- name: Verify master node count
|
- name: Check that master node count is odd
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- bootstrap_nodes.master | length > 0
|
- bootstrap_nodes.master | length > 0
|
||||||
@@ -14,27 +14,27 @@
|
|||||||
success_msg: Master node count {{ bootstrap_nodes.master | length }} is correct.
|
success_msg: Master node count {{ bootstrap_nodes.master | length }} is correct.
|
||||||
fail_msg: Master node count {{ bootstrap_nodes.master | length }} is not greater than 0 or is not odd.
|
fail_msg: Master node count {{ bootstrap_nodes.master | length }} is not greater than 0 or is not odd.
|
||||||
|
|
||||||
- name: Verify node CIDR
|
- name: Check that node CIDR is ipv4
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_node_cidr is ansible.utils.ipv4
|
that: bootstrap_node_cidr is ansible.utils.ipv4
|
||||||
success_msg: Node CIDR {{ bootstrap_node_cidr }} is valid.
|
success_msg: Node CIDR {{ bootstrap_node_cidr }} is valid.
|
||||||
fail_msg: Node CIDR {{ bootstrap_node_cidr }} is invalid.
|
fail_msg: Node CIDR {{ bootstrap_node_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Verify cluster CIDR is ipv4 OR ipv6
|
- name: Check that cluster CIDR is ipv4 OR ipv6
|
||||||
when: not bootstrap_ipv6_enabled | default(false)
|
when: not bootstrap_ipv6_enabled | default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_cluster_cidr is ansible.utils.ipv4 or bootstrap_cluster_cidr is ansible.utils.ipv6
|
that: bootstrap_cluster_cidr is ansible.utils.ipv4 or bootstrap_cluster_cidr is ansible.utils.ipv6
|
||||||
success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
||||||
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Verify service CIDR is ipv4 OR ipv6
|
- name: Check that service CIDR is ipv4 OR ipv6
|
||||||
when: not bootstrap_ipv6_enabled | default(false)
|
when: not bootstrap_ipv6_enabled | default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_service_cidr is ansible.utils.ipv4 or bootstrap_service_cidr is ansible.utils.ipv6
|
that: bootstrap_service_cidr is ansible.utils.ipv4 or bootstrap_service_cidr is ansible.utils.ipv6
|
||||||
success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
||||||
fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Verify cluster CIDR is ipv4 AND ipv6
|
- name: Check that cluster CIDR is ipv4 AND ipv6
|
||||||
when: bootstrap_ipv6_enabled | default(false)
|
when: bootstrap_ipv6_enabled | default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
||||||
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Verify service CIDR is ipv4 AND ipv6
|
- name: Check that service CIDR is ipv4 AND ipv6
|
||||||
when: bootstrap_ipv6_enabled | default(false)
|
when: bootstrap_ipv6_enabled | default(false)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
@@ -62,67 +62,67 @@
|
|||||||
success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
||||||
fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
||||||
|
|
||||||
- name: Verify k8s_gateway
|
- name: Check that k8s_gateway is ipv4
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_k8s_gateway_addr is ansible.utils.ipv4
|
that: bootstrap_k8s_gateway_addr is ansible.utils.ipv4
|
||||||
success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is valid.
|
success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is valid.
|
||||||
fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is invalid.
|
fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is invalid.
|
||||||
|
|
||||||
- name: Verify k8s_gateway in node CIDR
|
- name: Check that k8s_gateway is in node CIDR
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_k8s_gateway_addr)
|
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_k8s_gateway_addr)
|
||||||
success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is within {{ bootstrap_node_cidr }}.
|
success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is within {{ bootstrap_node_cidr }}.
|
||||||
fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is not within {{ bootstrap_node_cidr }}.
|
fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is not within {{ bootstrap_node_cidr }}.
|
||||||
|
|
||||||
- name: Verify internal ingress
|
- name: Check that internal ingress is ipv4
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_internal_ingress_addr is ansible.utils.ipv4
|
that: bootstrap_internal_ingress_addr is ansible.utils.ipv4
|
||||||
success_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is valid.
|
success_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is valid.
|
||||||
fail_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is invalid.
|
fail_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is invalid.
|
||||||
|
|
||||||
- name: Verify internal ingress in node CIDR
|
- name: Check that internal ingress is in node CIDR
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_internal_ingress_addr)
|
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_internal_ingress_addr)
|
||||||
success_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is within {{ bootstrap_node_cidr }}.
|
success_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is within {{ bootstrap_node_cidr }}.
|
||||||
fail_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is not within {{ bootstrap_node_cidr }}.
|
fail_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is not within {{ bootstrap_node_cidr }}.
|
||||||
|
|
||||||
- name: Verify external ingress
|
- name: Check that external ingress is ipv4
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_external_ingress_addr is ansible.utils.ipv4
|
that: bootstrap_external_ingress_addr is ansible.utils.ipv4
|
||||||
success_msg: external ingress address {{ bootstrap_external_ingress_addr }} is valid.
|
success_msg: external ingress address {{ bootstrap_external_ingress_addr }} is valid.
|
||||||
fail_msg: external ingress address {{ bootstrap_external_ingress_addr }} is invalid.
|
fail_msg: external ingress address {{ bootstrap_external_ingress_addr }} is invalid.
|
||||||
|
|
||||||
- name: Verify external ingress in node CIDR
|
- name: Check external ingress is in node CIDR
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_external_ingress_addr)
|
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_external_ingress_addr)
|
||||||
success_msg: external ingress address {{ bootstrap_external_ingress_addr }} is within {{ bootstrap_node_cidr }}.
|
success_msg: external ingress address {{ bootstrap_external_ingress_addr }} is within {{ bootstrap_node_cidr }}.
|
||||||
fail_msg: external ingress address {{ bootstrap_external_ingress_addr }} is not within {{ bootstrap_node_cidr }}.
|
fail_msg: external ingress address {{ bootstrap_external_ingress_addr }} is not within {{ bootstrap_node_cidr }}.
|
||||||
|
|
||||||
- name: Verify kubeapi address
|
- name: Check that Kube API address is ipv4
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_kubeapi_addr is ansible.utils.ipv4
|
that: bootstrap_kube_api_addr is ansible.utils.ipv4
|
||||||
success_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is valid.
|
success_msg: Kube API address {{ bootstrap_kube_api_addr }} is valid.
|
||||||
fail_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is invalid.
|
fail_msg: Kube API address {{ bootstrap_kube_api_addr }} is invalid.
|
||||||
|
|
||||||
- name: Verify kubeapi address in node CIDR
|
- name: Check that Kube API address is in node CIDR
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_kubeapi_addr)
|
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_kube_api_addr)
|
||||||
success_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is within {{ bootstrap_node_cidr }}.
|
success_msg: Kube API address {{ bootstrap_kube_api_addr }} is within {{ bootstrap_node_cidr }}.
|
||||||
fail_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is not within {{ bootstrap_node_cidr }}.
|
fail_msg: Kube API address {{ bootstrap_kube_api_addr }} is not within {{ bootstrap_node_cidr }}.
|
||||||
|
|
||||||
- name: Verify all IP addresses are unique
|
- name: Check that all IP addresses are unique
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
[
|
[
|
||||||
bootstrap_k8s_gateway_addr,
|
bootstrap_k8s_gateway_addr,
|
||||||
bootstrap_external_ingress_addr,
|
bootstrap_external_ingress_addr,
|
||||||
bootstrap_internal_ingress_addr,
|
bootstrap_internal_ingress_addr,
|
||||||
bootstrap_kubeapi_addr
|
bootstrap_kube_api_addr
|
||||||
] | unique | length == 4
|
] | unique | length == 4
|
||||||
success_msg: All IP addresses are unique.
|
success_msg: All IP addresses are unique.
|
||||||
fail_msg: All IP addresses are not unique.
|
fail_msg: All IP addresses are not unique.
|
||||||
|
|
||||||
- name: Verify nodes are not the same IPs as k8s_gateway or ingress external/internal
|
- name: Check that nodes are not the same IPs as k8s_gateway or ingress external/internal
|
||||||
when: not bootstrap_kube_vip_enabled | default(true)
|
when: not bootstrap_kube_vip_enabled | default(true)
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr)
|
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr)
|
||||||
@@ -133,18 +133,18 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
- name: Verify nodes are not the same IPs as k8s_gateway, ingress external/internal or kubeapi address
|
- name: Check that nodes are not the same IPs as k8s_gateway, ingress external/internal or Kube API address
|
||||||
when: (bootstrap_distribution == "k3s") and (bootstrap_kube_vip_enabled | default(true))
|
when: (bootstrap_distribution == "k3s") and (bootstrap_kube_vip_enabled | default(true))
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr, bootstrap_kubeapi_addr)
|
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr, bootstrap_kube_api_addr)
|
||||||
success_msg: Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or kubeapi.
|
success_msg: Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or Kube API.
|
||||||
fail_msg: Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or kubeapi.
|
fail_msg: Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or Kube API.
|
||||||
quiet: true
|
quiet: true
|
||||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
- name: Verify nodes are ipv4
|
- name: Check that node addresses are ipv4
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: item.address is ansible.utils.ipv4
|
that: item.address is ansible.utils.ipv4
|
||||||
success_msg: Node address {{ item.address }} is valid.
|
success_msg: Node address {{ item.address }} is valid.
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
- name: Verify nodes are in node CIDR
|
- name: Check that node addresses are in node CIDR
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(item.address)
|
that: bootstrap_node_cidr | ansible.utils.network_in_usable(item.address)
|
||||||
success_msg: Node address {{ item.address }} is within {{ bootstrap_node_cidr }}.
|
success_msg: Node address {{ item.address }} is within {{ bootstrap_node_cidr }}.
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
- name: Verify node IP addresses are unique
|
- name: Check that node IP addresses are unique
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
(
|
(
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
fail_msg: All node IP addresses are not unique.
|
fail_msg: All node IP addresses are not unique.
|
||||||
quiet: true
|
quiet: true
|
||||||
|
|
||||||
- name: Verify node names are unique
|
- name: Check that node names are unique
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >
|
that: >
|
||||||
(
|
(
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
fail_msg: All node names are not unique.
|
fail_msg: All node names are not unique.
|
||||||
quiet: true
|
quiet: true
|
||||||
|
|
||||||
- name: Verify SSH port is reachable
|
- name: Check that nodes SSH ports are reachable
|
||||||
when: not ci_test | default(false)
|
when: not ci_test | default(false)
|
||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: "{{ current_address }}"
|
host: "{{ current_address }}"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Verify required bootstrap vars are set
|
- name: Check that required bootstrap vars are set
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- item in vars
|
- item in vars
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
- bootstrap_internal_ingress_addr
|
- bootstrap_internal_ingress_addr
|
||||||
- bootstrap_ipv6_enabled
|
- bootstrap_ipv6_enabled
|
||||||
- bootstrap_k8s_gateway_addr
|
- bootstrap_k8s_gateway_addr
|
||||||
- bootstrap_kubeapi_addr
|
- bootstrap_kube_api_addr
|
||||||
- bootstrap_local_storage_path
|
- bootstrap_local_storage_path
|
||||||
- bootstrap_node_cidr
|
- bootstrap_node_cidr
|
||||||
- bootstrap_service_cidr
|
- bootstrap_service_cidr
|
||||||
- bootstrap_timezone
|
- bootstrap_timezone
|
||||||
|
|
||||||
- name: Verify bootstrap node names are valid
|
- name: Check that bootstrap node names are valid
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: item.name is match('^[a-z0-9-\.]+$')
|
that: item.name is match('^[a-z0-9-\.]+$')
|
||||||
success_msg: Node name {{ item.name }} is valid
|
success_msg: Node name {{ item.name }} is valid
|
||||||
|
|||||||
@@ -9,8 +9,3 @@ creation_rules:
|
|||||||
key_groups:
|
key_groups:
|
||||||
- age:
|
- age:
|
||||||
- "{{ bootstrap_age_public_key }}"
|
- "{{ bootstrap_age_public_key }}"
|
||||||
# https://github.com/ansible-collections/community.sops/issues/153
|
|
||||||
- path_regex: /dev/stdin
|
|
||||||
key_groups:
|
|
||||||
- age:
|
|
||||||
- "{{ bootstrap_age_public_key }}"
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: kube-prometheus-stack
|
|
||||||
spec:
|
|
||||||
interval: 30m
|
|
||||||
timeout: 15m
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: kube-prometheus-stack
|
|
||||||
version: 55.8.1
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: prometheus-community
|
|
||||||
namespace: flux-system
|
|
||||||
maxHistory: 2
|
|
||||||
install:
|
|
||||||
crds: CreateReplace
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
upgrade:
|
|
||||||
cleanupOnFail: true
|
|
||||||
crds: CreateReplace
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
uninstall:
|
|
||||||
keepHistory: false
|
|
||||||
dependsOn:
|
|
||||||
- name: openebs
|
|
||||||
namespace: storage
|
|
||||||
valuesFrom:
|
|
||||||
- name: kube-prometheus-stack-values
|
|
||||||
kind: ConfigMap
|
|
||||||
valuesKey: values.yaml
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ./helmvalues.yaml
|
|
||||||
- ./helmrelease.yaml
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ./helmrelease.yaml
|
|
||||||
File renamed without changes.
+4
-2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
#
|
#
|
||||||
# Below vars are for the xanmanning.k3s role
|
# Below vars are for the xanmanning.k3s role
|
||||||
@@ -13,12 +14,12 @@ k3s_etcd_datastore: true
|
|||||||
{% else %}
|
{% else %}
|
||||||
k3s_etcd_datastore: false
|
k3s_etcd_datastore: false
|
||||||
{% endif %}
|
{% endif %}
|
||||||
k3s_registration_address: "{% raw %}{{ kubeapi_addr }}{% endraw %}"
|
k3s_registration_address: "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
||||||
# /var/lib/rancher/k3s/server/manifests
|
# /var/lib/rancher/k3s/server/manifests
|
||||||
k3s_server_manifests_templates:
|
k3s_server_manifests_templates:
|
||||||
- custom-cilium-helmchart.yaml.j2
|
- custom-cilium-helmchart.yaml.j2
|
||||||
- custom-coredns-helmchart.yaml.j2
|
- custom-coredns-helmchart.yaml.j2
|
||||||
{% if bootstrap_kube_vip_enabled | default(true) %}
|
{% if bootstrap_nodes.master | length > 1 and not bootstrap_kube_api_addr %}
|
||||||
# /var/lib/rancher/k3s/server/manifests
|
# /var/lib/rancher/k3s/server/manifests
|
||||||
k3s_server_manifests_urls:
|
k3s_server_manifests_urls:
|
||||||
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
|
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
|
||||||
@@ -27,3 +28,4 @@ k3s_server_manifests_urls:
|
|||||||
k3s_server_pod_manifests_templates:
|
k3s_server_pod_manifests_templates:
|
||||||
- kube-vip-static-pod.yaml.j2
|
- kube-vip-static-pod.yaml.j2
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
+6
-2
@@ -1,8 +1,12 @@
|
|||||||
---
|
---
|
||||||
timezone: "{{ bootstrap_timezone }}"
|
timezone: "{{ bootstrap_timezone }}"
|
||||||
github_username: "{{ bootstrap_github_username }}"
|
github_username: "{{ bootstrap_github_username }}"
|
||||||
coredns_addr: "{{ bootstrap_service_cidr.split(',')[0] | ansible.utils.nthhost(10) }}"
|
coredns_addr: "{{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }}"
|
||||||
kubeapi_addr: "{{ bootstrap_kubeapi_addr }}"
|
{% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %}
|
||||||
|
kube_api_addr: "{{ bootstrap_nodes.master[0].address }}"
|
||||||
|
{% else %}
|
||||||
|
kube_api_addr: "{{ bootstrap_kube_api_addr }}"
|
||||||
|
{% endif %}
|
||||||
cluster_cidr: "{{ bootstrap_cluster_cidr.split(',')[0] }}"
|
cluster_cidr: "{{ bootstrap_cluster_cidr.split(',')[0] }}"
|
||||||
service_cidr: "{{ bootstrap_service_cidr.split(',')[0] }}"
|
service_cidr: "{{ bootstrap_service_cidr.split(',')[0] }}"
|
||||||
node_cidr: "{{ bootstrap_node_cidr }}"
|
node_cidr: "{{ bootstrap_node_cidr }}"
|
||||||
+9
-7
@@ -1,16 +1,17 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
|
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
|
||||||
# https://github.com/PyratLabs/ansible-role-k3s
|
# https://github.com/PyratLabs/ansible-role-k3s
|
||||||
|
|
||||||
k3s_control_node: true
|
k3s_control_node: true
|
||||||
k3s_server:
|
k3s_server:
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
|
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
|
||||||
{% else %}
|
{% else %}
|
||||||
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
|
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
tls-san:
|
tls-san:
|
||||||
- "{% raw %}{{ kubeapi_addr }}{% endraw %}"
|
- "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
||||||
docker: false
|
docker: false
|
||||||
flannel-backend: "none" # This needs to be in quotes
|
flannel-backend: "none" # This needs to be in quotes
|
||||||
disable:
|
disable:
|
||||||
@@ -26,13 +27,13 @@ k3s_server:
|
|||||||
write-kubeconfig-mode: "644"
|
write-kubeconfig-mode: "644"
|
||||||
pause-image: registry.k8s.io/pause:3.9
|
pause-image: registry.k8s.io/pause:3.9
|
||||||
secrets-encryption: true
|
secrets-encryption: true
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
cluster-cidr: "{% raw %}{{ cluster_cidr }},{{ cluster_cidr_v6 }}{% endraw %}"
|
cluster-cidr: "{% raw %}{{ cluster_cidr }},{{ cluster_cidr_v6 }}{% endraw %}"
|
||||||
service-cidr: "{% raw %}{{ service_cidr }},{{ service_cidr_v6 }}{% endraw %}"
|
service-cidr: "{% raw %}{{ service_cidr }},{{ service_cidr_v6 }}{% endraw %}"
|
||||||
{% else %}
|
{% else %}
|
||||||
cluster-cidr: "{% raw %}{{ cluster_cidr }}{% endraw %}"
|
cluster-cidr: "{% raw %}{{ cluster_cidr }}{% endraw %}"
|
||||||
service-cidr: "{% raw %}{{ service_cidr }}{% endraw %}"
|
service-cidr: "{% raw %}{{ service_cidr }}{% endraw %}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
etcd-expose-metrics: true # Required to monitor etcd with kube-prometheus-stack
|
etcd-expose-metrics: true # Required to monitor etcd with kube-prometheus-stack
|
||||||
kube-controller-manager-arg:
|
kube-controller-manager-arg:
|
||||||
- "bind-address=0.0.0.0" # Required to monitor kube-controller-manager with kube-prometheus-stack
|
- "bind-address=0.0.0.0" # Required to monitor kube-controller-manager with kube-prometheus-stack
|
||||||
@@ -44,3 +45,4 @@ k3s_server:
|
|||||||
kubelet-arg:
|
kubelet-arg:
|
||||||
- "image-gc-high-threshold=55"
|
- "image-gc-high-threshold=55"
|
||||||
- "image-gc-low-threshold=50"
|
- "image-gc-low-threshold=50"
|
||||||
|
{% endif %}
|
||||||
+5
-3
@@ -1,16 +1,18 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
|
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
|
||||||
# https://github.com/PyratLabs/ansible-role-k3s
|
# https://github.com/PyratLabs/ansible-role-k3s
|
||||||
|
|
||||||
k3s_control_node: false
|
k3s_control_node: false
|
||||||
k3s_agent:
|
k3s_agent:
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
|
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
|
||||||
{% else %}
|
{% else %}
|
||||||
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
|
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
pause-image: registry.k8s.io/pause:3.9
|
pause-image: registry.k8s.io/pause:3.9
|
||||||
# TODO: Move these options to a kubelet config file
|
# TODO: Move these options to a kubelet config file
|
||||||
kubelet-arg:
|
kubelet-arg:
|
||||||
- "image-gc-high-threshold=55"
|
- "image-gc-high-threshold=55"
|
||||||
- "image-gc-low-threshold=50"
|
- "image-gc-low-threshold=50"
|
||||||
|
{% endif %}
|
||||||
File renamed without changes.
Whitespace-only changes.
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
- name: Cluster Installation
|
- name: Cluster Installation
|
||||||
hosts: kubernetes
|
hosts: kubernetes
|
||||||
@@ -59,3 +60,4 @@
|
|||||||
- name: Cruft
|
- name: Cruft
|
||||||
when: k3s_primary_control_node
|
when: k3s_primary_control_node
|
||||||
ansible.builtin.include_tasks: tasks/cruft.yaml
|
ansible.builtin.include_tasks: tasks/cruft.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
- name: Cluster kube-vip
|
- name: Cluster kube-vip
|
||||||
hosts: master
|
hosts: master
|
||||||
@@ -22,3 +23,4 @@
|
|||||||
src: templates/kube-vip-static-pod.yaml.j2
|
src: templates/kube-vip-static-pod.yaml.j2
|
||||||
dest: "{% raw %}{{ k3s_server_pod_manifests_dir }}{% endraw %}/kube-vip-static-pod.yaml"
|
dest: "{% raw %}{{ k3s_server_pod_manifests_dir }}{% endraw %}/kube-vip-static-pod.yaml"
|
||||||
mode: preserve
|
mode: preserve
|
||||||
|
{% endif %}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
- name: Cilium
|
- name: Cilium
|
||||||
block:
|
block:
|
||||||
@@ -54,3 +55,4 @@
|
|||||||
definition:
|
definition:
|
||||||
metadata:
|
metadata:
|
||||||
finalizers: []
|
finalizers: []
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
- name: Coredns
|
- name: Coredns
|
||||||
block:
|
block:
|
||||||
@@ -54,3 +55,4 @@
|
|||||||
definition:
|
definition:
|
||||||
metadata:
|
metadata:
|
||||||
finalizers: []
|
finalizers: []
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
# https://github.com/k3s-io/k3s/issues/1971
|
# https://github.com/k3s-io/k3s/issues/1971
|
||||||
- name: Cruft
|
- name: Cruft
|
||||||
@@ -30,3 +31,4 @@
|
|||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{% raw %}{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}{% endraw %}"
|
loop: "{% raw %}{{ addons_list.resources | selectattr('metadata.name', 'match', '^custom-.*') | list }}{% endraw %}"
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
- name: Get absolute path to this Git repository # noqa: command-instead-of-module
|
- name: Get absolute path to this Git repository # noqa: command-instead-of-module
|
||||||
ansible.builtin.command: git rev-parse --show-toplevel
|
ansible.builtin.command: git rev-parse --show-toplevel
|
||||||
@@ -24,3 +25,4 @@
|
|||||||
path: "{% raw %}{{ repository_path.stdout }}{% endraw %}/kubeconfig"
|
path: "{% raw %}{{ repository_path.stdout }}{% endraw %}/kubeconfig"
|
||||||
regexp: https://127.0.0.1:6443
|
regexp: https://127.0.0.1:6443
|
||||||
replace: "https://{% raw %}{{ k3s_registration_address }}{% endraw %}:6443"
|
replace: "https://{% raw %}{{ k3s_registration_address }}{% endraw %}:6443"
|
||||||
|
{% endif %}
|
||||||
+3
-1
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
# https://docs.k3s.io/helm
|
# https://docs.k3s.io/helm
|
||||||
apiVersion: helm.cattle.io/v1
|
apiVersion: helm.cattle.io/v1
|
||||||
@@ -36,7 +37,7 @@ spec:
|
|||||||
ipv6:
|
ipv6:
|
||||||
enabled: true
|
enabled: true
|
||||||
{% endif %}
|
{% endif %}
|
||||||
k8sServiceHost: "{% raw %}{{ kubeapi_addr }}{% endraw %}"
|
k8sServiceHost: "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
||||||
k8sServicePort: 6443
|
k8sServicePort: 6443
|
||||||
kubeProxyReplacement: true
|
kubeProxyReplacement: true
|
||||||
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
||||||
@@ -61,3 +62,4 @@ spec:
|
|||||||
routingMode: native
|
routingMode: native
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' %}
|
||||||
---
|
---
|
||||||
# https://docs.k3s.io/helm
|
# https://docs.k3s.io/helm
|
||||||
apiVersion: helm.cattle.io/v1
|
apiVersion: helm.cattle.io/v1
|
||||||
@@ -75,3 +76,4 @@ spec:
|
|||||||
labelSelector:
|
labelSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/instance: coredns
|
app.kubernetes.io/instance: coredns
|
||||||
|
{% endif %}
|
||||||
+3
-1
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k3s' and bootstrap_nodes.master | length > 1 and not bootstrap_kube_api_addr %}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
@@ -15,7 +16,7 @@ spec:
|
|||||||
args: ["manager"]
|
args: ["manager"]
|
||||||
env:
|
env:
|
||||||
- name: address
|
- name: address
|
||||||
value: "{% raw %}{{ kubeapi_addr }}{% endraw %}"
|
value: "{% raw %}{{ kube_api_addr }}{% endraw %}"
|
||||||
- name: vip_arp
|
- name: vip_arp
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: lb_enable
|
- name: lb_enable
|
||||||
@@ -57,3 +58,4 @@ spec:
|
|||||||
- name: kubeconfig
|
- name: kubeconfig
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /etc/rancher/k3s/k3s.yaml
|
path: /etc/rancher/k3s/k3s.yaml
|
||||||
|
{% endif %}
|
||||||
Whitespace-only changes.
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == 'k0s' %}
|
||||||
---
|
---
|
||||||
apiVersion: k0sctl.k0sproject.io/v1beta1
|
apiVersion: k0sctl.k0sproject.io/v1beta1
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
@@ -42,12 +43,12 @@ spec:
|
|||||||
bind-address: "0.0.0.0"
|
bind-address: "0.0.0.0"
|
||||||
api:
|
api:
|
||||||
sans:
|
sans:
|
||||||
- {{ bootstrap_kubeapi_addr }}
|
- {{ bootstrap_kube_api_addr }}
|
||||||
{% if bootstrap_kubeapi_hostname is defined %}
|
{% if bootstrap_kubeapi_hostname is defined %}
|
||||||
- {{ bootstrap_kubeapi_hostname }}
|
- {{ bootstrap_kubeapi_hostname }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for item in bootstrap_nodes.master %}
|
{% for item in bootstrap_nodes.master %}
|
||||||
{% if item.address != bootstrap_kubeapi_addr %}
|
{% if item.address != bootstrap_kube_api_addr %}
|
||||||
- {{ item.address }}
|
- {{ item.address }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (bootstrap_kubeapi_hostname is not defined) or (item.name != bootstrap_kubeapi_hostname) %}
|
{% if (bootstrap_kubeapi_hostname is not defined) or (item.name != bootstrap_kubeapi_hostname) %}
|
||||||
@@ -89,7 +90,11 @@ spec:
|
|||||||
ipv6:
|
ipv6:
|
||||||
enabled: true
|
enabled: true
|
||||||
{% endif %}
|
{% endif %}
|
||||||
k8sServiceHost: "{{ bootstrap_kubeapi_addr }}"
|
{% if bootstrap_nodes.master | length == 1 and not bootstrap_kube_api_addr %}
|
||||||
|
k8sServiceHost: {{ bootstrap_nodes.master[0].address }}
|
||||||
|
{% else %}
|
||||||
|
k8sServiceHost: {{ bootstrap_kube_api_addr }}
|
||||||
|
{% endif %}
|
||||||
k8sServicePort: 6443
|
k8sServicePort: 6443
|
||||||
kubeProxyReplacement: true
|
kubeProxyReplacement: true
|
||||||
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
||||||
@@ -123,3 +128,4 @@ spec:
|
|||||||
type: EnvoyProxy
|
type: EnvoyProxy
|
||||||
{% endif %}
|
{% endif %}
|
||||||
provider: custom
|
provider: custom
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if discord_template_notifier.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -61,3 +62,4 @@ spec:
|
|||||||
- path: /data/config.toml
|
- path: /data/config.toml
|
||||||
subPath: config.toml
|
subPath: config.toml
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,6 +1,8 @@
|
|||||||
|
{% if discord_template_notifier.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if discord_template_notifier.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -12,3 +13,4 @@ stringData:
|
|||||||
retry_limit = 5
|
retry_limit = 5
|
||||||
sink.type = "discord"
|
sink.type = "discord"
|
||||||
sink.url = "{{ discord_template_notifier.webhook_url }}"
|
sink.url = "{{ discord_template_notifier.webhook_url }}"
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if discord_template_notifier.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -18,3 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if homepage.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@@ -75,3 +76,4 @@ data:
|
|||||||
dateStyle: long
|
dateStyle: long
|
||||||
timeStyle: short
|
timeStyle: short
|
||||||
hourCycle: h23
|
hourCycle: h23
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if homepage.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -86,3 +87,4 @@ spec:
|
|||||||
path: /app/config/widgets.yaml
|
path: /app/config/widgets.yaml
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
create: true
|
create: true
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if homepage.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -5,3 +6,4 @@ resources:
|
|||||||
- ./configmap.yaml
|
- ./configmap.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if homepage.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -9,3 +10,4 @@ stringData:
|
|||||||
HOMEPAGE_VAR_CLOUDFLARED_API_TOKEN: "{{ bootstrap_cloudflare_token }}"
|
HOMEPAGE_VAR_CLOUDFLARED_API_TOKEN: "{{ bootstrap_cloudflare_token }}"
|
||||||
HOMEPAGE_VAR_GRAFANA_USERNAME: admin
|
HOMEPAGE_VAR_GRAFANA_USERNAME: admin
|
||||||
HOMEPAGE_VAR_GRAFANA_PASSWORD: "{{ grafana.password }}"
|
HOMEPAGE_VAR_GRAFANA_PASSWORD: "{{ grafana.password }}"
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if homepage.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -18,3 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if weave_gitops.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -55,3 +56,4 @@ spec:
|
|||||||
impersonationResourceNames: ["admin"]
|
impersonationResourceNames: ["admin"]
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
secret.reloader.stakater.com/reload: cluster-user-auth
|
secret.reloader.stakater.com/reload: cluster-user-auth
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,6 +1,8 @@
|
|||||||
|
{% if weave_gitops.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
|
{% endif %}
|
||||||
+3
-1
@@ -1,3 +1,4 @@
|
|||||||
|
{% if weave_gitops.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -6,4 +7,5 @@ metadata:
|
|||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
username: admin
|
username: admin
|
||||||
password: "{{ weave_gitops.password | password_hash('bcrypt', rounds=10) }}"
|
password: "{{ weave_gitops.password | encrypt }}"
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if weave_gitops.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -18,3 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
@@ -23,7 +23,112 @@ spec:
|
|||||||
retries: 3
|
retries: 3
|
||||||
uninstall:
|
uninstall:
|
||||||
keepHistory: false
|
keepHistory: false
|
||||||
valuesFrom:
|
values:
|
||||||
- name: cilium-values
|
autoDirectNodeRoutes: true
|
||||||
kind: ConfigMap
|
bpf:
|
||||||
valuesKey: values.yaml
|
masquerade: true
|
||||||
|
bgp:
|
||||||
|
enabled: false
|
||||||
|
cluster:
|
||||||
|
name: home-cluster
|
||||||
|
id: 1
|
||||||
|
containerRuntime:
|
||||||
|
integration: containerd
|
||||||
|
{% if bootstrap_distribution == "k3s" %}
|
||||||
|
socketPath: /var/run/k3s/containerd/containerd.sock
|
||||||
|
{% else %}
|
||||||
|
socketPath: /var/run/k0s/containerd.sock
|
||||||
|
{% endif %}
|
||||||
|
endpointRoutes:
|
||||||
|
enabled: true
|
||||||
|
hubble:
|
||||||
|
enabled: true
|
||||||
|
metrics:
|
||||||
|
enabled:
|
||||||
|
- dns:query
|
||||||
|
- drop
|
||||||
|
- tcp
|
||||||
|
- flow
|
||||||
|
- port-distribution
|
||||||
|
- icmp
|
||||||
|
- http
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
dashboards:
|
||||||
|
enabled: true
|
||||||
|
annotations:
|
||||||
|
grafana_folder: Cilium
|
||||||
|
relay:
|
||||||
|
enabled: true
|
||||||
|
rollOutPods: true
|
||||||
|
prometheus:
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
ui:
|
||||||
|
enabled: true
|
||||||
|
rollOutPods: true
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: internal
|
||||||
|
{% if homepage.enabled | default(false) %}
|
||||||
|
annotations:
|
||||||
|
gethomepage.dev/enabled: "true"
|
||||||
|
gethomepage.dev/group: Network
|
||||||
|
gethomepage.dev/name: Cilium
|
||||||
|
gethomepage.dev/icon: cilium.png
|
||||||
|
{% endif %}
|
||||||
|
hosts:
|
||||||
|
- "hubble.${SECRET_DOMAIN}"
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- "hubble.${SECRET_DOMAIN}"
|
||||||
|
ipam:
|
||||||
|
mode: kubernetes
|
||||||
|
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
|
||||||
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
|
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
|
||||||
|
ipv6:
|
||||||
|
enabled: true
|
||||||
|
{% endif %}
|
||||||
|
k8sServiceHost: "${KUBE_API_ADDR}"
|
||||||
|
k8sServicePort: 6443
|
||||||
|
kubeProxyReplacement: true
|
||||||
|
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
||||||
|
l2announcements:
|
||||||
|
{% if bootstrap_ipv6_enabled | default(false) %}
|
||||||
|
enabled: false
|
||||||
|
{% else %}
|
||||||
|
enabled: true
|
||||||
|
# https://github.com/cilium/cilium/issues/26586
|
||||||
|
leaseDuration: 120s
|
||||||
|
leaseRenewDeadline: 60s
|
||||||
|
leaseRetryPeriod: 1s
|
||||||
|
{% endif %}
|
||||||
|
loadBalancer:
|
||||||
|
algorithm: maglev
|
||||||
|
mode: {{ bootstrap_cilium_loadbalancer_mode | default('dsr', true) }}
|
||||||
|
localRedirectPolicy: true
|
||||||
|
operator:
|
||||||
|
replicas: 1
|
||||||
|
rollOutPods: true
|
||||||
|
prometheus:
|
||||||
|
enabled: true
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
dashboards:
|
||||||
|
enabled: true
|
||||||
|
annotations:
|
||||||
|
grafana_folder: Cilium
|
||||||
|
prometheus:
|
||||||
|
enabled: true
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
trustCRDsExist: true
|
||||||
|
dashboards:
|
||||||
|
enabled: true
|
||||||
|
annotations:
|
||||||
|
grafana_folder: Cilium
|
||||||
|
rollOutCiliumPods: true
|
||||||
|
routingMode: native
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: cilium-values
|
|
||||||
data:
|
|
||||||
values.yaml: |
|
|
||||||
autoDirectNodeRoutes: true
|
|
||||||
bpf:
|
|
||||||
masquerade: true
|
|
||||||
bgp:
|
|
||||||
enabled: false
|
|
||||||
cluster:
|
|
||||||
name: home-cluster
|
|
||||||
id: 1
|
|
||||||
containerRuntime:
|
|
||||||
integration: containerd
|
|
||||||
{% if bootstrap_distribution == "k3s" %}
|
|
||||||
socketPath: /var/run/k3s/containerd/containerd.sock
|
|
||||||
{% else %}
|
|
||||||
socketPath: /var/run/k0s/containerd.sock
|
|
||||||
{% endif %}
|
|
||||||
endpointRoutes:
|
|
||||||
enabled: true
|
|
||||||
hubble:
|
|
||||||
enabled: true
|
|
||||||
metrics:
|
|
||||||
enabled:
|
|
||||||
- dns:query
|
|
||||||
- drop
|
|
||||||
- tcp
|
|
||||||
- flow
|
|
||||||
- port-distribution
|
|
||||||
- icmp
|
|
||||||
- http
|
|
||||||
serviceMonitor:
|
|
||||||
enabled: true
|
|
||||||
dashboards:
|
|
||||||
enabled: true
|
|
||||||
annotations:
|
|
||||||
grafana_folder: Cilium
|
|
||||||
relay:
|
|
||||||
enabled: true
|
|
||||||
rollOutPods: true
|
|
||||||
prometheus:
|
|
||||||
serviceMonitor:
|
|
||||||
enabled: true
|
|
||||||
ui:
|
|
||||||
enabled: true
|
|
||||||
rollOutPods: true
|
|
||||||
ingress:
|
|
||||||
enabled: true
|
|
||||||
className: internal
|
|
||||||
{% if homepage.enabled | default(false) %}
|
|
||||||
annotations:
|
|
||||||
gethomepage.dev/enabled: "true"
|
|
||||||
gethomepage.dev/group: Network
|
|
||||||
gethomepage.dev/name: Cilium
|
|
||||||
gethomepage.dev/icon: cilium.png
|
|
||||||
{% endif %}
|
|
||||||
hosts:
|
|
||||||
- "hubble.${SECRET_DOMAIN}"
|
|
||||||
tls:
|
|
||||||
- hosts:
|
|
||||||
- "hubble.${SECRET_DOMAIN}"
|
|
||||||
ipam:
|
|
||||||
mode: kubernetes
|
|
||||||
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
|
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
|
||||||
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
|
|
||||||
ipv6:
|
|
||||||
enabled: true
|
|
||||||
{% endif %}
|
|
||||||
k8sServiceHost: "${KUBEAPI_ADDR}"
|
|
||||||
k8sServicePort: 6443
|
|
||||||
kubeProxyReplacement: true
|
|
||||||
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
|
|
||||||
l2announcements:
|
|
||||||
{% if bootstrap_ipv6_enabled | default(false) %}
|
|
||||||
enabled: false
|
|
||||||
{% else %}
|
|
||||||
enabled: true
|
|
||||||
# https://github.com/cilium/cilium/issues/26586
|
|
||||||
leaseDuration: 120s
|
|
||||||
leaseRenewDeadline: 60s
|
|
||||||
leaseRetryPeriod: 1s
|
|
||||||
{% endif %}
|
|
||||||
loadBalancer:
|
|
||||||
algorithm: maglev
|
|
||||||
mode: {{ bootstrap_cilium_loadbalancer_mode | default('dsr', true) }}
|
|
||||||
localRedirectPolicy: true
|
|
||||||
operator:
|
|
||||||
replicas: 1
|
|
||||||
rollOutPods: true
|
|
||||||
prometheus:
|
|
||||||
enabled: true
|
|
||||||
serviceMonitor:
|
|
||||||
enabled: true
|
|
||||||
dashboards:
|
|
||||||
enabled: true
|
|
||||||
annotations:
|
|
||||||
grafana_folder: Cilium
|
|
||||||
prometheus:
|
|
||||||
enabled: true
|
|
||||||
serviceMonitor:
|
|
||||||
enabled: true
|
|
||||||
trustCRDsExist: true
|
|
||||||
dashboards:
|
|
||||||
enabled: true
|
|
||||||
annotations:
|
|
||||||
grafana_folder: Cilium
|
|
||||||
rollOutCiliumPods: true
|
|
||||||
routingMode: native
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
@@ -5,5 +5,4 @@ resources:
|
|||||||
{% if not bootstrap_ipv6_enabled | default(false) %}
|
{% if not bootstrap_ipv6_enabled | default(false) %}
|
||||||
- ./cilium-l2.yaml
|
- ./cilium-l2.yaml
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- ./helmvalues.yaml
|
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == "k3s" %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -86,3 +87,4 @@ spec:
|
|||||||
labelSelector:
|
labelSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/instance: coredns
|
app.kubernetes.io/instance: coredns
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,5 +1,7 @@
|
|||||||
|
{% if bootstrap_distribution == "k3s" %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if bootstrap_distribution == "k3s" %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -18,3 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if grafana.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -180,3 +181,4 @@ spec:
|
|||||||
storageClassName: openebs-hostpath
|
storageClassName: openebs-hostpath
|
||||||
testFramework:
|
testFramework:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,6 +1,8 @@
|
|||||||
|
{% if grafana.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./secret.sops.yaml
|
- ./secret.sops.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if grafana.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -6,3 +7,4 @@ metadata:
|
|||||||
stringData:
|
stringData:
|
||||||
admin-user: admin
|
admin-user: admin
|
||||||
admin-password: "{{ grafana.password }}"
|
admin-password: "{{ grafana.password }}"
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if grafana.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -18,3 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
+32
-5
@@ -1,10 +1,36 @@
|
|||||||
|
{% if kube_prometheus_stack.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: ConfigMap
|
kind: HelmRelease
|
||||||
metadata:
|
metadata:
|
||||||
name: kube-prometheus-stack-values
|
name: kube-prometheus-stack
|
||||||
data:
|
spec:
|
||||||
values.yaml: |
|
interval: 30m
|
||||||
|
timeout: 15m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: kube-prometheus-stack
|
||||||
|
version: 55.8.1
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: prometheus-community
|
||||||
|
namespace: flux-system
|
||||||
|
maxHistory: 2
|
||||||
|
install:
|
||||||
|
crds: CreateReplace
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
upgrade:
|
||||||
|
cleanupOnFail: true
|
||||||
|
crds: CreateReplace
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
uninstall:
|
||||||
|
keepHistory: false
|
||||||
|
dependsOn:
|
||||||
|
- name: openebs
|
||||||
|
namespace: storage
|
||||||
|
values:
|
||||||
crds:
|
crds:
|
||||||
enabled: true
|
enabled: true
|
||||||
cleanPrometheusOperatorObjectNames: true
|
cleanPrometheusOperatorObjectNames: true
|
||||||
@@ -138,3 +164,4 @@ data:
|
|||||||
multicluster:
|
multicluster:
|
||||||
etcd:
|
etcd:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
{% endif %}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
{% if kube_prometheus_stack.enabled | default(false) %}
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./helmrelease.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if kube_prometheus_stack.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -18,3 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if kubernetes_dashboard.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -45,3 +46,4 @@ spec:
|
|||||||
- *host
|
- *host
|
||||||
metricsScraper:
|
metricsScraper:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,6 +1,8 @@
|
|||||||
|
{% if kubernetes_dashboard.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./rbac.yaml
|
- ./rbac.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if kubernetes_dashboard.enabled | default(false) %}
|
||||||
# For dashboard sign in token:
|
# For dashboard sign in token:
|
||||||
# kubectl -n observability get secret kubernetes-dashboard -o jsonpath='{.data.token}' | base64 -d
|
# kubectl -n observability get secret kubernetes-dashboard -o jsonpath='{.data.token}' | base64 -d
|
||||||
---
|
---
|
||||||
@@ -37,3 +38,4 @@ subjects:
|
|||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: kubernetes-dashboard
|
name: kubernetes-dashboard
|
||||||
namespace: observability
|
namespace: observability
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if kubernetes_dashboard.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -21,3 +22,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if csi_driver_nfs.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -26,3 +27,4 @@ spec:
|
|||||||
values:
|
values:
|
||||||
externalSnapshotter:
|
externalSnapshotter:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,6 +1,8 @@
|
|||||||
|
{% if csi_driver_nfs.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
- ./storageclass.yaml
|
- ./storageclass.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if csi_driver_nfs.enabled | default(false) %}
|
||||||
{% for item in csi_driver_nfs.storage_class %}
|
{% for item in csi_driver_nfs.storage_class %}
|
||||||
---
|
---
|
||||||
apiVersion: storage.k8s.io/v1
|
apiVersion: storage.k8s.io/v1
|
||||||
@@ -12,3 +13,4 @@ reclaimPolicy: Delete
|
|||||||
volumeBindingMode: Immediate
|
volumeBindingMode: Immediate
|
||||||
mountOptions: ["hard", "noatime"]
|
mountOptions: ["hard", "noatime"]
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if csi_driver_nfs.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -18,3 +19,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
@@ -4,7 +4,7 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
- ./openebs/ks.yaml
|
- ./openebs/ks.yaml
|
||||||
{% if volsync.enabled | default(false) %}
|
{% if volsync.enabled | default(false) %}
|
||||||
- ./volsync/ks.yaml
|
- ./volsync/ks.yaml
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if csi_driver_nfs.enabled | default(false) %}
|
{% if csi_driver_nfs.enabled | default(false) %}
|
||||||
|
|||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if volsync.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -40,3 +41,4 @@ spec:
|
|||||||
tag: *tag
|
tag: *tag
|
||||||
metrics:
|
metrics:
|
||||||
disableAuth: true
|
disableAuth: true
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,6 +1,8 @@
|
|||||||
|
{% if volsync.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
- ./prometheusrule.yaml
|
- ./prometheusrule.yaml
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if volsync.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: PrometheusRule
|
kind: PrometheusRule
|
||||||
@@ -21,3 +22,4 @@ spec:
|
|||||||
for: 15m
|
for: 15m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
|
{% endif %}
|
||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{% if volsync.enabled | default(false) %}
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
@@ -38,3 +39,4 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
{% endif %}
|
||||||
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user