diff --git a/konfig/docs/konfig.md b/konfig/docs/konfig.md index 1065fe4b..968b348e 100644 --- a/konfig/docs/konfig.md +++ b/konfig/docs/konfig.md @@ -136,9 +136,9 @@ Provider |**app** `required`|[ApplicationBuilder](#applicationbuilder)||utils.ApplicationBuilder {}| |**config** `required`|[Job](#job)||inputConfig| |**initContainers**|[{str:}]||| -|**jobAttrs** `required`|{str:}||{
metadata = utils.MetadataBuilder(config) \| {name = jobName}
spec = {
activeDeadlineSeconds = config.activeDeadlineSeconds
backoffLimit = config.backoffLimit
completionMode = config.completionMode
completions = config.completions
manualSelector = config.manualSelector
parallelism = config.parallelism
suspend = config.suspend
ttlSecondsAfterFinished = config.ttlSecondsAfterFinished
selector: {matchLabels = app.selector \| config.selector}
template = {
metadata = {
labels = app.labels
**config.podMetadata
}
spec = {
containers = [
mainContainer
*sidecarContainers
]
initContainers = initContainers
restartPolicy = config.restartPolicy
if config.volumes:
volumes = [utils.to_kube_volume(v) for v in config.volumes if v.volumeSource]

if config.serviceAccount:
serviceAccountName = config.serviceAccount.name

}
}
}
}| +|**jobAttrs** `required`|{str:}||{
metadata = utils.MetadataBuilder(config) \| {
name = jobName
}
spec = {
activeDeadlineSeconds = config.activeDeadlineSeconds
backoffLimit = config.backoffLimit
completionMode = config.completionMode
completions = config.completions
manualSelector = config.manualSelector
parallelism = config.parallelism
suspend = config.suspend
ttlSecondsAfterFinished = config.ttlSecondsAfterFinished
selector: {matchLabels = app.selector \| config.selector}
template = {
metadata = {
labels = app.labels
**config.podMetadata
}
spec = {
containers = [
mainContainer
*sidecarContainers
]
initContainers = initContainers
restartPolicy = config.restartPolicy
if config.volumes:
volumes = [utils.to_kube_volume(v) for v in config.volumes if v.volumeSource]

if config.serviceAccount:
serviceAccountName = config.serviceAccount.name

}
}
}
}| |**jobName** `required`|str||"{}-{}".format(metadata.__META_APP_NAME, metadata.__META_ENV_TYPE_NAME).lower()| -|**kubernetes** `required`|[ResourceMapping](#resourcemapping)||{"${typeof(_jobInstance)}" = [_jobInstance]}| +|**kubernetes** `required`|[ResourceMapping](#resourcemapping)||{
"${typeof(_jobInstance)}" = [_jobInstance]
}| |**mainContainer** `required`|{str:}||| |**mainContainerDict** `required`|{str:}||| |**sidecarContainers**|[{str:}]||| @@ -150,8 +150,8 @@ ServerBackend converts the user-written front-end model `Server` into a collecti | name | type | description | default value | | --- | --- | --- | --- | -|**_applicationLabel** `required`|{str:str}||{"app.k8s.io/component": workloadName}| -|**_workloadInstance**|[Deployment](#deployment) | [StatefulSet](#statefulset)||| +|**_applicationLabel** `required`|{str:str}||{
"app.k8s.io/component": workloadName
}| +|**_workloadInstance**|[Deployment](#deployment) \| [StatefulSet](#statefulset)||| |**app** `required`|[ApplicationBuilder](#applicationbuilder)||utils.ApplicationBuilder {}| |**config** `required`|[Server](#server)||inputConfig| |**initContainers**|[{str:}]||| @@ -159,7 +159,7 @@ ServerBackend converts the user-written front-end model `Server` into a collecti |**mainContainer** `required`|{str:}||| |**provider**|[]||| |**sidecarContainers**|[{str:}]||| -|**workloadAttributes** `required`|{str:}||{
metadata = utils.MetadataBuilder(config) \| {name = workloadName}
spec = {
replicas = config.replicas
if config.useBuiltInSelector:
selector: {matchLabels: app.selector \| config.selector \| _applicationLabel}
else:
selector: {matchLabels: config.selector}
template = {
metadata = {
if config.useBuiltInLabels:
labels = app.labels \| _applicationLabel

**config.podMetadata
}
spec = {
containers = [mainContainer] + (sidecarContainers or [])
initContainers = initContainers
if config.volumes:
volumes = [utils.to_kube_volume(v) for v in config.volumes if v.volumeSource]

if config.serviceAccount:
serviceAccountName = config.serviceAccount.name

}
}
}
}| +|**workloadAttributes** `required`|{str:}||{
metadata = utils.MetadataBuilder(config) \| {
name = workloadName
}
spec = {
replicas = config.replicas
if config.useBuiltInSelector:
selector: {matchLabels: app.selector \| config.selector \| _applicationLabel}
else:
selector: {matchLabels: config.selector}
template = {
metadata = {
if config.useBuiltInLabels:
labels = app.labels \| _applicationLabel

**config.podMetadata
}
spec = {
containers = [mainContainer] + (sidecarContainers or [])
initContainers = initContainers
if config.volumes:
volumes = [utils.to_kube_volume(v) for v in config.volumes if v.volumeSource]

if config.serviceAccount:
serviceAccountName = config.serviceAccount.name

}
}
}
}| |**workloadName** `required`|str||config.name or "{}{}".format(metadata.__META_APP_NAME, metadata.__META_ENV_TYPE_NAME).lower()| ### Job @@ -172,7 +172,7 @@ Job is the common user interface for one-time jobs, which is defined by Kubernet |**activeDeadlineSeconds**|int|Specifies the duration in seconds relative to the startTime that the job may be active
before the system tries to terminate it; value must be positive integer|| |**annotations**|{str:str}|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|| |**backoffLimit**|int|Specifies the number of retries before marking this job failed. Defaults to 6|6| -|**completionMode**|"NonIndexed" | "Indexed"|CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.|"NonIndexed"| +|**completionMode**|"NonIndexed" \| "Indexed"|CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.|"NonIndexed"| |**completions**|int|Specifies the desired number of successfully finished pods the job should be run with.
More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/|| |**configMaps**|[[ConfigMap](#configmap)]|ConfigMaps is a list of ConfigMap which holds configuration data for server to consume.|| |**image** `required`|str|Container image name. More info: https://kubernetes.io/docs/concepts/containers/images|option("image")| @@ -183,7 +183,7 @@ Job is the common user interface for one-time jobs, which is defined by Kubernet |**needNamespace**|bool|NeedNamespace mark server is namespace scoped or not.|True| |**parallelism**|int|Specifies the maximum desired number of pods the job should run at any given time.
More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/|| |**podMetadata**|[ObjectMeta](#objectmeta)|PodMetadata is metadata that all persisted resources must have, which includes all objects users must create.|| -|**restartPolicy**|"Never" | "OnFailure"|Restart policy for all containers within the pod. One of Always, OnFailure, Never.
Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy|"Never"| +|**restartPolicy**|"Never" \| "OnFailure"|Restart policy for all containers within the pod. One of Always, OnFailure, Never.
Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy|"Never"| |**schedulingStrategy**|[SchedulingStrategy](#schedulingstrategy)|SchedulingStrategy represents scheduling strategy.|strategy.SchedulingStrategy {}| |**selector**|{str:str}|A label query over pods that should match the pod count.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors|| |**serviceAccount**|[ServiceAccount](#serviceaccount)|ServiceAccount is used to run this pod.|| @@ -227,7 +227,7 @@ Server is abstaction of Deployment and StatefulSet. |**name**|str|The name of the workload and service.
If not defined, a generated name ("{__META_APP_NAME}-{__META_ENV_TYPE_NAME}") will be used.
The value of __META_APP_NAME will be extracted from the value of the "name" defined in project.yaml,
and the value of __META_ENV_TYPE_NAME will be extracted from the value of the "name" defined in stack.yaml.|| |**needNamespace**|bool|NeedNamespace mark server is namespace scoped or not.|True| |**podMetadata**|[ObjectMeta](#objectmeta)|PodMetadata is metadata that all persisted resources must have, which includes all objects users must create.|| -|**renderType**|"Server" | "KubeVelaApplication"|Application render type, default to 'Server'|"Server"| +|**renderType**|"Server" \| "KubeVelaApplication"|Application render type, default to 'Server'|"Server"| |**replicas** `required`|int|Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.|option("replicas") or 1| |**schedulingStrategy** `required`|[SchedulingStrategy](#schedulingstrategy)|SchedulingStrategy represents scheduling strategy.|strategy.SchedulingStrategy {}| |**secrets**|[[Secret](#secret)]|Secrets is a list of Secret which hold secret data of a certain type.|| @@ -239,7 +239,7 @@ Server is abstaction of Deployment and StatefulSet. |**useBuiltInLabels**|bool|UseBuiltInLabels indicates use built-in labels or not.|True| |**useBuiltInSelector**|bool|UseBuiltInSelector indicates use built-in selector or not.|True| |**volumes**|[[Volume](#volume)]|Volumes represents a named volume and corresponding mounts in containers.|| -|**workloadType** `required`|"Deployment" | "StatefulSet"|Application workload type, default to 'Deployment'|"Deployment"| +|**workloadType** `required`|"Deployment" \| "StatefulSet"|Application workload type, default to 'Deployment'|"Deployment"| #### Examples ``` @@ -275,7 +275,7 @@ Metadata is the base schema of all models, which contains data that helps unique | --- | --- | --- | --- | |**annotations**|{str:str}|Annotations is an unstructured key value map stored with a
resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects.
More info: http://kubernetes.io/docs/user-guide/annotations|| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| ### ConfigMap @@ -289,7 +289,7 @@ ConfigMap holds configuration data for pods to consume. More info: https://kuber |**binaryData**|{str:str}|BinaryData contains the binary data.|| |**data**|{str:str}|Data contains the configuration data.|| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| #### Examples @@ -312,8 +312,8 @@ Main describes the main container configuration that is expected to be run on th | name | type | description | default value | | --- | --- | --- | --- | -|**args**|[str]|A Container-level attribute.
The startup arguments of main process. The image's cmd is used if this is not provided.|| -|**command**|[str]|A Container-level attribute.
The startup command of main process. The image's entrypoint is used if this is not provided.|| +|**args**|[str]|A Container-level attribute.
The startup arguments of main process. The image's cmd is used if this is not provided.|| +|**command**|[str]|A Container-level attribute.
The startup command of main process. The image's entrypoint is used if this is not provided.|| |**env**|[EnvMap](#envmap)|A Container-level attribute.
List of environment variables in the container.|| |**envFrom**|[[EnvFromSource](#envfromsource)]|A Container-level attribute.
List of sources to populate environment variables in the container.|| |**lifecycle**|[Lifecycle](#lifecycle)|Actions that the management system should take in response to container lifecycle events. Cannot be updated.|| @@ -324,7 +324,7 @@ Main describes the main container configuration that is expected to be run on th |**securityContext**|{str:}|SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/|| |**startupProbe**|[Probe](#probe)|A Container-level attribute.
The probe to indicates that the Pod has successfully initialized.|| |**useBuiltInEnv**|bool|useBuiltInEnv indicates use built-in envs or not.|False| -|**workingDir**|str|Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.|| +|**workingDir**|str|Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.|| #### Examples ``` @@ -410,7 +410,7 @@ ResourceFieldSelector represents container resources (cpu, memory) and their out | name | type | description | default value | | --- | --- | --- | --- | |**containerName**|str|A Container-level attribute.|| -|**divisor**|int | units.NumberMultiplier|A Container-level attribute.
Specifies the output format of the exposed resources, defaults to 1|1| +|**divisor**|int \| units.NumberMultiplier|A Container-level attribute.
Specifies the output format of the exposed resources, defaults to 1|1| |**resource** `required`|str|A Container-level attribute.
Resource to select.|| ### Lifecycle @@ -420,8 +420,8 @@ Lifecycle describes actions that the management system should take in response t | name | type | description | default value | | --- | --- | --- | --- | -|**postStart**|[Exec](#exec) | [Http](#http)|A Container-level attribute.
The PostStart action is called immediately after a container is created.|| -|**preStop**|[Exec](#exec) | [Http](#http)|A Container-level attribute.
The PreStop action is called immediately before a container is terminated.|| +|**postStart**|[Exec](#exec) \| [Http](#http)|A Container-level attribute.
The PostStart action is called immediately after a container is created.|| +|**preStop**|[Exec](#exec) \| [Http](#http)|A Container-level attribute.
The PreStop action is called immediately before a container is terminated.|| #### Examples ``` @@ -450,9 +450,9 @@ ContainerPort represents a network port in a single container. | name | type | description | default value | | --- | --- | --- | --- | -|**containerPort** `required`|int|A Container-level attribute.
The number of port to expose on the container's IP address.|| +|**containerPort** `required`|int|A Container-level attribute.
The number of port to expose on the container's IP address.|| |**name**|str|If specified, this must be an IANA_SVC_NAME and unique within the pod.
Each named port in a pod must have a unique name.
Name for the port that can be referred to by services.|| -|**protocol** `required`|"TCP" | "UDP" | "SCTP"|A Container-level attribute.
The protocol for port. Must be UDP, TCP or SCTP. Default is TCP.|"TCP"| +|**protocol** `required`|"TCP" \| "UDP" \| "SCTP"|A Container-level attribute.
The protocol for port. Must be UDP, TCP or SCTP. Default is TCP.|"TCP"| #### Examples ``` @@ -482,7 +482,7 @@ Http describes an action based on HTTP Get requests. | --- | --- | --- | --- | |**path** `required`|str|A Container-level attribute.
The Path to access on the HTTP server. e.g /healthz|| |**port** `required`|int|A Container-level attribute.
The Number of the port to access on the container.|| -|**scheme** `required`|"HTTP" | "HTTPS"|A Container-level attribute.
Scheme to use for connecting to the host, defaults to HTTP.|"HTTP"| +|**scheme** `required`|"HTTP" \| "HTTPS"|A Container-level attribute.
Scheme to use for connecting to the host, defaults to HTTP.|"HTTP"| ### Probe Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. @@ -492,7 +492,7 @@ Probe describes a health check to be performed against a container to determine | name | type | description | default value | | --- | --- | --- | --- | |**failureThreshold**|int|A Container-level attribute.
Minimum consecutive failures for the probe to be considered failed after having succeeded.|| -|**handler** `required`|[Exec](#exec) | [Http](#http) | [Tcp](#tcp)|A Container-level attribute.
The action taken to determine the health of a container.|| +|**handler** `required`|[Exec](#exec) \| [Http](#http) \| [Tcp](#tcp)|A Container-level attribute.
The action taken to determine the health of a container.|| |**initialDelaySeconds**|int|A Container-level attribute.
The length of time before health checking is activated. In seconds.|| |**periodSeconds**|int|A Container-level attribute.
How often (in seconds) to perform the probe.|10| |**successThreshold**|int|A Container-level attribute.
Minimum consecutive successes for the probe to be considered successful after having failed.|| @@ -529,7 +529,7 @@ Ingress is a collection of rules that allow inbound connections to reach the end | --- | --- | --- | --- | |**annotations**|{str:str}|Annotations is an unstructured key value map stored with a
resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects.
More info: http://kubernetes.io/docs/user-guide/annotations|| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**rules**|[[IngressRule](#ingressrule)]|A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend.|| |**tls**|[[IngressTLS](#ingresstls)]|TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.|| @@ -575,7 +575,7 @@ rules: [PolicyRule], default is Undefined, optional Rules holds all the PolicyRu |**kubernetes** `required`|[ClusterRole](#clusterrole)||rbacv1.ClusterRole {
metadata = metadata
rules = rules
aggregationRule = aggregationRule
}| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| |**metadata**|{str:}||{
name: name?.lower()
annotations: annotations
namespace: namespace
labels: labels
}| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**rules**|[[PolicyRule](#policyrule)]||| ### ClusterRoleBinding @@ -590,7 +590,7 @@ subjects: [Subject], default is Undefined, optional Subjects holds references to |**kubernetes** `required`|[ClusterRoleBinding](#clusterrolebinding)||rbacv1.ClusterRoleBinding {
metadata = metadata
subjects = subjects
roleRef = roleRef
}| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| |**metadata**|{str:}||{
name: name?.lower()
annotations: annotations
namespace: namespace
labels: labels
}| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**roleRef** `required`|[RoleRef](#roleref)||| |**subjects**|[[Subject](#subject)]||| @@ -606,7 +606,7 @@ rules: [PolicyRule], default is Undefined, optional Rules holds all the PolicyRu |**kubernetes** `required`|[Role](#role)||rbacv1.Role {
metadata = metadata
rules = rules
}| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| |**metadata**|{str:}||{
name: name?.lower()
annotations: annotations
namespace: namespace
labels: labels
}| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**rules**|[[PolicyRule](#policyrule)]||| ### RoleBinding @@ -621,7 +621,7 @@ subjects: [Subject], default is Undefined, optional Subjects holds references to |**kubernetes** `required`|[RoleBinding](#rolebinding)||rbacv1.RoleBinding {
metadata = metadata
subjects = subjects
roleRef = roleRef
}| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| |**metadata**|{str:}||{
name: name?.lower()
annotations: annotations
namespace: namespace
labels: labels
}| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**roleRef** `required`|[RoleRef](#roleref)||| |**subjects**|[[Subject](#subject)]||| @@ -633,9 +633,9 @@ Resource describes the compute resource requirements. | name | type | description | default value | | --- | --- | --- | --- | -|**cpu**|int | units.NumberMultiplier|A Container-level attribute.
CPU, in cores, default 1 core. (500m = .5 cores)|1| -|**disk**|units.NumberMultiplier|A Container-level attribute.
Local disk storage, in bytes, default 10Gi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)|10Gi| -|**memory**|units.NumberMultiplier|A Container-level attribute.
Memory, in bytes, default 1024Mi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)|1024Mi| +|**cpu**|int \| units.NumberMultiplier|A Container-level attribute.
CPU, in cores, default 1 core. (500m = .5 cores)|1| +|**disk**|str \| units.NumberMultiplier|A Container-level attribute.
Local disk storage, in bytes, default 10Gi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)|10Gi| +|**memory**|str \| units.NumberMultiplier|A Container-level attribute.
Memory, in bytes, default 1024Mi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)|1024Mi| #### Examples ``` @@ -686,9 +686,9 @@ Secret holds secret data of a certain type. The total bytes of the values in the | name | type | description | default value | | --- | --- | --- | --- | |**annotations**|{str:str}|Annotations is an unstructured key value map stored with a
resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects.
More info: http://kubernetes.io/docs/user-guide/annotations|| -|**data**|{str:str}|Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'.
More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data|| +|**data**|{str:str}|Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'.
More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data|| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**stringData**|{str:str}|stringData allows specifying non-binary secret data in string form.
More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data|| |**type**|str|Used to facilitate programmatic handling of secret data.
More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types|| @@ -724,7 +724,7 @@ Service are Kubernetes objects which partition a single Kubernetes cluster into |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| |**loadBalancerIP**|str|Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field.|| |**loadBalancerSourceRanges**|[str]|If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs.
This field will be ignored if the cloud-provider does not support the feature.
More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/|| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**ports**|[[ServicePort](#serviceport)]|The list of ports that are exposed by this service.
More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies|| |**publishNotReadyAddresses**|bool|publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready.|| @@ -763,7 +763,7 @@ A service account provides an identity for processes that run in a Pod. ServiceA |**annotations**|{str:str}|Annotations is an unstructured key value map stored with a
resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects.
More info: http://kubernetes.io/docs/user-guide/annotations|| |**imagePullSecrets**|[{str:str}]|ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount.
More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod|| |**labels**|{str:str}|Labels is a map of string keys and values that can be used to
organize and categorize (scope and select) objects.
May match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels|| -|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| +|**name**|str|The name of the resource.
Name must be unique within a namespace. It's required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info:
http://kubernetes.io/docs/user-guide/identifiers#names|| |**namespace**|str|Namespaces are intended for use in environments with many users spread
across multiple teams, or projects.
For clusters with a few to tens of users, you should not need to create
or think about namespaces at all. Start using namespaces when you need the features they provide.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/|| |**secrets**|[{str:str}]|Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount.
More info: https://kubernetes.io/docs/concepts/configuration/secret|| #### Examples @@ -796,8 +796,8 @@ Sidecar describes the sidecar container configuration that is expected to be run | name | type | description | default value | | --- | --- | --- | --- | -|**args**|[str]|A Container-level attribute.
The startup arguments of main process. The image's cmd is used if this is not provided.|| -|**command**|[str]|A Container-level attribute.
The startup command of main process. The image's entrypoint is used if this is not provided.|| +|**args**|[str]|A Container-level attribute.
The startup arguments of main process. The image's cmd is used if this is not provided.|| +|**command**|[str]|A Container-level attribute.
The startup command of main process. The image's entrypoint is used if this is not provided.|| |**env**|[EnvMap](#envmap)|A Container-level attribute.
List of environment variables in the container.|| |**envFrom**|[[EnvFromSource](#envfromsource)]|A Container-level attribute.
List of sources to populate environment variables in the container.|| |**image** `required`|str|A Container-level attribute.
Container image name. More info: https://kubernetes.io/docs/concepts/containers/images|| @@ -806,10 +806,10 @@ Sidecar describes the sidecar container configuration that is expected to be run |**name** `required`|str|A Container-level attribute.
The container name. Each container in a pod must have a unique name.|| |**ports**|[[ContainerPort](#containerport)]|List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated.|| |**readinessProbe**|[Probe](#probe)|A Container-level attribute.
The probe to check whether container is ready or not.|| -|**resource** `required`|str | [Resource](#resource)|A Pod-level attribute.
Sidecar container resource.|| +|**resource** `required`|str \| [Resource](#resource)|A Pod-level attribute.
Sidecar container resource.|| |**securityContext**|{str:}|SecurityContext defines the security options the container should be run with.
If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/|| |**startupProbe**|[Probe](#probe)|A Container-level attribute.
The probe to indicates that the Pod has successfully initialized.|| -|**workingDir**|str|Container's working directory. If not specified, the container runtime's default will be used,
which might be configured in the container image. Cannot be updated.|| +|**workingDir**|str|Container's working directory. If not specified, the container runtime's default will be used,
which might be configured in the container image. Cannot be updated.|| #### Examples ``` @@ -836,8 +836,8 @@ Simple sidecar describes the sidecar container configuration that is expected to | name | type | description | default value | | --- | --- | --- | --- | |**extInfo**|{str:}|The extended information.|| -|**name** `required`|str|The sidecar name. e.g. 'odp','kmi','antmonitor'.|| -|**version** `required`|str|The sidecar version. e.g. 'v1.2.3'.|| +|**name** `required`|str|The sidecar name. e.g. 'odp','kmi','antmonitor'.|| +|**version** `required`|str|The sidecar version. e.g. 'v1.2.3'.|| #### Examples ``` @@ -860,7 +860,7 @@ DBAttr is the Attributes of cloud database. Attributes ---------- databaseEngine |**allocatedStorage**|int||10| |**databaseAccountName** `required`|str||| |**databaseAccountPassword** `required`|str||| -|**databaseEngine** `required`|"MySQL" | "SQLServer" | "PostgreSQL" | "MariaDB"||"MySQL"| +|**databaseEngine** `required`|"MySQL" \| "SQLServer" \| "PostgreSQL" \| "MariaDB"||"MySQL"| |**databaseEngineVersion** `required`|str||| |**extraMap**|{str:str}||| |**instanceType** `required`|str||| @@ -874,7 +874,7 @@ DataBase is the schema of cloud database. Attributes ---------- dataBaseType: Li | name | type | description | default value | | --- | --- | --- | --- | |**dataBaseAttr** `required`|[DBAttr](#dbattr)||| -|**dataBaseType** `required`|"aliyun_rds" | "aws_rds"||| +|**dataBaseType** `required`|"aliyun_rds" \| "aws_rds"||| ### ObjectStorage ObjectStorage is the schema of clouds object storage. Attributes ---------- objectStorageType: str, cloud object storage name, default is Undefined. objectStorageAttr: str, cloud object storage attribute, default is Undefined. @@ -903,7 +903,7 @@ SchedulingStrategy represents scheduling strategy. | name | type | description | default value | | --- | --- | --- | --- | -|**resource**|str | [Resource](#resource) | [ResourceRequirements](#resourcerequirements)|A Pod-level attribute.
Main container resource.|| +|**resource**|str \| [Resource](#resource) \| [ResourceRequirements](#resourcerequirements)|A Pod-level attribute.
Main container resource.|| ### CSI CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). @@ -926,7 +926,7 @@ ConfigMap represents a secret that should populate this volume. | --- | --- | --- | --- | |**defaultMode**|int|A Pod-level attribute.
Mode bits used to set permissions on created files by default.|| |**items**|[{str:str}]|A Pod-level attribute.
Key-value pairs projected into the volume.|| -|**name** `required`|str|A Pod-level attribute.
Name of the configMap in the pod's namespace to use.|| +|**name** `required`|str|A Pod-level attribute.
Name of the configMap in the pod's namespace to use.|| ### DownwardAPI DownwardAPI represents a secret that should populate this volume. @@ -939,13 +939,13 @@ DownwardAPI represents a secret that should populate this volume. |**items**|[{str:}]|A Pod-level attribute.
Items is a list of downward API volume file|| ### EmptyDir -EmptyDir represents a temporary directory that shares a pod's lifetime. +EmptyDir represents a temporary directory that shares a pod's lifetime. #### Attributes | name | type | description | default value | | --- | --- | --- | --- | -|**medium** `required`|"" | "Memory"|A Pod-level attribute.
What type of storage medium should back this directory.|""| +|**medium** `required`|"" \| "Memory"|A Pod-level attribute.
What type of storage medium should back this directory.|""| |**sizeLimit**|str|A Pod-level attribute.
Total amount of local storage required for this EmptyDir volume.|| ### FlexVolume @@ -980,7 +980,7 @@ Mount represents a mounting of a Volume within a container. |**container** `required`|str|A Pod-level attribute.
Name of container to mount, * represents all containers.|"*"| |**path** `required`|str|A Container-level attribute.
Path within the container at which the volume should be mounted.|| |**readOnly**|bool|A Container-level attribute.
Mounted read-only if true, read-write otherwise.|False| -|**subPath**|str|A Container-level attribute.
Path within the volume from which the container's volume should be mounted.|| +|**subPath**|str|A Container-level attribute.
Path within the volume from which the container's volume should be mounted.|| ### Secret Secret represents a secret that should populate this volume. @@ -991,7 +991,7 @@ Secret represents a secret that should populate this volume. | --- | --- | --- | --- | |**defaultMode**|int|A Pod-level attribute.
Mode bits used to set permissions on created files by default.|| |**items**|[{str:str}]|A Pod-level attribute.
Key-value pairs projected into the volume.|| -|**secretName** `required`|str|A Pod-level attribute.
Name of the secret in the pod's namespace to use.|| +|**secretName** `required`|str|A Pod-level attribute.
Name of the secret in the pod's namespace to use.|| ### Volume Volume represents a named volume and corresponding mounts in containers. @@ -1000,9 +1000,9 @@ Volume represents a named volume and corresponding mounts in containers. | name | type | description | default value | | --- | --- | --- | --- | -|**mounts**|[[Mount](#mount)]|Volumes to mount into the container's filesystem.|| -|**name** `required`|str|Volume's name. Must be a DNS_LABEL and unique within the pod.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names|| -|**volumeSource** `required`|[EmptyDir](#emptydir) | [Secret](#secret) | [ConfigMap](#configmap) | [FlexVolume](#flexvolume) | [HostPath](#hostpath) | [DownwardAPI](#downwardapi) | [CSI](#csi)|VolumeSource represents the location and type of the mounted volume.|| +|**mounts**|[[Mount](#mount)]|Volumes to mount into the container's filesystem.|| +|**name** `required`|str|Volume's name. Must be a DNS_LABEL and unique within the pod.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names|| +|**volumeSource** `required`|[EmptyDir](#emptydir) \| [Secret](#secret) \| [ConfigMap](#configmap) \| [FlexVolume](#flexvolume) \| [HostPath](#hostpath) \| [DownwardAPI](#downwardapi) \| [CSI](#csi)|VolumeSource represents the location and type of the mounted volume.|| #### Examples ``` @@ -1109,7 +1109,7 @@ ApplicationBuilder contains the workload labels, selector and environments about | name | type | description | default value | | --- | --- | --- | --- | -|**resource** `required`|[{str:}]||[{
cpu = {
requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip()
limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip()
}
} if "cpu" in item else ({
memory = {
requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip()
limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip()
}
} if "memory" in item else ({
disk = {
requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip()
limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip()
}
} if "disk" in item else Undefined)) for item in schedulingResourceItems]| +|**resource** `required`|[{str:}]||[{
cpu = {
requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip()
limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip()
}
} if "cpu" in item else ({
memory = {
requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip()
limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip()
}
} if "memory" in item else ({
disk = {
requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip()
limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip()
}
} if "disk" in item else Undefined)) for item in schedulingResourceItems]| |**resourceRequirementsUnit**|[ResourceRequirements](#resourcerequirements)||resourcePara as res.ResourceRequirements if typeof(resourcePara) == "ResourceRequirements" else None| |**resourceStr**|str||resourcePara as str if typeof(resourcePara) == "str" else None| |**resourceUnit**|[Resource](#resource)||resourcePara as res.Resource if typeof(resourcePara) == "Resource" else None| diff --git a/konfig/kcl.mod b/konfig/kcl.mod index ab77d755..1855ba4c 100644 --- a/konfig/kcl.mod +++ b/konfig/kcl.mod @@ -1,6 +1,6 @@ [package] name = "konfig" -version = "0.6.0" +version = "0.7.0" description = "Konfig provides users with an out-of-the-box, highly abstract configuration interface. The original starting point of the model library is to improve the efficiency and experience of YAML users. We hope to simplify the writing of user-side configuration code by abstracting and encapsulating the model with more complex code into a unified model." [dependencies] diff --git a/konfig/models/kube/frontend/resource/resource.k b/konfig/models/kube/frontend/resource/resource.k index 9d6f85d8..be00aaf5 100644 --- a/konfig/models/kube/frontend/resource/resource.k +++ b/konfig/models/kube/frontend/resource/resource.k @@ -29,5 +29,5 @@ schema Resource: """ cpu?: int | Unit = 1 - memory?: Unit = 1024Mi - disk?: Unit = 10Gi + memory?: str | Unit = 1024Mi + disk?: str | Unit = 10Gi