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
+106
@@ -0,0 +1,106 @@
|
||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: &app system-upgrade-controller
|
||||
spec:
|
||||
interval: 30m
|
||||
chart:
|
||||
spec:
|
||||
chart: app-template
|
||||
version: 2.4.0
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: bjw-s
|
||||
namespace: flux-system
|
||||
maxHistory: 2
|
||||
install:
|
||||
remediation:
|
||||
retries: 3
|
||||
upgrade:
|
||||
cleanupOnFail: true
|
||||
remediation:
|
||||
retries: 3
|
||||
uninstall:
|
||||
keepHistory: false
|
||||
values:
|
||||
controllers:
|
||||
main:
|
||||
strategy: RollingUpdate
|
||||
containers:
|
||||
main:
|
||||
image:
|
||||
repository: docker.io/rancher/system-upgrade-controller
|
||||
tag: v0.13.2
|
||||
env:
|
||||
SYSTEM_UPGRADE_CONTROLLER_DEBUG: false
|
||||
SYSTEM_UPGRADE_CONTROLLER_THREADS: 2
|
||||
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_PRIVILEGED: true
|
||||
SYSTEM_UPGRADE_JOB_TTL_SECONDS_AFTER_FINISH: 900
|
||||
SYSTEM_UPGRADE_PLAN_POLLING_INTERVAL: 15m
|
||||
SYSTEM_UPGRADE_CONTROLLER_NAME: *app
|
||||
SYSTEM_UPGRADE_CONTROLLER_NAMESPACE:
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
pod:
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65534
|
||||
runAsGroup: 65534
|
||||
allowPrivilegeEscalation: false
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node-role.kubernetes.io/control-plane
|
||||
operator: Exists
|
||||
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: NoExecute}
|
||||
serviceAccount:
|
||||
create: true
|
||||
name: system-upgrade
|
||||
service:
|
||||
main:
|
||||
enabled: false
|
||||
persistence:
|
||||
tmp:
|
||||
type: emptyDir
|
||||
globalMounts:
|
||||
- path: /tmp
|
||||
etc-ssl:
|
||||
type: hostPath
|
||||
hostPath: /etc/ssl
|
||||
hostPathType: DirectoryOrCreate
|
||||
globalMounts:
|
||||
- path: /etc/ssl
|
||||
readOnly: true
|
||||
etc-pki:
|
||||
type: hostPath
|
||||
hostPath: /etc/pki
|
||||
hostPathType: DirectoryOrCreate
|
||||
globalMounts:
|
||||
- path: /etc/pki
|
||||
readOnly: true
|
||||
etc-ca-certificates:
|
||||
type: hostPath
|
||||
hostPath: /etc/ca-certificates
|
||||
hostPathType: DirectoryOrCreate
|
||||
globalMounts:
|
||||
- path: /etc/ca-certificates
|
||||
readOnly: true
|
||||
{% endif %}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
||||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
# renovate: datasource=github-releases depName=rancher/system-upgrade-controller
|
||||
- https://github.com/rancher/system-upgrade-controller/releases/download/v0.13.2/crd.yaml
|
||||
- helmrelease.yaml
|
||||
- rbac.yaml
|
||||
{% endif %}
|
||||
@@ -0,0 +1,15 @@
|
||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: system-upgrade
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: system-upgrade
|
||||
namespace: tools
|
||||
{% endif %}
|
||||
@@ -0,0 +1,44 @@
|
||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
||||
---
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: &app system-upgrade-controller
|
||||
namespace: flux-system
|
||||
spec:
|
||||
targetNamespace: tools
|
||||
commonMetadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: *app
|
||||
path: ./kubernetes/apps/tools/system-upgrade-controller/app
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: home-kubernetes
|
||||
wait: true
|
||||
interval: 30m
|
||||
retryInterval: 1m
|
||||
timeout: 5m
|
||||
---
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: &app system-upgrade-controller-plans
|
||||
namespace: flux-system
|
||||
spec:
|
||||
targetNamespace: tools
|
||||
commonMetadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: *app
|
||||
dependsOn:
|
||||
- name: system-upgrade-controller
|
||||
path: ./kubernetes/apps/tools/system-upgrade-controller/plans
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: home-kubernetes
|
||||
wait: false
|
||||
interval: 30m
|
||||
retryInterval: 1m
|
||||
timeout: 5m
|
||||
{% endif %}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
||||
---
|
||||
apiVersion: upgrade.cattle.io/v1
|
||||
kind: Plan
|
||||
metadata:
|
||||
name: agent
|
||||
spec:
|
||||
# renovate: datasource=github-releases depName=k3s-io/k3s
|
||||
version: "v1.29.0+k3s1"
|
||||
serviceAccountName: system-upgrade
|
||||
concurrency: 1
|
||||
nodeSelector:
|
||||
matchExpressions:
|
||||
- {key: node-role.kubernetes.io/control-plane, operator: DoesNotExist}
|
||||
prepare:
|
||||
image: rancher/k3s-upgrade
|
||||
args: ["prepare", "server"]
|
||||
upgrade:
|
||||
image: rancher/k3s-upgrade
|
||||
{% endif %}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
||||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ./server.yaml
|
||||
- ./agent.yaml
|
||||
{% endif %}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
{% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %}
|
||||
---
|
||||
apiVersion: upgrade.cattle.io/v1
|
||||
kind: Plan
|
||||
metadata:
|
||||
name: server
|
||||
spec:
|
||||
# renovate: datasource=github-releases depName=k3s-io/k3s
|
||||
version: "v1.29.0+k3s1"
|
||||
serviceAccountName: system-upgrade
|
||||
concurrency: 1
|
||||
cordon: true
|
||||
nodeSelector:
|
||||
matchExpressions:
|
||||
- {key: node-role.kubernetes.io/control-plane, operator: Exists}
|
||||
tolerations:
|
||||
- {effect: NoSchedule, operator: Exists}
|
||||
- {effect: NoExecute, operator: Exists}
|
||||
- {key: node-role.kubernetes.io/control-plane, effect: NoSchedule, operator: Exists}
|
||||
- {key: node-role.kubernetes.io/master, effect: NoSchedule, operator: Exists}
|
||||
- {key: node-role.kubernetes.io/etcd, effect: NoExecute, operator: Exists}
|
||||
- {key: CriticalAddonsOnly, operator: Exists}
|
||||
upgrade:
|
||||
image: rancher/k3s-upgrade
|
||||
{% endif %}
|
||||
Reference in new issue
Block a user