K3s Service#

K3s Service Class#

Classes:

K3s(master,ย agent[,ย version])

Deploy a single K3s cluster.

class enoslib.service.k3s.k3s.K3s(master: Iterable[Host], agent: Iterable[Host], version: str = 'latest')#

Deploy a single K3s cluster.

Note:

In order to deploy multiple (independent) nodes, please do so by creating multiple instances of this service.

Reference: https://docs.k3s.io/quick-start

This is a basic setup for now. Let us know if something is needed here: https://framateam.org/enoslib

For instance

  • automatic deployment of the dashboard

  • private registry configuration (e.g G5k registry)

  • โ€ฆ

Examples

 1import logging
 2from pathlib import Path
 3
 4import enoslib as en
 5
 6en.init_logging(level=logging.INFO)
 7en.check()
 8
 9job_name = Path(__file__).name
10
11# claim the resources
12conf = (
13    en.G5kConf.from_settings(job_name=job_name, walltime="0:45:00", job_type=[])
14    .add_machine(roles=["master"], cluster="paravance", nodes=1)
15    .add_machine(roles=["agent"], cluster="paravance", nodes=10)
16    .finalize()
17)
18
19
20provider = en.G5k(conf)
21# Get actual resources
22roles, networks = provider.init()
23
24
25k3s = en.K3s(master=roles["master"], agent=roles["agent"])
26k3s.deploy()
backup()#

(abstract) Backup the service.

deploy()#

(abstract) Deploy the service.

destroy()#

(abstract) Destroy the service.