Skip to content

Commit

Permalink
Fix old node templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jknipper committed Sep 12, 2023
1 parent e123af9 commit 54c5a35
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 86 deletions.
27 changes: 15 additions & 12 deletions pkg/templates/node_1.10.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package templates

var Node_1_10 = `
variant: flatcar
version: 1.0.0
passwd:
users:
- name: core
Expand All @@ -18,7 +20,7 @@ passwd:
systemd:
units:
- name: legacy-cgroup-reboot.service
enable: true
enabled: true
contents: |
[Unit]
Description=Reboot if legacy cgroups are not enabled yet
Expand All @@ -30,9 +32,9 @@ systemd:
[Install]
WantedBy=multi-user.target
- name: iptables-restore.service
enable: true
enabled: true
- name: ccloud-metadata-hostname.service
enable: true
enabled: true
contents: |
[Unit]
Description=Workaround for coreos-metadata hostname bug
Expand All @@ -46,15 +48,15 @@ systemd:
[Install]
WantedBy=multi-user.target
- name: docker.service
enable: true
enabled: true
dropins:
- name: 20-docker-opts.conf
contents: |
[Service]
Environment="DOCKER_OPTS=--log-opt max-size=5m --log-opt max-file=5 --ip-masq=false --iptables=false --bridge=none"
Environment="DOCKER_CGROUPS=--exec-opt native.cgroupdriver=cgroupfs"
- name: flanneld.service
enable: true
enabled: true
contents: |
[Unit]
Description=flannel - Network fabric for containers (System Application Container)
Expand Down Expand Up @@ -99,7 +101,7 @@ systemd:
--volume etc-kube-flannel,kind=host,source=/etc/kube-flannel,readOnly=true \
--mount volume=etc-kube-flannel,target=/etc/kube-flannel"
- name: flannel-docker-opts.service
enable: true
enabled: true
contents: |
[Unit]
PartOf=flanneld.service
Expand All @@ -109,7 +111,7 @@ systemd:
Type=oneshot
ExecStart=/bin/true
- name: kubelet.service
enable: true
enabled: true
contents: |
[Unit]
Description=Kubelet via Hyperkube ACI
Expand Down Expand Up @@ -207,14 +209,14 @@ systemd:
Restart=always
RestartSec=10s
- name: wormhole.path
enable: true
enabled: true
contents: |
[Path]
PathExists=/var/lib/kubelet/kubeconfig
[Install]
WantedBy=multi-user.target
- name: kube-proxy.service
enable: true
enabled: true
contents: |
[Unit]
Description=Kube-Proxy
Expand Down Expand Up @@ -248,7 +250,7 @@ systemd:
WantedBy=multi-user.target
- name: updatecertificates.service
command: start
enable: true
enabled: true
contents: |
[Unit]
Description=Update the certificates w/ self-signed root CAs
Expand All @@ -262,7 +264,7 @@ systemd:
WantedBy=multi-user.target
- name: fix-cert-rotation.service
command: start
enable: true
enabled: true
contents: |
[Unit]
Description=Fix kubelet certificate rotation
Expand All @@ -283,7 +285,7 @@ systemd:
Type=oneshot
ExecStart=/opt/bin/rkt gc --grace-period=${GRACE_PERIOD}
- name: rkt-gc.timer
enable: true
enabled: true
command: start
contents: |
[Unit]
Expand All @@ -310,6 +312,7 @@ storage:
- path: /etc/systemd/resolved.conf
filesystem: root
mode: 0644
overwrite: true
contents:
inline: |
[Resolve]
Expand Down
25 changes: 14 additions & 11 deletions pkg/templates/node_1.11.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package templates

var Node_1_11 = `
variant: flatcar
version: 1.0.0
passwd:
users:
- name: core
Expand All @@ -18,7 +20,7 @@ passwd:
systemd:
units:
- name: legacy-cgroup-reboot.service
enable: true
enabled: true
contents: |
[Unit]
Description=Reboot if legacy cgroups are not enabled yet
Expand All @@ -30,9 +32,9 @@ systemd:
[Install]
WantedBy=multi-user.target
- name: iptables-restore.service
enable: true
enabled: true
- name: ccloud-metadata-hostname.service
enable: true
enabled: true
contents: |
[Unit]
Description=Workaround for coreos-metadata hostname bug
Expand All @@ -46,15 +48,15 @@ systemd:
[Install]
WantedBy=multi-user.target
- name: docker.service
enable: true
enabled: true
dropins:
- name: 20-docker-opts.conf
contents: |
[Service]
Environment="DOCKER_OPTS=--log-opt max-size=5m --log-opt max-file=5 --ip-masq=false --iptables=false --bridge=none"
Environment="DOCKER_CGROUPS=--exec-opt native.cgroupdriver=cgroupfs"
- name: flanneld.service
enable: true
enabled: true
contents: |
[Unit]
Description=flannel - Network fabric for containers (System Application Container)
Expand Down Expand Up @@ -99,7 +101,7 @@ systemd:
--volume etc-kube-flannel,kind=host,source=/etc/kube-flannel,readOnly=true \
--mount volume=etc-kube-flannel,target=/etc/kube-flannel"
- name: flannel-docker-opts.service
enable: true
enabled: true
contents: |
[Unit]
PartOf=flanneld.service
Expand All @@ -109,7 +111,7 @@ systemd:
Type=oneshot
ExecStart=/bin/true
- name: kubelet.service
enable: true
enabled: true
contents: |
[Unit]
Description=Kubelet via Hyperkube ACI
Expand Down Expand Up @@ -205,14 +207,14 @@ systemd:
Restart=always
RestartSec=10s
- name: wormhole.path
enable: true
enabled: true
contents: |
[Path]
PathExists=/var/lib/kubelet/kubeconfig
[Install]
WantedBy=multi-user.target
- name: kube-proxy.service
enable: true
enabled: true
contents: |
[Unit]
Description=Kube-Proxy
Expand Down Expand Up @@ -246,7 +248,7 @@ systemd:
WantedBy=multi-user.target
- name: updatecertificates.service
command: start
enable: true
enabled: true
contents: |
[Unit]
Description=Update the certificates w/ self-signed root CAs
Expand All @@ -268,7 +270,7 @@ systemd:
Type=oneshot
ExecStart=/opt/bin/rkt gc --grace-period=${GRACE_PERIOD}
- name: rkt-gc.timer
enable: true
enabled: true
command: start
contents: |
[Unit]
Expand Down Expand Up @@ -296,6 +298,7 @@ storage:
- path: /etc/systemd/resolved.conf
filesystem: root
mode: 0644
overwrite: true
contents:
inline: |
[Resolve]
Expand Down
25 changes: 14 additions & 11 deletions pkg/templates/node_1.12.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package templates

