Skip to main content

container

Source: base/pkg/kusion_models/kube/frontend/container/container.k

Schema Main

Main describes the main container configuration that is expected to be run on the host.

Attributes

Name and DescriptionTypeDefault ValueRequired
name
A Container-level attribute.
The container name. Each container in a pod must have a unique name.
str"main"required
command
A Container-level attribute.
The startup command of main process. The image's entrypoint is used if this is not provided.
[str]Undefinedoptional
args
A Container-level attribute.
The startup arguments of main process. The image's cmd is used if this is not provided.
[str]Undefinedoptional
useBuiltInEnv
useBuiltInEnv indicates use built-in envs or not.
boolFalseoptional
env
A Container-level attribute.
List of environment variables in the container.
[env.Env]Undefinedoptional
envFrom
A Container-level attribute.
List of sources to populate environment variables in the container.
[env.EnvFromSource]Undefinedoptional
ports
A Container-level attribute.
List of network ports in the container.
[port.ContainerPort]Undefinedoptional
livenessProbe
A Container-level attribute.
The probe to check whether container is live or not.
p.ProbeUndefinedoptional
readinessProbe
A Container-level attribute.
The probe to check whether container is ready or not.
The default value can be referred to presupposed template: base/pkg/kusion_models/templates/sofa_probe.k
p.ProbeUndefinedoptional
startupProbe
A Container-level attribute.
The probe to indicates that the Pod has successfully initialized.
p.ProbeUndefinedoptional
lifecyclelc.LifecycleUndefinedoptional
workingDirstrUndefinedoptional
securityContext{str: any}Undefinedoptional

Examples

import base.pkg.kusion_models.kube.frontend.container
import base.pkg.kusion_models.kube.frontend.container.probe as p

main = container.Main {
name = "test"
livenessProbe = p.Probe {
handler = p.Http {
path = "/healthz"
}
initialDelaySeconds = 10
}
}