Minikube和非默认NodePorts

问题描述 投票:0回答:1

我正试图在带有StatefulSet的pod中启动我的dockerized应用程序。该应用程序使用围绕20 ports,其他服务已知,所以我想在与docker / k8s之前相同的端口号上公开它们。为此,我在service.yaml文件中添加了端口映射,如下所示:

- port: 8080
  targetPort: 8080
  nodePort: 8080
  protocol: TCP
  name: serverpool1
- port: 8081
  targetPort: 8081
  nodePort: 8081
  protocol: TCP
  name: serverpool2

为了完成这项工作,我需要能够使用不在默认范围内的nodePorts。对于我所看到的,它应该像这样工作:

minikube start --extra-config=apiserver.ServiceNodePortRange=5000-46000

问题是,如果我有--extra-config参数,minikube不会启动,但会出错:

Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...

E0904 09:18:24.862606   28110 start.go:305] Error restarting cluster:  restarting kube-proxy: waiting for kube-proxy to be up for configmap update: timed out waiting for the condition

如果没有--extra-config参数,它会正常启动,但我无法使用较低的端口。

我有一台带有High Sierra的Mac,我使用VirtualBox作为VM,我有minikube version v0.28.2和kubectl版本:

Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-08T16:31:10Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
macos docker kubernetes minikube
1个回答
2
投票

我认为你受到这里描述的问题的影响:https://github.com/kubernetes/minikube/issues/2733我在Ubuntu 18.04上的minikube上重现了这个案例,我可以确认同样的错误,所以看起来更像是minikube中的问题/ bug。

© www.soinside.com 2019 - 2024. All rights reserved.