diff --git a/README.md b/README.md index 6185cd0f..8b6dd091 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The features included will depend on the type of configuration you want to use. 1. **"Flux cluster"** - a Kubernetes distribution of your choosing: [k3s](https://github.com/k3s-io/k3s) or [Talos](https://github.com/siderolabs/talos). Deploys an opinionated implementation of [Flux](https://github.com/fluxcd/flux2) using [GitHub](https://github.com/) as the Git provider and [sops](https://github.com/getsops/sops) to manage secrets. - **Required:** Debian 12 or Talos Linux installed on bare metal (or VMs) and some knowledge of [Containers](https://opencontainers.org/) and [YAML](https://yaml.org/). Some knowledge of [Git](https://git-scm.com/) practices & terminology is also required. - - **Components:** [Cilium](https://github.com/cilium/cilium) and [kube-vip](https://github.com/kube-vip/kube-vip) _(k3s)_. [flux](https://github.com/fluxcd/flux2), [cert-manager](https://github.com/cert-manager/cert-manager), [spegel](https://github.com/XenitAB/spegel), [reloader](https://github.com/stakater/Reloader), [system-upgrade-controller](https://github.com/rancher/system-upgrade-controller), and [openebs](https://github.com/openebs/openebs). + - **Components:** [Cilium](https://github.com/cilium/cilium) and [kube-vip](https://github.com/kube-vip/kube-vip) _(k3s)_. [flux](https://github.com/fluxcd/flux2), [cert-manager](https://github.com/cert-manager/cert-manager), [spegel](https://github.com/XenitAB/spegel), [reloader](https://github.com/stakater/Reloader), [system-upgrade-controller](https://github.com/rancher/system-upgrade-controller) _(k3s)_, and [openebs](https://github.com/openebs/openebs). 3. **"Flux cluster with Cloudflare"** - An addition to "**Flux cluster**" that provides DNS and SSL with [Cloudflare](https://www.cloudflare.com/). [Cloudflare Tunnel](https://www.cloudflare.com/products/tunnel/) is also included to provide external access to certain applications deployed in your cluster. diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/k3s/.mjfilter.py b/bootstrap/templates/kubernetes/apps/system-upgrade/.mjfilter.py similarity index 100% rename from bootstrap/templates/kubernetes/apps/system-upgrade/k3s/.mjfilter.py rename to bootstrap/templates/kubernetes/apps/system-upgrade/.mjfilter.py diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/kustomization.yaml.j2 b/bootstrap/templates/kubernetes/apps/system-upgrade/kustomization.yaml.j2 index 7800ccb0..e0b2bf29 100644 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/kustomization.yaml.j2 +++ b/bootstrap/templates/kubernetes/apps/system-upgrade/kustomization.yaml.j2 @@ -3,12 +3,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./namespace.yaml - #% if bootstrap_distribution in ['k3s', 'talos'] %# - ./system-upgrade-controller/ks.yaml - #% endif %# - #% if bootstrap_distribution in ["k3s"] %# - ./k3s/ks.yaml - #% endif %# - #% if bootstrap_distribution in ["talos"] and bootstrap_talos.schematic_id %# - - ./talos/ks.yaml - #% endif %# diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/.mjfilter.py b/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/.mjfilter.py deleted file mode 100644 index 394f9d1e..00000000 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/.mjfilter.py +++ /dev/null @@ -1 +0,0 @@ -main = lambda data: data.get("bootstrap_distribution", "k3s") in ["k3s", "talos"] diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/helmrelease.yaml.j2 b/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/helmrelease.yaml.j2 index 8e72a3f4..dbf59f8b 100644 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/helmrelease.yaml.j2 +++ b/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/helmrelease.yaml.j2 @@ -37,7 +37,7 @@ spec: SYSTEM_UPGRADE_JOB_ACTIVE_DEADLINE_SECONDS: 900 SYSTEM_UPGRADE_JOB_BACKOFF_LIMIT: 99 SYSTEM_UPGRADE_JOB_IMAGE_PULL_POLICY: IfNotPresent - SYSTEM_UPGRADE_JOB_KUBECTL_IMAGE: docker.io/rancher/kubectl:v1.29.0 + SYSTEM_UPGRADE_JOB_KUBECTL_IMAGE: registry.k8s.io/kubectl:v1.29.2 SYSTEM_UPGRADE_JOB_PRIVILEGED: true SYSTEM_UPGRADE_JOB_TTL_SECONDS_AFTER_FINISH: 900 SYSTEM_UPGRADE_PLAN_POLLING_INTERVAL: 15m diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/rbac.yaml.j2 b/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/rbac.yaml.j2 index ddc6127f..123677c2 100644 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/rbac.yaml.j2 +++ b/bootstrap/templates/kubernetes/apps/system-upgrade/system-upgrade-controller/app/rbac.yaml.j2 @@ -11,13 +11,3 @@ subjects: - kind: ServiceAccount name: system-upgrade namespace: system-upgrade -#% if bootstrap_distribution in ["talos"] %# ---- -apiVersion: talos.dev/v1alpha1 -kind: ServiceAccount -metadata: - name: talos -spec: - roles: - - os:admin -#% endif %# diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/.mjfilter.py b/bootstrap/templates/kubernetes/apps/system-upgrade/talos/.mjfilter.py deleted file mode 100644 index 82712ee6..00000000 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/.mjfilter.py +++ /dev/null @@ -1,4 +0,0 @@ -main = lambda data: ( - data.get("bootstrap_distribution", "k3s") in ["talos"] and - data.get("talos", {}).get("schematic_id", {}) -) diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/app/kustomization.yaml.j2 b/bootstrap/templates/kubernetes/apps/system-upgrade/talos/app/kustomization.yaml.j2 deleted file mode 100644 index c159f45b..00000000 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/app/kustomization.yaml.j2 +++ /dev/null @@ -1,5 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - ./plan.yaml diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/app/plan.yaml.j2 b/bootstrap/templates/kubernetes/apps/system-upgrade/talos/app/plan.yaml.j2 deleted file mode 100644 index 88228c88..00000000 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/app/plan.yaml.j2 +++ /dev/null @@ -1,93 +0,0 @@ ---- -apiVersion: upgrade.cattle.io/v1 -kind: Plan -metadata: - name: kubernetes -spec: - version: "${KUBE_VERSION}" - serviceAccountName: system-upgrade - secrets: - - name: talos - path: /var/run/secrets/talos.dev - ignoreUpdates: true - concurrency: 1 - exclusive: true - nodeSelector: - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: Exists - prepare: &prepare - image: "ghcr.io/siderolabs/talosctl:${SYSTEM_VERSION}" - envs: - - name: NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - args: - - --nodes=$(NODE_IP) - - health - - --server=false - upgrade: - <<: *prepare - args: - - --nodes=$(NODE_IP) - - upgrade-k8s - - --to=$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION) ---- -apiVersion: upgrade.cattle.io/v1 -kind: Plan -metadata: - name: talos -spec: - version: "${SYSTEM_VERSION}" - serviceAccountName: system-upgrade - secrets: - - name: talos - path: /var/run/secrets/talos.dev - ignoreUpdates: true - concurrency: 1 - cordon: true - drain: - deleteLocalData: true - disableEviction: false - ignoreDaemonSets: true - exclusive: true - nodeSelector: - matchExpressions: - - key: kubernetes.io/os - operator: In - values: ["linux"] - tolerations: - - key: CriticalAddonsOnly - operator: Exists - - key: node-role.kubernetes.io/master - operator: Exists - effect: NoSchedule - - key: node-role.kubernetes.io/controlplane - operator: Exists - effect: NoSchedule - - key: node-role.kubernetes.io/control-plane - operator: Exists - effect: NoSchedule - - key: node-role.kubernetes.io/etcd - operator: Exists - effect: NoSchedule - prepare: &prepare - image: ghcr.io/siderolabs/talosctl - envs: - - name: NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - args: - - --nodes=$(NODE_IP) - - health - - --server=false - upgrade: - <<: *prepare - args: - - --nodes=$(NODE_IP) - - upgrade - - --image=factory.talos.dev/installer/#{ bootstrap_talos.schematic_id }#:$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION) - - --preserve=true - - --wait=false diff --git a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/ks.yaml.j2 b/bootstrap/templates/kubernetes/apps/system-upgrade/talos/ks.yaml.j2 deleted file mode 100644 index f6347adb..00000000 --- a/bootstrap/templates/kubernetes/apps/system-upgrade/talos/ks.yaml.j2 +++ /dev/null @@ -1,28 +0,0 @@ ---- -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: &app system-upgrade-talos - namespace: flux-system -spec: - targetNamespace: system-upgrade - commonMetadata: - labels: - app.kubernetes.io/name: *app - dependsOn: - - name: system-upgrade-controller - path: ./kubernetes/apps/system-upgrade/talos/app - prune: true - sourceRef: - kind: GitRepository - name: home-kubernetes - wait: false - interval: 30m - retryInterval: 1m - timeout: 5m - postBuild: - substitute: - # renovate: datasource=docker depName=ghcr.io/siderolabs/kubelet - KUBE_VERSION: v1.29.2 - # renovate: datasource=docker depName=ghcr.io/siderolabs/installer - SYSTEM_VERSION: v1.6.4