mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-23 09:43:46 +00:00
* Feat: add components and storage api-oriented defs * add some examples * change the dir * resolve comments * make reviewable * fix example * add labels and annotations in component * add config map ref key in env * add more traits * add wfstep defs and rename * fmt the cue * re-struct all the definitions * revert deprecated defs and add webhook def * delete useless network trait * fix generated tab * fix indent * fix webservice * add labels * comment webservice and worker's health check * fix retainkeys * fix webservice and worker's health check * add suspend def which will be replaced by internal def * fix cli and add labels * fix script * add ignore * fix healthscope example
40 lines
893 B
CUE
40 lines
893 B
CUE
"node-affinity": {
|
|
type: "trait"
|
|
annotations: {}
|
|
labels: {
|
|
"ui-hidden": "true"
|
|
}
|
|
description: "affinity specify node affinity and toleration on K8s pod for your workload which follows the pod spec in path 'spec.template'."
|
|
attributes: {
|
|
appliesToWorkloads: ["*"]
|
|
podDisruptive: true
|
|
}
|
|
}
|
|
template: {
|
|
patch: spec: template: spec: {
|
|
if parameter.affinity != _|_ {
|
|
affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: [{
|
|
matchExpressions: [
|
|
for k, v in parameter.affinity {
|
|
key: k
|
|
operator: "In"
|
|
values: v
|
|
},
|
|
]}]
|
|
}
|
|
if parameter.tolerations != _|_ {
|
|
tolerations: [
|
|
for k, v in parameter.tolerations {
|
|
effect: "NoSchedule"
|
|
key: k
|
|
operator: "Equal"
|
|
value: v
|
|
}]
|
|
}
|
|
}
|
|
parameter: {
|
|
affinity?: [string]: [...string]
|
|
tolerations?: [string]: string
|
|
}
|
|
}
|