@soft-stech/fleet
Version:
822 lines • 70.1 kB
JavaScript
import { z } from "zod";
import { iObjectMetaSchema } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema";
/**
* Cluster corresponds to a Kubernetes cluster. Fleet deploys bundles to targeted clusters.
* Clusters to which Fleet deploys manifests are referred to as downstream
* clusters. In the single cluster use case, the Fleet manager Kubernetes
* cluster is both the manager and downstream cluster at the same time.
*/
export const IClusterSchema = z.object({
/**
* APIVersion defines the versioned schema of this representation of an object.
* Servers should convert recognized schemas to the latest internal value, and
* may reject unrecognized values.
* More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
*/
apiVersion: z.literal("fleet.cattle.io/v1alpha1"),
/**
* Kind is a string value representing the REST resource this object represents.
* Servers may infer this from the endpoint the client submits requests to.
* Cannot be updated.
* In CamelCase.
* More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
*/
kind: z.literal("Cluster"),
metadata: iObjectMetaSchema.optional(),
spec: z
.object({
/**
* AgentAffinity overrides the default affinity for the cluster's agent
* deployment. If this value is nil the default affinity is used.
*/
agentAffinity: z
.object({
/**
* Describes node affinity scheduling rules for the pod.
*/
nodeAffinity: z
.object({
/**
* The scheduler will prefer to schedule pods to nodes that satisfy
* the affinity expressions specified by this field, but it may choose
* a node that violates one or more of the expressions. The node that is
* most preferred is the one with the greatest sum of weights, i.e.
* for each node that meets all of the scheduling requirements (resource
* request, requiredDuringScheduling affinity expressions, etc.),
* compute a sum by iterating through the elements of this field and adding
* "weight" to the sum if the node matches the corresponding matchExpressions; the
* node(s) with the highest sum are the most preferred.
*/
preferredDuringSchedulingIgnoredDuringExecution: z
.array(z.object({
/**
* A node selector term, associated with the corresponding weight.
*/
preference: z.object({
/**
* A list of node selector requirements by node's labels.
*/
matchExpressions: z
.array(z.object({
/**
* The label key that the selector applies to.
*/
key: z.string(),
/**
* Represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
*/
operator: z.string(),
/**
* An array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. If the operator is Gt or Lt, the values
* array must have a single element, which will be interpreted as an integer.
* This array is replaced during a strategic merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* A list of node selector requirements by node's fields.
*/
matchFields: z
.array(z.object({
/**
* The label key that the selector applies to.
*/
key: z.string(),
/**
* Represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
*/
operator: z.string(),
/**
* An array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. If the operator is Gt or Lt, the values
* array must have a single element, which will be interpreted as an integer.
* This array is replaced during a strategic merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional()
}),
/**
* Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
* @format int32
*/
weight: z.int32()
}))
.optional(),
/**
* If the affinity requirements specified by this field are not met at
* scheduling time, the pod will not be scheduled onto the node.
* If the affinity requirements specified by this field cease to be met
* at some point during pod execution (e.g. due to an update), the system
* may or may not try to eventually evict the pod from its node.
*/
requiredDuringSchedulingIgnoredDuringExecution: z
.object({
/**
* Required. A list of node selector terms. The terms are ORed.
*/
nodeSelectorTerms: z.array(z.object({
/**
* A list of node selector requirements by node's labels.
*/
matchExpressions: z
.array(z.object({
/**
* The label key that the selector applies to.
*/
key: z.string(),
/**
* Represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
*/
operator: z.string(),
/**
* An array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. If the operator is Gt or Lt, the values
* array must have a single element, which will be interpreted as an integer.
* This array is replaced during a strategic merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* A list of node selector requirements by node's fields.
*/
matchFields: z
.array(z.object({
/**
* The label key that the selector applies to.
*/
key: z.string(),
/**
* Represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
*/
operator: z.string(),
/**
* An array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. If the operator is Gt or Lt, the values
* array must have a single element, which will be interpreted as an integer.
* This array is replaced during a strategic merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional()
}))
})
.optional()
})
.optional(),
/**
* Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
*/
podAffinity: z
.object({
/**
* The scheduler will prefer to schedule pods to nodes that satisfy
* the affinity expressions specified by this field, but it may choose
* a node that violates one or more of the expressions. The node that is
* most preferred is the one with the greatest sum of weights, i.e.
* for each node that meets all of the scheduling requirements (resource
* request, requiredDuringScheduling affinity expressions, etc.),
* compute a sum by iterating through the elements of this field and adding
* "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
* node(s) with the highest sum are the most preferred.
*/
preferredDuringSchedulingIgnoredDuringExecution: z
.array(z.object({
/**
* Required. A pod affinity term, associated with the corresponding weight.
*/
podAffinityTerm: z.object({
/**
* A label query over a set of resources, in this case pods.
* If it's null, this PodAffinityTerm matches with no Pods.
*/
labelSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z
.record(z.string(), z.string())
.optional()
})
.optional(),
/**
* MatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both matchLabelKeys and labelSelector.
* Also, matchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
matchLabelKeys: z.array(z.string()).optional(),
/**
* MismatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
* Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
mismatchLabelKeys: z.array(z.string()).optional(),
/**
* A label query over the set of namespaces that the term applies to.
* The term is applied to the union of the namespaces selected by this field
* and the ones listed in the namespaces field.
* null selector and null or empty namespaces list means "this pod's namespace".
* An empty selector ({}) matches all namespaces.
*/
namespaceSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z
.record(z.string(), z.string())
.optional()
})
.optional(),
/**
* namespaces specifies a static list of namespace names that the term applies to.
* The term is applied to the union of the namespaces listed in this field
* and the ones selected by namespaceSelector.
* null or empty namespaces list and null namespaceSelector means "this pod's namespace".
*/
namespaces: z.array(z.string()).optional(),
/**
* This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
* the labelSelector in the specified namespaces, where co-located is defined as running on a node
* whose value of the label with key topologyKey matches that of any node on which any of the
* selected pods is running.
* Empty topologyKey is not allowed.
*/
topologyKey: z.string()
}),
/**
* weight associated with matching the corresponding podAffinityTerm,
* in the range 1-100.
* @format int32
*/
weight: z.int32()
}))
.optional(),
/**
* If the affinity requirements specified by this field are not met at
* scheduling time, the pod will not be scheduled onto the node.
* If the affinity requirements specified by this field cease to be met
* at some point during pod execution (e.g. due to a pod label update), the
* system may or may not try to eventually evict the pod from its node.
* When there are multiple elements, the lists of nodes corresponding to each
* podAffinityTerm are intersected, i.e. all terms must be satisfied.
*/
requiredDuringSchedulingIgnoredDuringExecution: z
.array(z.object({
/**
* A label query over a set of resources, in this case pods.
* If it's null, this PodAffinityTerm matches with no Pods.
*/
labelSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z.record(z.string(), z.string()).optional()
})
.optional(),
/**
* MatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both matchLabelKeys and labelSelector.
* Also, matchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
matchLabelKeys: z.array(z.string()).optional(),
/**
* MismatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
* Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
mismatchLabelKeys: z.array(z.string()).optional(),
/**
* A label query over the set of namespaces that the term applies to.
* The term is applied to the union of the namespaces selected by this field
* and the ones listed in the namespaces field.
* null selector and null or empty namespaces list means "this pod's namespace".
* An empty selector ({}) matches all namespaces.
*/
namespaceSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z.record(z.string(), z.string()).optional()
})
.optional(),
/**
* namespaces specifies a static list of namespace names that the term applies to.
* The term is applied to the union of the namespaces listed in this field
* and the ones selected by namespaceSelector.
* null or empty namespaces list and null namespaceSelector means "this pod's namespace".
*/
namespaces: z.array(z.string()).optional(),
/**
* This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
* the labelSelector in the specified namespaces, where co-located is defined as running on a node
* whose value of the label with key topologyKey matches that of any node on which any of the
* selected pods is running.
* Empty topologyKey is not allowed.
*/
topologyKey: z.string()
}))
.optional()
})
.optional(),
/**
* Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
*/
podAntiAffinity: z
.object({
/**
* The scheduler will prefer to schedule pods to nodes that satisfy
* the anti-affinity expressions specified by this field, but it may choose
* a node that violates one or more of the expressions. The node that is
* most preferred is the one with the greatest sum of weights, i.e.
* for each node that meets all of the scheduling requirements (resource
* request, requiredDuringScheduling anti-affinity expressions, etc.),
* compute a sum by iterating through the elements of this field and adding
* "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
* node(s) with the highest sum are the most preferred.
*/
preferredDuringSchedulingIgnoredDuringExecution: z
.array(z.object({
/**
* Required. A pod affinity term, associated with the corresponding weight.
*/
podAffinityTerm: z.object({
/**
* A label query over a set of resources, in this case pods.
* If it's null, this PodAffinityTerm matches with no Pods.
*/
labelSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z
.record(z.string(), z.string())
.optional()
})
.optional(),
/**
* MatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both matchLabelKeys and labelSelector.
* Also, matchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
matchLabelKeys: z.array(z.string()).optional(),
/**
* MismatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
* Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
mismatchLabelKeys: z.array(z.string()).optional(),
/**
* A label query over the set of namespaces that the term applies to.
* The term is applied to the union of the namespaces selected by this field
* and the ones listed in the namespaces field.
* null selector and null or empty namespaces list means "this pod's namespace".
* An empty selector ({}) matches all namespaces.
*/
namespaceSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z
.record(z.string(), z.string())
.optional()
})
.optional(),
/**
* namespaces specifies a static list of namespace names that the term applies to.
* The term is applied to the union of the namespaces listed in this field
* and the ones selected by namespaceSelector.
* null or empty namespaces list and null namespaceSelector means "this pod's namespace".
*/
namespaces: z.array(z.string()).optional(),
/**
* This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
* the labelSelector in the specified namespaces, where co-located is defined as running on a node
* whose value of the label with key topologyKey matches that of any node on which any of the
* selected pods is running.
* Empty topologyKey is not allowed.
*/
topologyKey: z.string()
}),
/**
* weight associated with matching the corresponding podAffinityTerm,
* in the range 1-100.
* @format int32
*/
weight: z.int32()
}))
.optional(),
/**
* If the anti-affinity requirements specified by this field are not met at
* scheduling time, the pod will not be scheduled onto the node.
* If the anti-affinity requirements specified by this field cease to be met
* at some point during pod execution (e.g. due to a pod label update), the
* system may or may not try to eventually evict the pod from its node.
* When there are multiple elements, the lists of nodes corresponding to each
* podAffinityTerm are intersected, i.e. all terms must be satisfied.
*/
requiredDuringSchedulingIgnoredDuringExecution: z
.array(z.object({
/**
* A label query over a set of resources, in this case pods.
* If it's null, this PodAffinityTerm matches with no Pods.
*/
labelSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z.record(z.string(), z.string()).optional()
})
.optional(),
/**
* MatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both matchLabelKeys and labelSelector.
* Also, matchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
matchLabelKeys: z.array(z.string()).optional(),
/**
* MismatchLabelKeys is a set of pod label keys to select which pods will
* be taken into consideration. The keys are used to lookup values from the
* incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
* to select the group of existing pods which pods will be taken into consideration
* for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
* pod labels will be ignored. The default value is empty.
* The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
* Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
* This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
*/
mismatchLabelKeys: z.array(z.string()).optional(),
/**
* A label query over the set of namespaces that the term applies to.
* The term is applied to the union of the namespaces selected by this field
* and the ones listed in the namespaces field.
* null selector and null or empty namespaces list means "this pod's namespace".
* An empty selector ({}) matches all namespaces.
*/
namespaceSelector: z
.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
matchExpressions: z
.array(z.object({
/**
* key is the label key that the selector applies to.
*/
key: z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
operator: z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
values: z.array(z.string()).optional()
}))
.optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
matchLabels: z.record(z.string(), z.string()).optional()
})
.optional(),
/**
* namespaces specifies a static list of namespace names that the term applies to.
* The term is applied to the union of the namespaces listed in this field
* and the ones selected by namespaceSelector.
* null or empty namespaces list and null namespaceSelector means "this pod's namespace".
*/
namespaces: z.array(z.string()).optional(),
/**
* This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
* the labelSelector in the specified namespaces, where co-located is defined as running on a node
* whose value of the label with key topologyKey matches that of any node on which any of the
* selected pods is running.
* Empty topologyKey is not allowed.
*/
topologyKey: z.string()
}))
.optional()
})
.optional()
})
.optional(),
/**
* AgentEnvVars are extra environment variables to be added to the agent deployment.
*/
agentEnvVars: z
.array(z.object({
/**
* Name of the environment variable. Must be a C_IDENTIFIER.
*/
name: z.string(),
/**
* Variable references $(VAR_NAME) are expanded
* using the previously defined environment variables in the container and
* any service environment variables. If a variable cannot be resolved,
* the reference in the input string will be unchanged. Double $$ are reduced
* to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
* "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
* Escaped references will never be expanded, regardless of whether the variable
* exists or not.
* Defaults to "".
*/
value: z.string().optional(),
/**
* Source for the environment variable's value. Cannot be used if value is not empty.
*/
valueFrom: z
.object({
/**
* Selects a key of a ConfigMap.
*/
configMapKeyRef: z
.object({
/**
* The key to select.
*/
key: z.string(),
/**
* Name of the referent.
* This field is effectively required, but due to backwards compatibility is
* allowed to be empty. Instances of this type with an empty value here are
* almost certainly wrong.
* TODO: Add other useful fields. apiVersion, kind, uid?
* More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
* TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
*/
name: z.string().optional(),
/**
* Specify whether the ConfigMap or its key must be defined
*/
optional: z.boolean().optional()
})
.optional(),
/**
* Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
* spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
*/
fieldRef: z
.object({
/**
* Version of the schema the FieldPath is written in terms of, defaults to "v1".
*/
apiVersion: z.string().optional(),
/**
* Path of the field to select in the specified API version.
*/
fieldPath: z.string()
})
.optional(),
/**
* Selects a resource of the container: only resources limits and requests
* (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
*/
resourceFieldRef: z
.object({
/**
* Container name: required for volumes, optional for env vars
*/
containerName: z.string().optional(),
/**
*