我有一个谷歌Kubernetes引擎运行。我创建了一个ASP.NET核心MVC应用程序,它作为引擎上的服务部署,我希望能够从不同的应用程序向此服务发出HTTP请求(GET http:serviceendpointip/controller/action
)。我使用ngrok测试了我的MVC应用程序(为我的应用程序提供了一个公共URL),并且请求成功运行。
所以我的应用程序似乎工作正常。但是,当我将它作为暴露的公共服务部署到Kubernetes引擎时,请求不起作用,我假设引擎以某种方式阻止了这个网络流量...我能够从网上查看http://serviceendpointip/home
上的应用程序主页浏览器。什么可能导致我的HTTP请求失败?
运行kubectl describe deployment telebot-pianomoves-v1-km
:
Namespace: default
CreationTimestamp: Tue, 28 Aug 2018 21:34:03 +1000
Labels: run=telebot-pianomoves-v1-km
Annotations: deployment.kubernetes.io/revision=12
kubernetes.io/change-cause=kubectl set image
deployment/telebot-pianomoves-v1-km telebot-pianomoves-v1-
km=gcr.io/telebot-pianomoves-v1/tel
ebot-pianomoves-v1-km:20180907t124111 --record=true --kubeconf...
Selector: run=telebot-pianomoves-v1-km
Replicas: 3 desired | 2 updated | 4 total | 1 available | 3
unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 1 max unavailable, 1 max surge
Pod Template:
Labels: run=telebot-pianomoves-v1-km
Containers:
telebot-pianomoves-v1-km:
Image: gcr.io/telebot-pianomoves-v1/telebot-pianomoves-v1-
km:20180907t124111
Port: 8080/TCP
Environment: <none>
Mounts: <none>
Volumes: <none>
Conditions:
Type Status Reason
---- ------ ------
Available False MinimumReplicasUnavailable
OldReplicaSets: telebot-pianomoves-v1-km-7775cfb674 (1/1 replicas
created), telebot-pianomoves-v1-km-cf4f5d9d8 (1/1 replicas created)
NewReplicaSet: telebot-pianomoves-v1-km-7b78d6597d (2/2 replicas
created)
Events: <none>
运行kubectl get deployments
:
telebot-pianomoves-v1-km 3 4 2 1 9d
谢谢
我设法解决了我的问题。我是通过从Visual Studio发布到Kubernetes Engine并确保将副本数设置为1来实现的。