Kubernetes:创建kube-dns服务 [英] Kubernetes: kube-dns Service Creation
问题描述
用IP 192.168.3.10编写skydns-svc.yml文件后,出现以下错误:
After writing a skydns-svc.yml file with the IP 192.168.3.10 I recieve 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
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
这怎么不在有效范围内,我该如何解决错误?使用V1.2
How is this not in a valid range and how could I go about resolving the error? Using V1.2
推荐答案
您需要将clusterIP设置为"SERVICE_CLUSTER_IP_RANGE"中的IP,该IP是传递给kube的CIDR范围(通常为/16或更小). apiserver进程在--service-cluster-ip-range
标志中.如果您选择该范围内的任何地址,您将不再收到上述错误.
You need to set the clusterIP to an IP in the "SERVICE_CLUSTER_IP_RANGE", which is a CIDR range (typically a /16 or smaller) passed to the kube-apiserver process in the --service-cluster-ip-range
flag. If you pick any address in that range you should no longer receive the above error.
这篇关于Kubernetes:创建kube-dns服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!