Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1362 from kinvolk/surajssd/restart-on-failure
Browse files Browse the repository at this point in the history
EM: Add restart on-failure for metadata service
  • Loading branch information
surajssd authored Feb 12, 2021
2 parents 0fd6ff5 + 08d342f commit 0b0c39c
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down Expand Up @@ -97,6 +99,8 @@ systemd:
[Unit]
Description=Waiting to delete Kubernetes node on shutdown
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down Expand Up @@ -82,6 +84,8 @@ systemd:
[Unit]
Description=Waiting to delete Kubernetes node on shutdown
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down Expand Up @@ -76,6 +78,8 @@ systemd:
[Unit]
Description=Waiting to delete Kubernetes node on shutdown
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down Expand Up @@ -85,6 +87,8 @@ systemd:
[Unit]
Description=Waiting to delete Kubernetes node on shutdown
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
Expand Down
4 changes: 4 additions & 0 deletions assets/terraform-modules/node/templates/node.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
Expand Down Expand Up @@ -90,6 +92,8 @@ systemd:
[Unit]
Description=Waiting to delete Kubernetes node on shutdown
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service etcd-member.service bootkube.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done; /opt/wait-for-dns ${dns_zone} ${cluster_name}-private 3600'
Expand Down Expand Up @@ -76,9 +78,11 @@ systemd:
enable: true
contents: |
[Unit]
Description=Flatcar Metadata Agent
Description=Flatcar Container Linux Metadata Agent
[Service]
Type=oneshot
Restart=on-failure
RestartSec=10s
Environment=COREOS_METADATA_OPT_PROVIDER=--cmdline
ExecStart=/usr/bin/coreos-metadata $${COREOS_METADATA_OPT_PROVIDER} --attributes=/run/metadata/flatcar
[Install]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ systemd:
Wants=systemd-resolved.service
Before=kubelet.service
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done; /opt/wait-for-dns ${dns_zone} ${cluster_name}-private 3600'
Expand All @@ -41,6 +43,8 @@ systemd:
Description=Flatcar Container Linux Metadata Agent
[Service]
Type=oneshot
Restart=on-failure
RestartSec=10s
Environment=COREOS_METADATA_OPT_PROVIDER=--cmdline
ExecStart=/usr/bin/coreos-metadata $${COREOS_METADATA_OPT_PROVIDER} --attributes=/run/metadata/flatcar
[Install]
Expand Down Expand Up @@ -125,6 +129,8 @@ systemd:
[Unit]
Description=Waiting to delete Kubernetes node on shutdown
[Service]
Restart=on-failure
RestartSec=5s
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
Expand Down
60 changes: 30 additions & 30 deletions pkg/assets/generated_assets.go

Large diffs are not rendered by default.

0 comments on commit 0b0c39c

Please sign in to comment.