Configure Kubernetes deployments (deprecated)
If you are deploying to a Kubernetes cluster
associated with your project, you can configure these deployments from your
.gitlab-ci.yml
file.
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:
namespace: production
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
When 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.