Dagger
Search

k3s

Runs a k3s server than can be accessed both locally and in your pipelines

Installation

dagger install github.com/aweris/daggerverse/k3s@c45c2f2ea68ba3a7ca035d3c5b2b7585a3e82fa0

Entrypoint

Return Type
K3S !
Arguments
NameTypeDescription
nameString Name of the k3s cluster
baseContainer Override the base rancher/k3s container with a custom one
portInteger HTTPS listen port
Example
dagger -m github.com/aweris/daggerverse/k3s@c45c2f2ea68ba3a7ca035d3c5b2b7585a3e82fa0 call \
func (m *myModule) example() *K3S  {
	return dag.
			K3s()
}
@function
def example() -> dag.K3S:
	return (
		dag.k3s()
	)
@func()
example(): K3S {
	return dag
		.k3s()
}

Types

K3S 🔗

container() 🔗

Returns a configured container for the k3s

Return Type
Container !
Example
dagger -m github.com/aweris/daggerverse/k3s@c45c2f2ea68ba3a7ca035d3c5b2b7585a3e82fa0 call \
 container
func (m *myModule) example() *Container  {
	return dag.
			K3s().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.k3s()
		.container()
	)
@func()
example(): Container {
	return dag
		.k3s()
		.container()
}

server() 🔗

Returns initialized k3s cluster

Return Type
Service !
Example
dagger -m github.com/aweris/daggerverse/k3s@c45c2f2ea68ba3a7ca035d3c5b2b7585a3e82fa0 call \
 server
func (m *myModule) example() *Service  {
	return dag.
			K3s().
			Server()
}
@function
def example() -> dagger.Service:
	return (
		dag.k3s()
		.server()
	)
@func()
example(): Service {
	return dag
		.k3s()
		.server()
}

kubeconfig() 🔗

Returns the kubeconfig file from the k3s container

Return Type
File !
Arguments
NameTypeDefault ValueDescription
localBoolean falseIndicates that the kubeconfig should be use localhost instead of the container IP. This is useful when running k3s as service
Example
dagger -m github.com/aweris/daggerverse/k3s@c45c2f2ea68ba3a7ca035d3c5b2b7585a3e82fa0 call \
 kubeconfig
func (m *myModule) example() *File  {
	return dag.
			K3s().
			Kubeconfig()
}
@function
def example() -> dagger.File:
	return (
		dag.k3s()
		.kubeconfig()
	)
@func()
example(): File {
	return dag
		.k3s()
		.kubeconfig()
}