Skip to main content

server

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

Schema Server

Server is abstaction of Deployment and StatefulSet.

Attributes

Name and DescriptionTypeDefault ValueRequired
workloadType
Application workload type, default to 'Deployment'
"Deployment" | "StatefulSet""Deployment"required
replicas
Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
int1required
image
Docker image name.
More info: https://kubernetes.io/docs/concepts/containers/images
strUndefinedrequired
schedulingStrategy
SchedulingStrategy represents scheduling strategy.
strategy.SchedulingStrategyUndefinedrequired
mainContainer
MainContainer describes the main container configuration that is expected to be run on the host.
container.MainUndefinedrequired
sidecarContainers
SidecarContainers describes the list of sidecar container configuration that is expected to be run on the host.
[sidecar.Sidecar]Undefinedoptional
initContainers
InitContainers describes the list of sidecar container configuration that is expected to be run on the host.
[sidecar.Sidecar]Undefinedoptional
useBuiltInLabels
UseBuiltInLabels indicates use built-in labels or not.
boolFalseoptional
labels
Labels is a map of string keys and values that can be used to organize and categorize (scope and select) objects.
{str: str}
Undefinedoptional
annotations
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
More info: http://kubernetes.io/docs/user-guide/annotations
{str: str}Undefinedoptional
useBuiltInSelector
UseBuiltInSelector indicates use built-in selector or not.
boolFalseoptional
selector
Label selector for pods. Existing ReplicaSets/ whose pods are selected by this will be the ones affected by this deployment.
{str: str}Undefinedoptional
podMetadata
PodMetadata is metadata that all persisted resources must have, which includes all objects users must create.
apis.ObjectMetaUndefinedoptional
volumes
Volumes represents a named volume and corresponding mounts in containers.
[volume.Volume]Undefinedoptional
needNamespace
NeedNamespace mark server is namespace scoped or not.
boolTrueoptional
enableMonitoring
EnableMonitoring mark server is enable monitor or not.
boolFalseoptional
configMaps
ConfigMaps is a list of ConfigMap which holds configuration data for server to consume.
[configmap.ConfigMap]Undefinedoptional
secrets
Secrets is a list of Secret which hold secret data of a certain type.
[secret.Secret]Undefinedoptional
services
Services is a list of Service which partition a single Kubernetes cluster into multiple virtual clusters.
[service.Service]Undefinedoptional
ingresses
Ingresses is a list of Ingress which is collection of rules that allow inbound connections to reach the endpoints defined by a backend.
[ingress.Ingress]Undefinedoptional
serviceAccount
ServiceAccount is used to run this pod.
sa.ServiceAccountUndefinedoptional

Examples

import base.pkg.kusion_models.kube.frontend
import base.pkg.kusion_models.kube.frontend.container
import base.pkg.kusion_models.kube.templates.resource as res_tpl

appConfiguration: frontend.Server {
mainContainer = container.Main {
name = "php-redis"
env = [
{
name = "GET_HOSTS_FROM"
value = "dns"
}
]
ports = [{containerPort = 80}]
}
selector = {
tier = "frontend"
}
podMetadata.labels: {
tier = "frontend"
}
schedulingStrategy.resource = res_tpl.tiny
}