如何使用 mcrouter helm chart 为 memcached 设置节点污点?

How to set node taint for memcached using mcrouter helm chart?

我正在使用 mcrouter helm chart 在 GKE 上设置 mcrouter。对于我的设置,我希望有一个用于 memcached statefulset 的专用节点池和一个用于 mcrouter 的守护进程集。

我是 creating the node pool with a taint using the --node-taints flag. To ensure that the memcached statefulset can run on this node pool I need to specify tolerations as described in https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/

如何指定容忍度?我目前正在使用 helm 创建我的设置,如下所示:

helm install stable/mcrouter --name=mycache --set memcached.replicaCount=15 --set memcached.resources.requests.memory=10Gi --set memcached.resources.requests.cpu=2 --set resources.requests.memory=512Mi --set resources.requests.cpu=1.5 --set resources.limits.memory=512Mi --set resources.limits.cpu=2 --set memcached.memcached.maxItemMemory=8432

Helm Chart不支持

创建 DaemonSet 后,您可以对其进行修补。例如(更改为您想要的任何容忍度):

$ kubectl patch daemonset mycache-mcrouter -p='{"spec":{"template": {"spec":  {"tolerations": [{"key": "key1", "operator": "Equal", "value": "value1", "effect": "NoSchedule"}]}}}}'

您也可以上游更改以支持容忍度。您必须在 values.yaml(https://github.com/helm/charts/blob/master/stable/mcrouter/values.yaml) file and then optionally use it in the daemonset.yaml 模板中添加变量。