@@ -147,6 +147,7 @@ To add an existing Kubernetes cluster to your project:
- If you or someone created a secret specifically for the project, usually
with limited permissions, the secret's namespace and project namespace may
be the same.
1. Finally, click the **Create Kubernetes cluster** button.
After a couple of minutes, your cluster will be ready to go. You can now proceed
...
...
@@ -168,7 +169,7 @@ are trusted, so **only trusted users should be allowed to control your clusters*
The default cluster configuration grants access to a wide set of
functionalities needed to successfully build and deploy a containerized
application. Bare in mind that the same credentials are used for all the
application. Bear in mind that the same credentials are used for all the
applications running on the cluster.
## Access controls
...
...
@@ -354,6 +355,18 @@ to reach your apps. This heavily depends on your domain provider, but in case
you aren't sure, just create an A record with a wildcard host like
`*.example.com.`.
## Multiple Kubernetes clusters **[PREMIUM]**
> Introduced in [GitLab Premium][ee] 10.3.
With GitLab Premium, you can associate more than one Kubernetes clusters to your
project. That way you can have different clusters for different environments,
like dev, staging, production, etc.
Simply add another cluster, like you did the first time, and make sure to
[set an environment scope](#setting-the-environment-scope) that will
differentiate the new cluster with the rest.
## Setting the environment scope **[PREMIUM]**
When adding more than one Kubernetes clusters to your project, you need
...
...
@@ -373,10 +386,10 @@ Also, jobs that don't have an environment keyword set will not be able to access
For example, let's say the following Kubernetes clusters exist in a project:
| Cluster | Environment scope |
| ---------- | ------------------- |
| Development| `*` |
| Staging | `staging/*` |
| Production | `production/*` |
| ----------- | ----------------- |
| Development | `*` |
| Staging | `staging` |
| Production | `production` |
And the following environments are set in [`.gitlab-ci.yml`](../../../ci/yaml/README.md):
...
...
@@ -393,14 +406,14 @@ deploy to staging:
stage:deploy
script:make deploy
environment:
name:staging/$CI_COMMIT_REF_NAME
name:staging
url:https://staging.example.com/
deploy to production:
stage:deploy
script:make deploy
environment:
name:production/$CI_COMMIT_REF_NAME
name:production
url:https://example.com/
```
...
...
@@ -410,18 +423,6 @@ The result will then be:
- The staging cluster will be used for the "deploy to staging" job.
- The production cluster will be used for the "deploy to production" job.
## Multiple Kubernetes clusters
> Introduced in [GitLab Premium][ee] 10.3.
With GitLab Premium, you can associate more than one Kubernetes clusters to your
project. That way you can have different clusters for different environments,
like dev, staging, production, etc.
Simply add another cluster, like you did the first time, and make sure to
[set an environment scope](#setting-the-environment-scope) that will
differentiate the new cluster with the rest.
## Deployment variables
The Kubernetes cluster integration exposes the following
...
...
@@ -463,6 +464,14 @@ builds is that they must have a matching
your build has no `environment:name` set, it will not be passed the Kubernetes
credentials.
## Monitoring your Kubernetes cluster **[ULTIMATE]**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4701) in [GitLab Ultimate][ee] 10.6.
When [Prometheus is deployed](#installing-applications), GitLab will automatically monitor the cluster's health. At the top of the cluster settings page, CPU and Memory utilization is displayed, along with the total amount available. Keeping an eye on cluster resources can be important, if the cluster runs out of memory pods may be shutdown or fail to start.