Kubernetes: creating kube-dns service

After writing the skydns-svc.yml file with IP 192.168.3.10, I get the following error:

Error: The Service "kube-dns" is invalid:spec.clusterIP: Invalid value: "192.168.3.10": provided IP is not in the valid range

skydns-svc.yml

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

How is this not within the acceptable range and how can I solve the problem? Using V1.2

+2
source share
1 answer

You need to set the IP IP address for the cluster to "SERVICE_CLUSTER_IP_RANGE", which is the CIDR range (usually a / 16 or less) passed to the kube-apiserver process in the flag --service-cluster-ip-range. If you select any address in this range, you will no longer receive the above error.

+5
source

Source: https://habr.com/ru/post/1612564/


All Articles