Configure Kubernetes deployments (deprecated)
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
This feature was deprecated in GitLab 14.5.
If you are deploying to a Kubernetes cluster
associated with your project, you can configure these deployments from your
.gitlab-ci.yml file.
Kubernetes configuration isn’t supported for Kubernetes clusters managed by GitLab.
The following configuration options are supported:
In the following example, the job deploys your application to the
production Kubernetes namespace.
deploy:
  stage: deploy
  script:
    - echo "Deploy to production server"
  environment:
    name: production
    url: https://example.com
    kubernetes:
      agent: path/to/agent/project:agent-name
      dashboard:
        namespace: production
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCHWhen you use the GitLab Kubernetes integration to deploy to a Kubernetes cluster, you can view cluster and namespace information. On the deployment job page, it’s displayed above the job trace:
Configure incremental rollouts
Learn how to release production changes to only a portion of your Kubernetes pods with incremental rollouts.
