Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
627741e2
Commit
627741e2
authored
Dec 06, 2019
by
Tiger Watson
Committed by
Evan Read
Dec 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs for configuring Kubernetes namespace via CI
https://gitlab.com/gitlab-org/gitlab/merge_requests/21163
parent
19d14d8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
doc/ci/environments.md
doc/ci/environments.md
+35
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+32
-0
No files found.
doc/ci/environments.md
View file @
627741e2
...
...
@@ -303,6 +303,41 @@ You are not required to use the same prefix or only slashes (`/`) in the dynamic
names. However, using this format will enable the
[
grouping similar environments
](
#grouping-similar-environments
)
feature.
### Configuring Kubernetes deployments
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/27630) in GitLab 12.6.
If you are deploying to a
[
Kubernetes cluster
](
../user/project/clusters/index.md
)
associated with your project, you can configure these deployments from your
`gitlab-ci.yml`
file.
The following configuration options are supported:
-
[
`namespace`
](
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
)
In the following example, the job will deploy your application to the
`production`
Kubernetes namespace.
```
yaml
deploy
:
stage
:
deploy
script
:
-
echo "Deploy to production server"
environment
:
name
:
production
url
:
https://example.com
kubernetes
:
namespace
:
production
only
:
-
master
```
NOTE:
**Note:**
Kubernetes configuration is not supported for Kubernetes clusters
that are
[
managed by GitLab
](
../user/project/clusters/index.md#gitlab-managed-clusters
)
.
To follow progress on support for Gitlab-managed clusters, see the
[
relevant issue
](
https://gitlab.com/gitlab-org/gitlab/issues/38054
)
.
### Complete example
The configuration in this section provides a full development workflow where your app is:
...
...
doc/ci/yaml/README.md
View file @
627741e2
...
...
@@ -1421,6 +1421,38 @@ The `stop_review_app` job is **required** to have the following keywords defined
-
`stage`
should be the same as the
`review_app`
in order for the environment
to stop automatically when the branch is deleted
#### `environment:kubernetes`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/27630) in GitLab 12.6.
The
`kubernetes`
block is used to configure deployments to a
[
Kubernetes cluster
](
../../user/project/clusters/index.md
)
that is associated with your project.
For example:
```
yaml
deploy
:
stage
:
deploy
script
:
make deploy-app
environment
:
name
:
production
kubernetes
:
namespace
:
production
```
This will set up the
`deploy`
job to deploy to the
`production`
environment, using the
`production`
[
Kubernetes namespace
](
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
)
.
For more information, see
[
Available settings for `kubernetes`
](
../environments.md#configuring-kubernetes-deployments
)
.
NOTE:
**Note:**
Kubernetes configuration is not supported for Kubernetes clusters
that are
[
managed by GitLab
](
../../user/project/clusters/index.md#gitlab-managed-clusters
)
.
To follow progress on support for Gitlab-managed clusters, see the
[
relevant issue
](
https://gitlab.com/gitlab-org/gitlab/issues/38054
)
.
#### Dynamic environments
> - [Introduced][ce-6323] in GitLab 8.12 and GitLab Runner 1.6.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment