Use immutable tags for running tasks

This way we can run tasks with `IfNotPresent` and be sure it works as intended.
This commit is contained in:
Mehran Kholdi
2020-05-29 19:20:03 +04:30
parent 0ab1e393fc
commit 46bd3565a0
9 changed files with 33 additions and 8 deletions

View File

@@ -7,6 +7,8 @@ import pykube
import yaml
from munch import Munch
from consts import CONFIG
api = pykube.HTTPClient(pykube.KubeConfig.from_env())
@@ -46,6 +48,8 @@ def run_on_node(fn, node):
"namespace": "kube-system", # FIXME
"nodeSelector": json.dumps({"kubernetes.io/hostname": node}),
"cmd": json.dumps(fn),
"image_repository": CONFIG["image_repository"],
"image_tag": CONFIG["image_tag"],
}
template = Path("./templates/task.yaml").read_bytes().decode()
manifest = template.format(**ctx)