You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用GitHub Actions部署至GKE时遇错误,请求技术支持

GKE部署GitHub Actions报错问题

我尝试使用GitHub Actions将代码部署至Google Kubernetes Engine(GKE),但部署步骤出现错误。我的需求是通过Ubuntu镜像部署C++代码,仅需完成将代码推送至GKE的操作。

相关配置文件

deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-3
  namespace: default
  labels:
    type: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
    - type: nginx 
  template:
    metadata:
      labels:
      - type: nginx 
    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

Dockerfile

FROM ubuntu/redis:5.0-20.04_beta

# Install.
RUN apt-get update &&  DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
RUN \
  sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y build-essential && \
  apt-get install -y software-properties-common && \
  apt-get install -y byobu curl git htop man unzip vim wget && \
  rm -rf /var/lib/apt/lists/*

# Set environment variables.
ENV HOME /root

# Define working directory.
WORKDIR /root

# Define default command.
CMD ["bash"]

错误详情

初始部署状态

云部署(工作负载)显示nginx-3未就绪,事件日志中存在容器启动失败相关报错。

重新部署后新错误

删除现有部署并重新运行Action后,部署创建成功但出现以下错误:

deployment.apps/nginx-3 created
Error from server (NotFound): deployments.apps "gke-deployment" not found

内容的提问来源于stack exchange,提问作者Turgut

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 16:45:46