代码之家  ›  专栏  ›  技术社区  ›  ambikanair

如何在`kubernetes.io/hostname`节点选择器中提供主机名列表

  •  1
  • ambikanair  · 技术社区  · 6 年前

    我需要提供一份 kubernetes.io/hostname 节点选择器。我尝试给出逗号分隔的列表,但kubernetes在给出时抛出了一些验证错误 kubectl apply -f <yaml file>

    我还尝试通过提供重复的主机名集来提供多个主机名 kubernetes.io/主机名 浏览时找不到任何有效的示例。

    谢谢

    The DaemonSet "ssh-daemonset" is invalid: spec.template.spec.nodeSelector: Invalid value: "1z.t3.x52.y7,l0.1k7.1p0.2q0": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
    
    1 回复  |  直到 6 年前
        1
  •  3
  •   apisim    6 年前

    https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#running-pods-on-only-some-nodes

    使用相同的标签,标记要运行守护程序pod的节点( kubectl label nodes <node-name> <label-key>=<label-value> spec.template.spec.nodeSelector .

    例子: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector

    推荐文章