gpt4 book ai didi

nginx - "How to fix ' 错误 : must either provide a name or specify --generate-name ' in Helm"

转载 作者:行者123 更新时间:2023-12-01 16:50:52 33 4
gpt4 key购买 nike

如何修复错误:必须在 Helm 中提供名称或指定 --generate-name

创建了示例 helm 图表名称为 mychart,并使用 nginx 服务编写了 deployment.yaml、service.yaml、ingress.yaml。之后运行命令 $ helm install mychart

service.yaml

apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- name: main
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx

部署.yaml

apiVersion: extensions/v1beta2
kind: Deployment
metadata:
name: nginx
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.13
ports:
containerPort: 80

ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx
annotations:
http.port: "443"
spec:
backend:
serviceName: nginx
servicePort: 80

预期输出:……状态:已部署

最佳答案

只需在 helm 命令末尾添加 --generate-name

关于nginx - "How to fix ' 错误 : must either provide a name or specify --generate-name ' in Helm",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57322873/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com