我试图使用github操作将我的代码部署到GKE,当我运行该操作时,它说创建了服务和部署,但随后发出了一个错误,它在云中创建的部署也有一个错误。

这就是它创建的部署:

我的deployment.yaml文件:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-1
labels:
type: nginx # <-- correct
spec:
selector:
matchLabels:
type: nginx # incorrect, remove the '-'
template:
metadata:
labels:
type: nginx # incorrect, remove the '-'
spec:
containers:
- image: nginx:1.14
name: renderer
ports:
- containerPort: 80我的service.yaml:
apiVersion: v1
kind: Service
metadata:
name: nginx-3-service
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80我只想简单地将我的C++代码部署到kubernetes引擎,这样我就可以对它进行实验。我正试着把一张ubuntu 20.04图片推到欧洲西部。
This question说我必须更改区域以修复云部署的错误,但我不确定它是否会解决我的问题,我也不知道如何正确地更改它。
发布于 2022-08-01 14:06:39
因此,对于面临此问题的任何人,都必须将google.yaml文件中的google.yaml变量名更改为部署名称,以便与deployment.yaml中的metadata: name: "---"相同,在我的示例中,我将google.yaml改为nginx-1以解决此问题。
https://stackoverflow.com/questions/73182514
复制相似问题