Files
kubevela/charts/vela-minimal/templates/defwithtemplate/node-affinity.yaml
Nash Tsai 1e022999a8 Refactor: refactor Helm chart with unnecessary 'systemDefinitionNames` value (#3267)
* refactor: refactor Helm chart with unnecessary 'systemDefinitionNamespace' value

* Revert "refactor: refactor Helm chart with unnecessary 'systemDefinitionNamespace' value"

This reverts commit 2ae764737f.

* Fix: Helm chart's 'Values.systemDefinitionNamespace' have default value of '.Release.Namespace' if unspecified.

* fix: fixed vela cli  referenced '{{.Values.systemDefinitionNamespace}}'

Co-authored-by: yungcheng.tyc <yungcheng.tyc@alibaba-inc.com>
2022-02-18 14:05:38 +08:00

45 lines
1.4 KiB
YAML

# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/node-affinity.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: affinity specify node affinity and toleration on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: node-affinity
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
podDisruptive: true
schematic:
cue:
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
}