没有集群etcd的kube-dn的多个副本如何工作?

时间:2019-07-18 09:55:17

标签: kubernetes dns skydns

我有一个带有kube-dns复制控制器的Kubernetes v1.4.0集群,如下所示。我试图找出一种方法来重启kube-dns所在的kube-minion(node),而不会造成停机。

将副本数增加到2将在另一个节点上计划新的Pod,并且我可以重新启动该节点,但是sky-dnsetcd支持,并且etcd未聚类。如果没有群集的etcd,该策略将完全可行吗?

感谢您的帮助。

apiVersion: v1
kind: ReplicationController
metadata:
  name: kube-dns-v8
  namespace: default
  labels:
    k8s-app: kube-dns
    version: v8
    kubernetes.io/cluster-service: "true"
spec:
  replicas: 1
  selector:
    k8s-app: kube-dns
    version: v8
  template:
    metadata:
      labels:
        k8s-app: kube-dns
        version: v8
        kubernetes.io/cluster-service: "true"
    spec:
      containers:
      # etcd already running on master
      - name: etcd
        image: gcr.io/google_containers/etcd:2.0.9
        resources:
          limits:
            cpu: 100m
            memory: 50Mi
        command:
        - /usr/local/bin/etcd
        - -data-dir
        - /var/etcd/data
        - -listen-client-urls
        - http://127.0.0.1:2379,http://127.0.0.1:4001
        - -advertise-client-urls
        - http://127.0.0.1:2379,http://127.0.0.1:4001
        - -initial-cluster-token
        - skydns-etcd
        volumeMounts:
        - name: etcd-storage
          mountPath: /var/etcd/data
      - name: kube2sky
        image: gcr.io/google_containers/kube2sky:1.11
        resources:
          limits:
            cpu: 100m
            memory: 50Mi
        args:
          - -domain=kube.local
          - -kube_master_url=http://{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}:8080
          - -etcd-server=http://127.0.0.1:4001
      - name: skydns
        image: skynetservices/skydns:latest
        resources:
          limits:
            cpu: 100m
            memory: 50Mi
        args:
          - -machines=http://127.0.0.1:2379,http://127.0.0.1:4001
          - -addr=0.0.0.0:53
          - -domain=kube.local
          - -nameservers={{ ansible_dns.nameservers[0] }}:53
        ports:
        - containerPort: 53
          name: dns
          protocol: UDP
        - containerPort: 53
          name: dns-tcp
          protocol: TCP
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 30
          timeoutSeconds: 5
      - name: healthz
        image: gcr.io/google_containers/exechealthz:1.0
        resources:
          limits:
            cpu: 10m
            memory: 20Mi
        args:
          - -cmd=nslookup kubernetes.default.svc.kube.local localhost >/dev/null
          - -port=8080
        ports:
          - containerPort: 8080
            protocol: TCP
      volumes:
      - name: etcd-storage
        emptyDir: {}
      dnsPolicy: Default  # Don't use cluster DNS.

apiVersion: v1
kind: Service
metadata:
  name: kube-dns
  namespace: default
  labels:
    k8s-app: kube-dns
    kubernetes.io/cluster-service: "true"
    kubernetes.io/name: "KubeDNS"
spec:
  selector:
    k8s-app: kube-dns
  clusterIP: {{ cluster_nameserver1 }}
  ports:
  - name: dns
    port: 53
    protocol: UDP
  - name: dns-tcp
    port: 53
    protocol: TCP

0 个答案:

没有答案