diff --git a/tasks/k3s.py b/tasks/k3s.py index 5d8a426..d380276 100644 --- a/tasks/k3s.py +++ b/tasks/k3s.py @@ -3,6 +3,8 @@ from pyinfra.api import deploy from pyinfra.facts import files from pyinfra.operations import files as files_op from pyinfra.operations import server + +K3S_COMMON_FLAGS = "--disable local-storage --disable=servicelb --disable=traefik" IS_CREATED_FILE = "/pyinfra/.k3s-init-completed" @deploy("Deploy K3S") @@ -25,7 +27,7 @@ def deploy_k3s(): name="Start K3S master", commands=[ "curl -sfL https://get.k3s.io | " - "sh -s - server --cluster-init", + f"sh -s - server --cluster-init {K3S_COMMON_FLAGS}", ], _env=dict(K3S_TOKEN=k3s_config.get("token")), ) @@ -34,7 +36,7 @@ def deploy_k3s(): name="Start K3S worker", commands=[ "curl -sfL https://get.k3s.io | " - f"sh -s - server --server https://{k3s_config.get('master')}:6443", + f"sh -s - server --server https://{k3s_config.get('master')}:6443 {K3S_COMMON_FLAGS}", ], _env=dict(K3S_TOKEN=k3s_config.get("token")), )