server
Source: base/pkg/kusion_models/kube/frontend/server.k
Schema Server
Server is abstaction of Deployment and StatefulSet.
Attributes
Name and Description | Type | Default Value | Required |
---|---|---|---|
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. | int | 1 | required |
image Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images | str | Undefined | required |
schedulingStrategy SchedulingStrategy represents scheduling strategy. | strategy.SchedulingStrategy | Undefined | required |
mainContainer MainContainer describes the main container configuration that is expected to be run on the host. | container.Main | Undefined | required |
sidecarContainers SidecarContainers describes the list of sidecar container configuration that is expected to be run on the host. | [sidecar.Sidecar] | Undefined | optional |
initContainers InitContainers describes the list of sidecar container configuration that is expected to be run on the host. | [sidecar.Sidecar] | Undefined | optional |
useBuiltInLabels UseBuiltInLabels indicates use built-in labels or not. | bool | False | optional |
labels Labels is a map of string keys and values that can be used to organize and categorize (scope and select) objects. {str: str} | Undefined | optional | |
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} | Undefined | optional |
useBuiltInSelector UseBuiltInSelector indicates use built-in selector or not. | bool | False | optional |
selector Label selector for pods. Existing ReplicaSets/ whose pods are selected by this will be the ones affected by this deployment. | {str: str} | Undefined | optional |
podMetadata PodMetadata is metadata that all persisted resources must have, which includes all objects users must create. | apis.ObjectMeta | Undefined | optional |
volumes Volumes represents a named volume and corresponding mounts in containers. | [volume.Volume] | Undefined | optional |
needNamespace NeedNamespace mark server is namespace scoped or not. | bool | True | optional |
enableMonitoring EnableMonitoring mark server is enable monitor or not. | bool | False | optional |
configMaps ConfigMaps is a list of ConfigMap which holds configuration data for server to consume. | [configmap.ConfigMap] | Undefined | optional |
secrets Secrets is a list of Secret which hold secret data of a certain type. | [secret.Secret] | Undefined | optional |
services Services is a list of Service which partition a single Kubernetes cluster into multiple virtual clusters. | [service.Service] | Undefined | optional |
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] | Undefined | optional |
serviceAccount ServiceAccount is used to run this pod. | sa.ServiceAccount | Undefined | optional |
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
}