diff --git a/README.md b/README.md index 9acab50543..55261323b3 100644 --- a/README.md +++ b/README.md @@ -287,7 +287,7 @@ in the root of this repo `k3s.service` which is as follows [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io -After=network.target +After=network-online.target [Service] Type=notify diff --git a/contrib/ansible/roles/k3s/master/templates/k3s.service.j2 b/contrib/ansible/roles/k3s/master/templates/k3s.service.j2 index e68fc8c5c5..b4d08d1370 100644 --- a/contrib/ansible/roles/k3s/master/templates/k3s.service.j2 +++ b/contrib/ansible/roles/k3s/master/templates/k3s.service.j2 @@ -1,7 +1,7 @@ [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io -After=network.target +After=network-online.target [Service] ExecStartPre=-/sbin/modprobe br_netfilter ExecStartPre=-/sbin/modprobe overlay diff --git a/contrib/ansible/roles/k3s/node/templates/k3s.service.j2 b/contrib/ansible/roles/k3s/node/templates/k3s.service.j2 index 2e1403150e..3c4cc816d8 100644 --- a/contrib/ansible/roles/k3s/node/templates/k3s.service.j2 +++ b/contrib/ansible/roles/k3s/node/templates/k3s.service.j2 @@ -1,7 +1,7 @@ [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io -After=network.target +After=network-online.target [Service] ExecStart=/usr/local/bin/k3s agent --server https://{{ master_ip }}:6443 --token {{ hostvars[groups['master'][0]]['token'] }} KillMode=process diff --git a/install.sh b/install.sh index 4c93fcebf2..f309949048 100755 --- a/install.sh +++ b/install.sh @@ -420,7 +420,7 @@ create_systemd_service_file() { [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io -After=network.target +After=network-online.target [Service] Type=${SYSTEMD_TYPE} diff --git a/k3s.service b/k3s.service index 12017aec5d..8738ee3960 100644 --- a/k3s.service +++ b/k3s.service @@ -1,7 +1,7 @@ [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io -After=network.target +After=network-online.target [Service] Type=notify