Skip to content

Refactor deployment configurations as separate subcommands

Andrejs Cunskis requested to merge andrey-configurations-as-subcommands into master

What does this MR do and why?

Refactors implementation of deployment configurations to each deployment type being a subcommand rather than string argument. This allows more flexibility in being able to define custom inputs for specific deployment type as well as separate documentation describing the deployment type. Also addresses feedback from previous mr.

  • Makes deployment configurations as separate subcommands
  • Make admin password and token configurable
  • Remove hardcoded ports for http and ssh
  • Create kind cluster by default for kind deployment (due to coupling with port settings, creating cluster separately while still is an option, shouldn't be used in most cases)
  • Minor simplification of code by removing unnecessary extra class

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

❯ cng create deployment help kind
Usage:
  cng deployment kind [NAME]

Options:
      [--create-cluster], [--no-create-cluster], [--skip-create-cluster]  # Create kind cluster for local deployments before creating deployment
                                                                          # Default: true
      [--docker-hostname=DOCKER_HOSTNAME]                                 # Custom docker hostname if remote docker instance is used, like docker-in-docker, only applicable when --create-cluster is true
      [--gitlab-domain=GITLAB_DOMAIN]                                     # Domain for deployed app, default to (your host IP).nip.io
      [--admin-password=ADMIN_PASSWORD]                                   # Admin password for gitlab, defaults to password commonly used across development environments
                                                                          # Default: 5iveL!fe
      [--admin-token=ADMIN_TOKEN]                                         # Admin token for gitlab, defaults to value used in gitlab development seed data
                                                                          # Default: ypCa3Dzb23o5nvsixwPA
      [--host-http-port=N]                                                # Host HTTP port for gitlab
                                                                          # Default: 80
      [--host-ssh-port=N]                                                 # Host ssh port for gitlab
                                                                          # Default: 22
  -n, [--namespace=NAMESPACE]                                             # Deployment namespace
                                                                          # Default: gitlab
      [--set=SET]                                                         # Optional helm chart values (can specify multiple or separate values with commas: key1=val1,key2=val2)
      [--ci], [--no-ci], [--skip-ci]                                      # Use CI specific configuration
                                                                          # Default: false
      [--timeout=TIMEOUT]                                                 # Timeout for deployment
                                                                          # Default: 10m

Create CNG deployment against local kind k8s cluster where NAME is deployment name

Part of: gitlab-org/quality/quality-engineering/team-tasks#2570 (closed)
Part of: gitlab-org/quality/quality-engineering/team-tasks#2692 (closed)
Closes: #463767 (closed)

Edited by Andrejs Cunskis

Merge request reports