【发布时间】:2019-06-14 19:58:36
【问题描述】:
我正在 google cloud 中做一个关于 kubernetes 的实验室,所以我的任务是在一个 pod 中部署两个 nginx 服务器,但是我有一个问题。
其中一个 pod 无法启动,因为 PORT 或 IP 正在使用购买另一个 nginx 容器,我需要在 yaml 文件中更改它,请给我一个解决方案,提前谢谢
apiVersion: v1
kind: Pod
metadata:
name: two-containers
spec:
restartPolicy: Never
volumes:
- name: shared-data
emptyDir: {}
containers:
- name: first-container
image: nginx
- name: second-container
image: nginx
E nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
E 2019/01/21 11:04:47 [emerg] 1#1: bind() to 0.0.0.0:80 failed (98: Address already in use)
E nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
E 2019/01/21 11:04:47 [emerg] 1#1: bind() to 0.0.0.0:80 failed (98: Address already in use)
E nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
E 2019/01/21 11:04:47 [emerg] 1#1: bind() to 0.0.0.0:80 failed (98: Address already in use)
E nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
E 2019/01/21 11:04:47 [emerg] 1#1: bind() to 0.0.0.0:80 failed (98: Address already in use)
E nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
E 2019/01/21 11:04:47 [emerg] 1#1: still could not bind()
E nginx: [emerg] still could not bind()
【问题讨论】:
标签: nginx kubernetes google-cloud-platform