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@5407b6059c06f13787f933ff40713d446a313dbe

Entrypoint

Return Type
K3S !
Arguments
NameTypeDefault ValueDescription
nameString "default"Name of the k3s cluster
baseContainer -Override the base rancher/k3s container with a custom one
portInteger 6443HTTPS listen port
Example
dagger -m github.com/aweris/daggerverse/k3s@5407b6059c06f13787f933ff40713d446a313dbe 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@5407b6059c06f13787f933ff40713d446a313dbe 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@5407b6059c06f13787f933ff40713d446a313dbe 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@5407b6059c06f13787f933ff40713d446a313dbe 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()
}