摘要
graphite:
image: sitespeedio/graphite:1.1.5-3
ports:
- "2003:2003"
- "8080:80"
restart: always
kube.yml 中需要更改的当前代码段
spec:
containers:
- name: graphite
image: sitespeedio/graphite:1.1.5-3
restartPolicy: Always
ports:
- containerPort: 2003
在这里,如何在kubernetes yaml文件中写入第二个提到的- "8080:80"
端口?
答案 0 :(得分:2)
spec:
containers:
- name: graphite
image: sitespeedio/graphite:1.1.5-3
restartPolicy: Always
ports:
- containerPort: 2003
name: graphite_two
- containerPort: 8080
name: graphite_one
将解决您的问题。
kubectl explain pods.spec.containers.ports
提供有关键和值的详细信息