简体   繁体   中英

Can you use --hostname-override with kube-proxy in a daemonset?

I have my cluster(HA with multiple master, etcd and nodes) running but i have identified that my kube-proxy is not running correctly. I currently have to use --hostname-override (set to machine IP) on kubelet which works fine since i deploy one on each machine(master and node) via ansible.

I am currently am using kube-proxy in a daemonset ( included below). There is an option for --hostname-override in kube-proxy but i have no idea how you would set this in a deamonset. anyone have any suggestions? Im guessing this is likely not possible but figured i would ask.

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

At this time, there does not appear to be a way to set it with a deamonset. i ended up just using setting it for each node and using the manifests directory to deploy it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM