Use node affinity to select architectures

This commit is contained in:
Carlos de Paula 2020-05-25 11:39:57 -03:00
parent 9d3076bf66
commit 17e7805ebf

View File

@ -72,7 +72,8 @@ local utils = import 'utils.libsonnet';
daemonset.mixin.metadata.withLabels(podLabels) + daemonset.mixin.metadata.withLabels(podLabels) +
daemonset.mixin.spec.selector.withMatchLabels(podLabels) + daemonset.mixin.spec.selector.withMatchLabels(podLabels) +
daemonset.mixin.spec.template.metadata.withLabels(podLabels) + daemonset.mixin.spec.template.metadata.withLabels(podLabels) +
daemonset.mixin.spec.template.spec.withAffinity({'nodeAffinity':{'requiredDuringSchedulingIgnoredDuringExecution':{'nodeSelectorTerms':[{'matchExpressions':[{'key':'kubernetes.io/arch','operator':'In','values':['arm','arm64']}]}]}}}) + daemonset.mixin.spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.withNodeSelectorTerms([{ matchExpressions: [{ key: 'kubernetes.io/arch', operator: 'In', values: ['arm', 'arm64'] }] }]) +
daemonset.mixin.spec.template.spec.withTolerations([{ operator: 'Exists' }]) +
daemonset.mixin.spec.template.spec.withServiceAccountName('arm-exporter') + daemonset.mixin.spec.template.spec.withServiceAccountName('arm-exporter') +
daemonset.mixin.spec.template.spec.withContainers(c), daemonset.mixin.spec.template.spec.withContainers(c),