feat: update system-upgrade namespace and include support for k0s (#1278)
* fest: k0s Autopilot * Create .mjfilter.py * Create kustomization.yaml.j2 * Create ks.yaml.j2 * Create kustomization.yaml.j2 * Create updaterconfig.yaml.j2 * feat: update system-upgrade namespace and include support for k0s Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: rename talos app folder Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: update k0s plan Signed-off-by: Devin Buhl <devin@buhl.casa> --------- Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
0c688dfa29
commit
d6e80ea087
16 files changed
+141
-50
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
main = lambda data: data.get("distribution") in ['k0s']
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./plan.yaml
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
apiVersion: autopilot.k0sproject.io/v1beta2
|
||||||
|
kind: Plan
|
||||||
|
metadata:
|
||||||
|
name: autopilot
|
||||||
|
spec:
|
||||||
|
id: not-used
|
||||||
|
timestamp: not-used
|
||||||
|
commands:
|
||||||
|
- k0supdate:
|
||||||
|
version: "${KUBE_VERSION}"
|
||||||
|
platforms:
|
||||||
|
linux-amd64:
|
||||||
|
url: "https://get.k0sproject.io/${KUBE_VERSION}/k0s-${KUBE_VERSION}-amd64"
|
||||||
|
linux-arm64:
|
||||||
|
url: "https://get.k0sproject.io/${KUBE_VERSION}/k0s-${KUBE_VERSION}-arm64"
|
||||||
|
targets:
|
||||||
|
controllers:
|
||||||
|
discovery:
|
||||||
|
selector: {}
|
||||||
|
workers:
|
||||||
|
discovery:
|
||||||
|
selector: {}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app system-upgrade-k0s
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: system-upgrade
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
path: ./kubernetes/apps/system-upgrade/k0s/app
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: home-kubernetes
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
||||||
|
postBuild:
|
||||||
|
substitute:
|
||||||
|
# renovate: datasource=github-releases depName=k0sproject/k0s
|
||||||
|
KUBE_VERSION: v1.29.1+k0s.0
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
main = lambda data: data.get("distribution") in ['k3s']
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./plan.yaml
|
||||||
+2
-6
@@ -1,12 +1,10 @@
|
|||||||
{% if distribution in ['k3s'] %}
|
|
||||||
---
|
---
|
||||||
apiVersion: upgrade.cattle.io/v1
|
apiVersion: upgrade.cattle.io/v1
|
||||||
kind: Plan
|
kind: Plan
|
||||||
metadata:
|
metadata:
|
||||||
name: controllers
|
name: controllers
|
||||||
spec:
|
spec:
|
||||||
# renovate: datasource=github-releases depName=k3s-io/k3s
|
version: "${KUBE_VERSION}"
|
||||||
version: v1.29.0+k3s1
|
|
||||||
upgrade:
|
upgrade:
|
||||||
image: rancher/k3s-upgrade
|
image: rancher/k3s-upgrade
|
||||||
serviceAccountName: system-upgrade
|
serviceAccountName: system-upgrade
|
||||||
@@ -38,8 +36,7 @@ kind: Plan
|
|||||||
metadata:
|
metadata:
|
||||||
name: workers
|
name: workers
|
||||||
spec:
|
spec:
|
||||||
# renovate: datasource=github-releases depName=k3s-io/k3s
|
version: "${KUBE_VERSION}"
|
||||||
version: v1.29.0+k3s1
|
|
||||||
serviceAccountName: system-upgrade
|
serviceAccountName: system-upgrade
|
||||||
concurrency: 1
|
concurrency: 1
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
@@ -51,4 +48,3 @@ spec:
|
|||||||
args: ["prepare", "server"]
|
args: ["prepare", "server"]
|
||||||
upgrade:
|
upgrade:
|
||||||
image: rancher/k3s-upgrade
|
image: rancher/k3s-upgrade
|
||||||
{% endif %}
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app system-upgrade-k3s
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: system-upgrade
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
dependsOn:
|
||||||
|
- name: system-upgrade-controller
|
||||||
|
path: ./kubernetes/apps/system-upgrade/k3s/app
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: home-kubernetes
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
||||||
|
postBuild:
|
||||||
|
substitute:
|
||||||
|
# renovate: datasource=github-releases depName=k3s-io/k3s
|
||||||
|
KUBE_VERSION: v1.29.0+k3s1
|
||||||
@@ -3,4 +3,15 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
|
{% if distribution in ['k3s', 'talos'] %}
|
||||||
- ./system-upgrade-controller/ks.yaml
|
- ./system-upgrade-controller/ks.yaml
|
||||||
|
{% endif %}
|
||||||
|
{% if distribution in ['k0s'] %}
|
||||||
|
- ./k0s/ks.yaml
|
||||||
|
{% endif %}
|
||||||
|
{% if distribution in ['k3s'] %}
|
||||||
|
- ./k3s/ks.yaml
|
||||||
|
{% endif %}
|
||||||
|
{% if distribution in ['talos'] and cluster.nodes.talos.schematics.enabled %}
|
||||||
|
- ./talos/ks.yaml
|
||||||
|
{% endif %}
|
||||||
File renamed without changes.
-24
@@ -18,27 +18,3 @@ spec:
|
|||||||
interval: 30m
|
interval: 30m
|
||||||
retryInterval: 1m
|
retryInterval: 1m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
{% if distribution in ['k3s'] or (distribution in ['talos'] and cluster.nodes.talos.schematics.enabled) %}
|
|
||||||
---
|
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
|
||||||
kind: Kustomization
|
|
||||||
metadata:
|
|
||||||
name: &app system-upgrade-controller-plans
|
|
||||||
namespace: flux-system
|
|
||||||
spec:
|
|
||||||
targetNamespace: system-upgrade
|
|
||||||
commonMetadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: *app
|
|
||||||
dependsOn:
|
|
||||||
- name: system-upgrade-controller
|
|
||||||
path: ./kubernetes/apps/system-upgrade/system-upgrade-controller/plans
|
|
||||||
prune: true
|
|
||||||
sourceRef:
|
|
||||||
kind: GitRepository
|
|
||||||
name: home-kubernetes
|
|
||||||
wait: false
|
|
||||||
interval: 30m
|
|
||||||
retryInterval: 1m
|
|
||||||
timeout: 5m
|
|
||||||
{% endif %}
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
{% if distribution in ['k3s'] or (distribution in ['talos'] and cluster.nodes.talos.schematics.enabled) %}
|
|
||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
{% if distribution in ['k3s'] %}
|
|
||||||
- ./k3s.yaml
|
|
||||||
{% elif distribution in ['talos'] and cluster.nodes.talos.schematics.enabled %}
|
|
||||||
- ./talos.yaml
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
main = lambda data: data.get("distribution") in ['talos'] and (
|
||||||
|
data.get("cluster", {})
|
||||||
|
.get("nodes", {})
|
||||||
|
.get("talos", {})
|
||||||
|
.get("schematics", {})
|
||||||
|
.get("enabled", False) == True)
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./plan.yaml
|
||||||
+4
-9
@@ -1,12 +1,10 @@
|
|||||||
{% if distribution in ['talos'] and cluster.nodes.talos.schematics.enabled %}
|
|
||||||
---
|
---
|
||||||
apiVersion: upgrade.cattle.io/v1
|
apiVersion: upgrade.cattle.io/v1
|
||||||
kind: Plan
|
kind: Plan
|
||||||
metadata:
|
metadata:
|
||||||
name: kubernetes
|
name: kubernetes
|
||||||
spec:
|
spec:
|
||||||
# renovate: datasource=docker depName=ghcr.io/siderolabs/kubelet
|
version: "${KUBE_VERSION}"
|
||||||
version: v1.29.1
|
|
||||||
serviceAccountName: system-upgrade
|
serviceAccountName: system-upgrade
|
||||||
secrets:
|
secrets:
|
||||||
- name: talos
|
- name: talos
|
||||||
@@ -19,7 +17,7 @@ spec:
|
|||||||
- key: node-role.kubernetes.io/control-plane
|
- key: node-role.kubernetes.io/control-plane
|
||||||
operator: Exists
|
operator: Exists
|
||||||
prepare: &prepare
|
prepare: &prepare
|
||||||
image: ghcr.io/siderolabs/talosctl:v1.6.3
|
image: "ghcr.io/siderolabs/talosctl:${SYSTEM_VERSION}"
|
||||||
envs:
|
envs:
|
||||||
- name: NODE_IP
|
- name: NODE_IP
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@@ -41,8 +39,7 @@ kind: Plan
|
|||||||
metadata:
|
metadata:
|
||||||
name: talos
|
name: talos
|
||||||
spec:
|
spec:
|
||||||
# renovate: datasource=docker depName=ghcr.io/siderolabs/installer
|
version: "${SYSTEM_VERSION}"
|
||||||
version: v1.6.3
|
|
||||||
serviceAccountName: system-upgrade
|
serviceAccountName: system-upgrade
|
||||||
secrets:
|
secrets:
|
||||||
- name: talos
|
- name: talos
|
||||||
@@ -59,8 +56,7 @@ spec:
|
|||||||
matchExpressions:
|
matchExpressions:
|
||||||
- key: kubernetes.io/os
|
- key: kubernetes.io/os
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values: ["linux"]
|
||||||
- linux
|
|
||||||
tolerations:
|
tolerations:
|
||||||
- key: CriticalAddonsOnly
|
- key: CriticalAddonsOnly
|
||||||
operator: Exists
|
operator: Exists
|
||||||
@@ -95,4 +91,3 @@ spec:
|
|||||||
- --image=factory.talos.dev/installer/{{ cluster.nodes.talos.schematics.id }}:$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION)
|
- --image=factory.talos.dev/installer/{{ cluster.nodes.talos.schematics.id }}:$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION)
|
||||||
- --preserve=true
|
- --preserve=true
|
||||||
- --wait=false
|
- --wait=false
|
||||||
{% endif %}
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
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.1
|
||||||
|
# renovate: datasource=docker depName=ghcr.io/siderolabs/installer
|
||||||
|
SYSTEM_VERSION: v1.6.3
|
||||||
Reference in new issue
Block a user