var Node_1_12 = `
variant: flatcar
version: 1.0.0
passwd:
users:
- name: core
Expand All @@ -18,7 +20,7 @@ passwd:
systemd:
units:
- name: legacy-cgroup-reboot.service
enable: true
enabled: true
contents: |
[Unit]
Description=Reboot if legacy cgroups are not enabled yet
Expand All @@ -30,9 +32,9 @@ systemd:
[Install]
WantedBy=multi-user.target
- name: iptables-restore.service
enable: true
enabled: true
- name: ccloud-metadata-hostname.service
enable: true
enabled: true
contents: |
[Unit]
Description=Workaround for coreos-metadata hostname bug
Expand All @@ -46,15 +48,15 @@ systemd:
[Install]
WantedBy=multi-user.target
- name: docker.service
enable: true
enabled: true
dropins:
- name: 20-docker-opts.conf
contents: |
[Service]
Environment="DOCKER_OPTS=--log-opt max-size=5m --log-opt max-file=5 --ip-masq=false --iptables=false --bridge=none"
Environment="DOCKER_CGROUPS=--exec-opt native.cgroupdriver=cgroupfs"
- name: flanneld.service
enable: true
enabled: true
contents: |
[Unit]
Description=flannel - Network fabric for containers (System Application Container)
Expand Down Expand Up @@ -99,7 +101,7 @@ systemd:
--volume etc-kube-flannel,kind=host,source=/etc/kube-flannel,readOnly=true \
--mount volume=etc-kube-flannel,target=/etc/kube-flannel"
- name: flannel-docker-opts.service
enable: true
enabled: true
contents: |
[Unit]
PartOf=flanneld.service
Expand All @@ -109,7 +111,7 @@ systemd:
Type=oneshot
ExecStart=/bin/true
- name: kubelet.service
enable: true
enabled: true
contents: |
[Unit]
Description=Kubelet via Hyperkube ACI
Expand Down Expand Up @@ -205,14 +207,14 @@ systemd:
Restart=always
RestartSec=10s
- name: wormhole.path
enable: true
enabled: true
contents: |
[Path]
PathExists=/var/lib/kubelet/kubeconfig
[Install]
WantedBy=multi-user.target
- name: kube-proxy.service
enable: true
enabled: true
contents: |
[Unit]
Description=Kube-Proxy
Expand Down Expand Up @@ -246,7 +248,7 @@ systemd:
WantedBy=multi-user.target
- name: updatecertificates.service
command: start
enable: true
enabled: true
contents: |
[Unit]
Description=Update the certificates w/ self-signed root CAs
Expand All @@ -267,7 +269,7 @@ systemd:
Type=oneshot
ExecStart=/opt/bin/rkt gc --grace-period=${GRACE_PERIOD}
- name: rkt-gc.timer
enable: true
enabled: true
command: start
contents: |
[Unit]
Expand All @@ -294,6 +296,7 @@ storage:
- path: /etc/systemd/resolved.conf
filesystem: root
mode: 0644
overwrite: true
contents:
inline: |
[Resolve]
Expand Down
Loading

0 comments on commit 54c5a35

Please sign in to comment.