我试图在一个helm图表中设置一个子图表的节点关联性,据我所知,我需要使用--set
参数来完成此操作,但如何在cli上传递该参数有点困难。这是我试图设置的等效节点关联性:
mariadb:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: arch
operator: In
values:
- x86_64
尝试这样做,但是使用数组声明等,感觉不对(并且没有做任何事情):helm install gitea gitea-charts/gitea -f ./values.yaml --set 'memcached.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.key.arch=x86_64' --set 'mariadb.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.key.arch=x86_64'
2条答案
按热度按时间uemypmqf1#
My recommendation for doing something like this, especially when you have a mix of types, is not to use
--set
but to use a second values yaml -- or amend the existing values yaml if you have one. Overriding the affinity via set gets quite messy and isn't very readable. But if you use a separate values yaml, then instead of:You would just have
(if you amended the existing values.yaml)
or
(if you chose to put the affinity in a separate yaml.)
EDIT (Information provided by Emily): Output of getting the mariadb pod:
(Pod is failing as the bitnami chart doesn't support arm and this is an arm host)
It's affinity in the pod:
Contents of affinity.yaml
cetgtptt2#
感谢Blender Fox的帮助和挖掘。问题是当memcached图表在主配置下嵌套
affinity:
时,数据库(postgresql和mariadb)对主节点和任何辅助节点都有额外的设置。我通过在主gitea图表中对mariadb
子图表的设置覆盖下执行以下操作来修复它:编辑pod向我证明了这一点,现在得到正确的设置,不需要额外的cli选项:
helm install gitea gitea-charts/gitea -f ./values.yaml