Skip to content
代码片段 群组 项目
未验证 提交 fb4da61f 编辑于 作者: Evan Read's avatar Evan Read 提交者: GitLab
浏览文件

Merge branch 'andrey-cng-docs' into 'master'

Update main README for cng orchestrator

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155681



Merged-by: default avatarEvan Read <eread@gitlab.com>
Approved-by: default avatarEvan Read <eread@gitlab.com>
Approved-by: default avatarAnastasia McDonald <amcdonald@gitlab.com>
Reviewed-by: default avatarEvan Read <eread@gitlab.com>
Reviewed-by: default avatarAndrejs Cunskis <acunskis@gitlab.com>
Co-authored-by: default avatarAndrejs Cunskis <acunskis@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -194,7 +194,12 @@ This stage is responsible for [allure test report](index.md#allure-report) gener
The `e2e:test-on-cng` child pipeline runs tests against [Cloud Native GitLab](https://gitlab.com/gitlab-org/build/CNG) installation.
Unlike `review-apps`, this pipeline uses local [kind](https://github.com/kubernetes-sigs/kind) Kubernetes cluster.
Currently this pipeline is executed on nightly scheduled pipelines and is mainly responsible for testing compatibility with minimal supported version of `redis`.
Deployment is managed by the [`cng`](../../../../gems/gitlab-cng/README.md) orchestrator tool, which you can also use to locally recreate CI/CD deployments.
This pipeline is executed every two hours on scheduled pipelines and runs the following validations:
- Main test suite against the `CNG` deployment using default chart configuration.
- Minimal `health_check` test suite against the `CNG` deployment that uses minimal supported `redis` version.
### Setup
......@@ -224,3 +229,11 @@ Jobs in `test` stage perform following actions:
#### report
This stage is responsible for [allure test report](index.md#allure-report) generation as well as test metrics upload.
### Debugging
To help with debugging:
- Each test job prints a list of arguments that you can pass to the [`cng`](../../../../gems/gitlab-cng/README.md) orchestrator to exactly recreate
the same deployment for local debugging.
- Cluster events log and all pod logs are saved in E2E test job artifacts.
# Cng
# `cng`
CLI tool to support setup and deployments of [Cloud Native GitLab](https://gitlab.com/gitlab-org/build/CNG) builds.
`cng` is a CLI tool that supports setting up and deploying [Cloud Native GitLab](https://gitlab.com/gitlab-org/build/CNG) builds
using the official [GitLab Chart](https://gitlab.com/gitlab-org/charts/gitlab).
## Usage
`cng` is internal gem so it is not published to [rubygems](https://rubygems.org/). Run `cng` by prefixing commands with
`bundle exec` within its directory.
```shell
$ bundle exec cng
Commands:
cng create [SUBCOMMAND] # Manage deployment related object creation
cng destroy [SUBCOMMAND] # Manage deployment related object cleanup
cng doctor # Validate presence of all required system dependencies
cng help [COMMAND] # Describe available commands or one specific command
cng log [SUBCOMMAND] # Manage deployment related logs
cng version # Print cng orchestrator version
```
## Add new deployments
The main feature `cng` is to programmatically manage different deployment type configurations and setup. To implement new deployment configuration:
1. Add a new subcommand method to the [`Deployment`](lib/gitlab/cng/commands/subcommands/deployment.rb) class. This allows you to to define your own input
arguments and documentation.
1. Define a configuration class based on the [`Base`](lib/gitlab/cng/lib/deployment/configurations/_base.rb) configuration class. You can implement:
- `pre-deployment` setup: optional setup steps that are executed before installing the `GitLab` instance.
- `post-deployment` setup: optional setup steps that are executed after instance of `GitLab` has been installed.
- `helm` values: set of values to apply during installation.
1. Define a cleanup class based on the [`Base`](lib/gitlab/cng/lib/deployment/configurations/cleanup/_base.rb) cleanup class. Implement a single method
that deletes all objects created by `pre-deployment` and `post-deployment` setup.
## Tips
### kubectl context
`cng` CLI uses [`kubectl`](https://github.com/kubernetes/kubectl) and [Helm](https://github.com/helm/helm) to perform all `kubernetes`-related
operations. When running a deployment, [current context](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_config/kubectl_config_current-context/)
is always used. If non-default arguments are used when running the deployment, make sure current context points to the cluster where the deployment should be executed.
### Shell integration
To make `cng` globally available in your shell without the need to run the commands from a specific folder and prefixed with `bundle exec`, add the following
function to your shell's configuration file (for example,`.zshrc` or `.bash_profile`):
```shell
function cng() {
(cd $PATH_TO_GITLAB_REPO/gems/gitlab-cng && BUNDLE_AUTO_INSTALL=true bundle exec cng "$@")
}
```
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册