你能在守护进程中使用--hostname-override和kube-proxy吗?

时间:2017-04-18 18:15:18

标签: kubernetes

我的群集(HA有多个master,etcd和节点)正在运行,但我发现我的kube-proxy运行不正常。我目前必须在kubelet上使用--hostname-override(设置为机器IP),因为我通过ansible在每台机器(主机和节点)上部署一个,因此工作正常。

我目前正在守护进程中使用kube-proxy(包含在下面)。在kube-proxy中有一个--hostname-override选项,但我不知道如何在deamonset中设置它。有人有什么建议吗?我猜这可能是不可能的,但我想问。

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  labels:
    component: kube-proxy-amd64
    k8s-app: kube-proxy-amd64
    kubernetes.io/cluster-service: "true"
    name: kube-proxy-amd64
    tier: node
  name: kube-proxy-amd64
  namespace: kube-system
spec:
  selector:
    matchLabels:
      component: kube-proxy-amd64
      k8s-app: kube-proxy-amd64
      kubernetes.io/cluster-service: "true"
      name: kube-proxy-amd64
      tier: node
  template:
    metadata:
      annotations:
        scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated","value":"master","effect":"NoSchedule"}]'
      labels:
        component: kube-proxy-amd64
        k8s-app: kube-proxy-amd64
        kubernetes.io/cluster-service: "true"
        name: kube-proxy-amd64
        tier: node
    spec:
      containers:
      - command:
        - /usr/local/bin/kube-proxy
        - --v=0
        - --master={{ api_lb_ip }}
        - --kubeconfig=/run/kubeadminconfig
        image: {{ kube_proxy_image }}
        imagePullPolicy: IfNotPresent
        name: kube-proxy
        securityContext:
          privileged: true
        terminationMessagePath: /dev/termination-log
        volumeMounts:
        - mountPath: /var/run/dbus
          name: dbus
        - mountPath: /run/kubeadminconfig
          name: kubeconfig
        - mountPath: {{ kube_config_dir }}
          name: pki
      dnsPolicy: ClusterFirst
      hostNetwork: true
      nodeSelector:
        beta.kubernetes.io/arch: amd64
      restartPolicy: Always
      volumes:
      - hostPath:
          path: {{ kubeadminconfig }}
        name: kubeconfig
      - hostPath:
          path: /var/run/dbus
        name: dbus
      - hostPath:
          path: {{ kube_config_dir }}
        name: pki

1 个答案:

答案 0 :(得分:0)

此时,似乎没有办法用deamonset设置它。我最后只是为每个节点设置它并使用manifeststs目录来部署它。