k8sgarden

package
v0.8.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppGUIDLabelKey   = "cloudfoundry.org/app-guid"
	OrgGUIDLabelKey   = "cloudfoundry.org/org-guid"
	SpaceGUIDLabelKey = "cloudfoundry.org/space-guid"
	WorkloadTypeKey   = "cloudfoundry.org/workload-type"
	OwnerNameLabelKey = "cloudfoundry.org/owner-name"

	ContainerStateProperty = "garden.state"

	ContainerOwnerProperty    = "executor:owner"
	ContainerWorkloadProperty = "network.container_workload"
	SpaceIDProperty           = "network.space_id"
	OrgIDProperty             = "network.org_id"
	AppIDProperty             = "network.app_id"

	DefaultSandboxPath = "/var/run/containerd/io.containerd.runtime.v2.task/k8s.io"
)

Variables

View Source
var (
	Caps = []string{"CAP_CHOWN", "CAP_DAC_OVERRIDE", "CAP_FOWNER", "CAP_FSETID", "CAP_KILL", "CAP_SETGID", "CAP_SETUID", "CAP_SETPCAP", "CAP_NET_BIND_SERVICE", "CAP_NET_RAW", "CAP_SYS_CHROOT", "CAP_MKNOD", "CAP_AUDIT_WRITE", "CAP_SETFCAP"}
)
View Source
var ErrNotSupported = errors.New("not supported by the kubernetes-backed garden client")

ErrNotSupported is returned by garden.Client and garden.Container methods that the Kubernetes-backed implementation does not support.

Functions

func NewClient

func NewClient(logger lager.Logger, k8sclient ctrlclient.Client, cfg Config, opts ...Option) (garden.Client, error)

func NewContainer

func NewContainer(
	log lager.Logger,
	pod *corev1.Pod,
	env []string,
	cpuAssignment float64,
	userLookupper users.UserLookupper,
	propertyManager gardener.PropertyManager,
	rootfsSize uint64,
	runningContainers map[string]containerd.RunningContainer,
	sandboxPath string,
	containerdClient containerd.Client,
) *container

Types

type Config added in v0.8.0

type Config struct {
	NodeName                      string
	WorkloadsNamespace            string
	SidecarRootfs                 string
	TrustedSystemCertificatesPath string
	EnableContainerProxy          bool
	EnableUserNamespaces          bool
}

type Factory added in v0.8.0

type Factory struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory(client garden.Client) *Factory

func (*Factory) NewGardenClient added in v0.8.0

func (f *Factory) NewGardenClient(logger lager.Logger, traceID string) garden.Client

type Option added in v0.8.0

type Option func(*client)

func WithCommandRunner added in v0.8.0

func WithCommandRunner(r commandrunner.CommandRunner) Option

func WithContainerdClient added in v0.8.0

func WithContainerdClient(c containerd.Client) Option

func WithEnableUserNamespaces added in v0.8.2

func WithEnableUserNamespaces(enable bool) Option

func WithKubeletClient added in v0.8.0

func WithKubeletClient(k kubelet.Client) Option

func WithSandboxPath added in v0.8.0

func WithSandboxPath(sandboxPath string) Option

func WithUserLookupper added in v0.8.0

func WithUserLookupper(u users.UserLookupper) Option

type Process

type Process interface {
	garden.Process
	Spec() *specs.Process
	Task() ctrdclient.Task
}

func NewProcess

func NewProcess(
	log lager.Logger,
	id string,
	spec *specs.Process,
	io garden.ProcessIO,
	task ctrdclient.Task,
) Process

type ZeroRootFSSizer added in v0.8.0

type ZeroRootFSSizer struct{}

ZeroRootFSSizer reports a rootfs size of 0 for any path.

The Kubernetes-backed garden client already accounts for the rootfs size directly (Create subtracts it from the container's ephemeral-storage limit and BulkMetrics folds it into DiskStat.TotalBytesUsed). When the executor uses this client it must therefore be configured with a RootFSSizer that returns 0, so it does not subtract the rootfs size a second time. Wire this type into the executor's configuration for that purpose.

func (ZeroRootFSSizer) RootFSSizeFromPath added in v0.8.0

func (ZeroRootFSSizer) RootFSSizeFromPath(string) uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址