- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将三个后端服务部署到kubernetes Windows Pod,以确保它们彼此通信。但是,我发现尽管容器,服务,dns和端点都可用并且正在运行,但是当我尝试从一个容器访问另一个容器(内部或外部)中的任何服务时,它仍然无法解析dns并收到“可能无法解析主机”或“无法连接网络失败”
尝试通过(资源服务)访问人员配备或聚合服务时,收到以下错误:
C:\WINDOWS\system32>kubectl exec -it resources-deployment-6b98d47b5b-ts674 cmd
Microsoft Windows [Version 10.0.17763.864] (c) 2018 Microsoft Corporation. All rights reserved.
C:\app\resources>curl http://172.20.101.110:8081/swagger/index.html curl: (7) Failed to connect to 172.20.101.110 port 8081: Network unreachable
C:\app\resources>curl http://aggregator-service:8081/swagger/index.html curl: (6) Could not resolve host: aggregator-service
C:\app\resources>curl http://staffing-service:8080/swagger/index.html curl: (6) Could not resolve host: staffing-service
C:\app\resources>curl http://172.20.5.156:8080/swagger/index.html curl: (7) Failed to connect to 172.20.5.156 port 8080: Network unreachable
C:\app\resources>ping 10.91.24.250
Pinging 10.91.24.250 with 32 bytes of data: PING: transmit failed. General failure.
Deployment and Services YAML file are:- Staffing.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
name: staffing-deployment
#namespace: staffing-kube-system
labels:
app: staffing-app
spec:
replicas: 2
selector:
matchLabels:
app: staffing-app
template:
metadata:
labels:
app: staffing-app
spec:
nodeSelector:
beta.kubernetes.io/os: windows
#failure-domain.beta.kubernetes.io/zone: us-east-1a
containers:
- name: staffing-app
ports:
- name: http
containerPort: 8080
image: test/staffing:v1
##########################
#Staffing.service.yaml file
---
apiVersion: v1
kind: Service
metadata:
labels:
app: staffing-app
name: staffing-service
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
spec:
ports:
-
name: http
#nodePort: 30475
port: 8080
protocol: TCP
targetPort: 8080
-
name: https
#nodePort: 30476
port: 443
protocol: TCP
targetPort: 44346
selector:
app: staffing-app
type: LoadBalancer
resources.service.deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: resources-deployment
#namespace: staffing-kube-system
labels:
app: resources-app
spec:
replicas: 2
selector:
matchLabels:
app: resources-app
template:
metadata:
labels:
app: resources-app
spec:
nodeSelector:
beta.kubernetes.io/os: windows
#failure-domain.beta.kubernetes.io/zone: us-east-1a
containers:
- name: resources-app
ports:
- name: http
containerPort: 8001
image: test/resources:v1
################
#resources.service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: resources-app
name: resources-service
spec:
ports:
-
name: http
#nodePort: 30475
port: 8001
protocol: TCP
targetPort: 8001
-
name: https
#nodePort: 30476
port: 443
protocol: TCP
targetPort: 44345
selector:
app: resources-app
type: NodePort
aggregator.service.deplpoyment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: aggegator-deployment
#namespace: staffing-kube-system
labels:
app: aggegator-app
spec:
replicas: 2
selector:
matchLabels:
app: aggregator-app
template:
metadata:
labels:
app: aggregator-app
spec:
nodeSelector:
beta.kubernetes.io/os: windows
#failure-domain.beta.kubernetes.io/zone: us-east-1a
containers:
- name: aggregator-app
ports:
- name: http
containerPort: 8001
image: test/aggregator:v1
################
#aggregator.service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: resources-app
name: resources-service
spec:
ports:
-
name: http
#nodePort: 30475
port: 8001
protocol: TCP
targetPort: 8001
-
name: https
#nodePort: 30476
port: 443
protocol: TCP
targetPort: 44345
selector:
app: resources-app
type: NodePort
Output of Pods and services
C:\WINDOWS\system32>kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
aggegator-deployment-64497699d-792dd 1/1 Running 0 2d12h 10.91.25.210 ip-10-91-25-125.ec2.internal <none> <none>
aggegator-deployment-64497699d-tfsww 1/1 Running 0 2d12h 10.91.24.250 ip-10-91-24-148.ec2.internal <none> <none>
resources-deployment-6b98d47b5b-7x8fv 1/1 Running 0 2d13h 10.91.25.197 ip-10-91-25-125.ec2.internal <none> <none>
resources-deployment-6b98d47b5b-ts674 1/1 Running 0 2d13h 10.91.24.122 ip-10-91-24-148.ec2.internal <none> <none>
staffing-deployment-797464966d-4j4nc 1/1 Running 0 2d16h 10.91.24.224 ip-10-91-24-148.ec2.internal <none> <none>
staffing-deployment-797464966d-mrw7x 1/1 Running 0 2d17h 10.91.24.113 ip-10-91-24-148.ec2.internal <none> <none>
C:\WINDOWS\system32>kubectl get services -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
aggregator-service NodePort 172.20.101.110 <none> 8081:32246/TCP,443:30240/TCP 2d12h app=aggregator-app
kubernetes ClusterIP 172.20.0.1 <none> 443/TCP 21d <none>
resources-service NodePort 172.20.228.37 <none> 8001:31365/TCP,443:31686/TCP 2d13h app=resources-app
staffing-service LoadBalancer 172.20.5.156 internal-af561cd570d0d11eab0c00a891642f9b-874414568.us-east-1.elb.amazonaws.com 8080:30010/TCP,443:31327/TCP 2d17h app=staffing-app
C:\WINDOWS\system32>kubectl get pods --selector="app=resources-app"
NAME READY STATUS RESTARTS AGE
resources-deployment-6b98d47b5b-7x8fv 1/1 Running 0 2d21h
resources-deployment-6b98d47b5b-ts674 1/1 Running 0 2d21h
C:\WINDOWS\system32>kubectl get pods --selector="app=aggregator-app"
NAME READY STATUS RESTARTS AGE
aggegator-deployment-64497699d-792dd 1/1 Running 0 2d20h
aggegator-deployment-64497699d-tfsww 1/1 Running 0 2d20h
C:\WINDOWS\system32>kubectl get pods --selector="app=staffing-app"
NAME READY STATUS RESTARTS AGE
staffing-deployment-797464966d-4j4nc 1/1 Running 0 3d
staffing-deployment-797464966d-mrw7x 1/1 Running 0 3d1h
C:\WINDOWS\system32>kubectl get endpoints
NAME ENDPOINTS AGE
aggregator-service 10.91.24.250:8081,10.91.25.210:8081,10.91.24.250:44347 + 1 more... 2d20h
kubernetes 10.91.24.167:443,10.91.25.120:443 22d
resources-service 10.91.24.122:8001,10.91.25.197:8001,10.91.24.122:44345 + 1 more... 2d21h
staffing-service 10.91.24.113:44346,10.91.24.224:44346,10.91.24.113:8080 + 1 more... 3d2h
> Kubectl logs
C:\WINDOWS\system32>kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
NAME READY STATUS RESTARTS AGE
coredns-8455f84f99-d6v75 1/1 Running 0 21d
coredns-8455f84f99-jf7tz 1/1 Running 0 21d
C:\WINDOWS\system32>kubectl logs coredns-8455f84f99-jf7tz -n kube-system
.:53
2019-11-03T14:27:30.347Z [INFO] CoreDNS-1.3.1
2019-11-03T14:27:30.347Z [INFO] linux/amd64, go1.10.8, 6b56a9c9
CoreDNS-1.3.1
linux/amd64, go1.10.8, 6b56a9c9
2019-11-03T14:27:30.347Z [INFO] plugin/reload: Running configuration MD5 = 86a350d0c3832da65c10531b445c45d5
[INFO] Reloading
2019-11-25T07:00:09.649Z [INFO] plugin/reload: Running configuration MD5 = ebe4e401326d5dac294cde91064e2e76
[INFO] Reloading complete
2019-11-25T11:38:44.107Z [INFO] 10.91.24.148:57354 - 8232 "A IN . udp 17 false 512" NOERROR qr,rd,ra 92 0.000084547s
2019-11-25T11:38:44.113Z [INFO] 10.91.24.148:57364 - 33842 "A IN . udp 17 false 512" NOERROR qr,rd,ra 92 0.000059248s
2019-11-25T11:39:15.287Z [INFO] 10.91.24.148:57366 - 23694 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.003154278s
2019-11-25T11:39:15.331Z [INFO] 10.91.24.148:57366 - 23694 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.069842673s
2019-11-25T11:39:15.615Z [INFO] 10.91.25.125:61221 - 24722 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.000102425s
2019-11-25T11:39:17.575Z [INFO] 10.91.25.125:61223 - 8379 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.000096859s
2019-11-25T11:39:18.925Z [INFO] 10.91.25.125:61239 - 49217 "A IN settings-win.data.microsoft.com. udp 49 false 512" NOERROR qr,rd,ra 176 0.030653295s
2019-11-25T11:39:19.006Z [INFO] 10.91.25.125:61239 - 49217 "A IN settings-win.data.microsoft.com. udp 49 false 512" NOERROR qr,rd,ra 176 0.142995164s
2019-11-25T11:39:19.205Z [INFO] 10.91.25.125:61241 - 25186 "A IN settings-win.data.microsoft.com. udp 49 false 512" NOERROR qr,rd,ra 176 0.000088335s
2019-11-25T11:39:43.422Z [INFO] 10.91.25.125:61257 - 26043 "A IN . udp 17 false 512" SERVFAIL qr,rd,ra 17 0.013510742s
2019-11-25T11:39:44.129Z [INFO] 10.91.24.148:57368 - 382 "A IN . udp 17 false 512" SERVFAIL qr,rd,ra 17 0.013958603s
2019-11-25T11:39:44.270Z [INFO] 10.91.25.125:61261 - 53992 "A IN . udp 17 false 512" SERVFAIL qr,rd,ra 17 0.014368787s
2019-11-25T11:39:44.981Z [INFO] 10.91.24.148:57370 - 41136 "A IN . udp 17 false 512" SERVFAIL qr,rd,ra 17 0.014143535s
2019-11-25T11:40:15.649Z [INFO] 10.91.25.125:61231 - 53428 "A IN ctldl.windowsupdate.com. udp 41 false 512" NOERROR qr,rd,ra 355 0.013625947s
2019-11-25T11:40:45.838Z [INFO] 10.91.24.148:57372 - 36065 "A IN . udp 17 false 512" SERVFAIL qr,rd,ra 17 0.013761424s
2019-11-25T11:40:46.688Z [INFO] 10.91.24.148:57382 - 26755 "A IN . udp 17 false 512" SERVFAIL qr,rd,ra 17 0.01357897s
2019-11-25T11:40:51.896Z [INFO] 10.91.24.148:57388 - 607 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.033610722s
2019-11-25T11:40:52.006Z [INFO] 10.91.24.148:57388 - 607 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.11348618s
2019-11-25T11:41:46.839Z [INFO] 10.91.25.125:61227 - 9202 "A IN . udp 17 false 512" SERVFAIL qr,rd,ra 17 0.013585559s
2019-11-25T11:41:47.553Z [INFO] 10.91.24.148:57339 - 12070 "A IN . udp 17 false 512" NOERROR qr,rd,ra 92 0.001922224s
2019-11-25T11:41:48.403Z [INFO] 10.91.24.148:57341 - 52311 "A IN . udp 17 false 512" NOERROR qr,rd,ra 92 0.000091287s
2019-11-25T11:42:04.827Z [INFO] 10.91.24.148:57343 - 23836 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.028061963s
2019-11-25T11:42:04.827Z [INFO] 10.91.24.148:57343 - 23836 "A IN v10.events.data.microsoft.com. udp 47 false 512" NOERROR qr,rd,ra 284 0.004729734s
2019-11-25T11:42:13.855Z [hINFO] 10.91.24.148:57344 - 62298 "A IN ctldl.windowsupdate.com. udp 41 false 512" NOERROR qr,rd,ra 540 0.012435227s
最佳答案
问题出在服务的定义内,其中Kubernetes文件中定义的端口与代码中定义的端口冲突。
关于kubernetes - Kubernetes “Windows pods ”无法互相通信| “could not resolve host” | “failed to connect Network unreachable”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59034682/
“Fail Early”是什么意思,在什么情况下这种方法最有用,你什么时候会避免这种方法? 最佳答案 本质上,快速失败 (又名 尽早失败 )是对您的软件进行编码,使得 当出现问题时,软件会尽快并尽可能
/* * 115200. Connect GPIO 0 of your ESP8266 to VCC and reset the board */ #include #include #inc
安装并注册 gitlab-runner 后,当我运行时 gitlab-runner start我收到此错误消息。这是什么原因? Runtime platform
我一直在尝试Windows Server 2016 TP5上的Windows容器。突然我在运行带有端口映射选项-p 80:80的容器时开始出错 c:\>docker run -it -p 80:80
我一直在关注 Hyperledger Fabric Multi-Org setup 的教程,我能够成功地做到这一点。现在我想根据我想要的组织名称对其进行自定义,并且在尝试连接网络时遇到以下错误。希望有
所以我不知道为什么这个测试失败了。当我运行 repl 中的语句时,一切似乎都正常工作,但 fiveam 测试失败。 以下要点中有一个测试用例:https://gist.github.com/Puerc
我安装了 Android Studio 1.2.1.1、Gradle 版本 2.2.1 和 Android 插件版本 1.2.3。我试图创建一个简单的 hello world 项目,它给了我一个构建失
我正在尝试设置一个简单的 WebTestCase,它使用 Symfony 4(和 "phpunit/phpunit": "^6.5")。但是,测试失败: Failed to start the ses
我已经使用 git clone 在本地克隆了一个包含 Vue 项目的 git 存储库. 然后我跑了npm install安装依赖项并获得 node_modules文件夹。 正在运行 npm run s
我有:http://windows.github.com/ 我当前的项目有大约 20k 个文件,大约 150MB(并且不说它有多慢而且我现在什么也做不了)它甚至不允许我提交!我收到此错误:提交失败:无
我正在使用 RxAndroidBle 库开发一个应用程序,该库大约每 30 秒定期执行 BLE 扫描,每分钟左右执行一些 BLE 操作。几个小时后,通常在 5 到 24 小时之间,扫描停止工作。每次应
每次我尝试使用 Pycharm 推送 GitHub 中的存储库时,它都会失败。 Push failed: fatal: Authentication failed for 'https://githu
此外,管理内置“管理结构”(如标题中的结构)的 Resque 的最佳实践是什么?我应该用 jedis.del(String key) 或类似的东西清除它们吗? 最佳答案 resque:failed 是
想象这样一种场景,我们想要在对“foo”和“bar”的并发请求成功完成后做一些事情,或者如果其中一个或两个失败则报告错误: $.when($.getJSON('foo'), $.getJSON('ba
这就是我所做的: 我使用的是 Windows XP SP3 我已经安装了 Python 2.7.1。 我下载了instantclient-basic-nt-11.2.0.3.0.zip,解压后放入C:
我已经设置了一个 vfsstream block 设备,我正在尝试对其调用 file_get_contents()。然而,对 vfsStreamWrapper::stream_open 的调用失败,因
我正在尝试在我的 React 应用程序中使用文件上传功能,但遇到了问题。当我尝试上传第一张图片时,它工作得很好。文件资源管理器对话框关闭并显示我的图片。用我的文件资源管理器中的另一张图片覆盖图片也可以
目标:将我的本地 mongodb 数据迁移到 mongodb atlas 集群。 尝试: 1.将本地数据导出为json。 2.导入json到集群。 操作系统:Linuxmint 19.1 Cinnam
我一直在从事一个需要在服务器(托管在 GCE 上)和多个客户端之间进行一些网络连接的项目。我创建了一个 Compute Engine 实例来运行 Python 脚本,如以下视频所示:https://w
我正在尝试使用 sqlx crate 和 Postgres 数据库连接到 Rust 中的数据库。 main.rs: use dotenv; use sqlx::Pool; use sqlx::PgPo
我是一名优秀的程序员,十分优秀!