Help us learn about your current experience with the documentation. Take the survey.

配置 Kubernetes 部署(已弃用)

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

此功能在 GitLab 14.5 中已被 弃用

如果您正在部署到与项目关联的 Kubernetes 集群, 您可以从 .gitlab-ci.yml 文件配置这些部署。

对于 GitLab 管理的 Kubernetes 集群,不支持 Kubernetes 配置。

支持以下配置选项:

在以下示例中,该作业将您的应用程序部署到 production Kubernetes 命名空间。

deploy:
  stage: deploy
  script:
    - echo "Deploy to production server"
  environment:
    name: production
    url: https://example.com
    kubernetes:
      namespace: production
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

当您使用 GitLab Kubernetes 集成部署到 Kubernetes 集群时,您可以查看集群和命名空间信息。在部署作业页面,这些信息显示在作业跟踪上方:

部署集群信息,包含集群和命名空间。

配置增量部署

了解如何通过 增量部署 将生产变更仅发布到部分 Kubernetes pod。

相关主题