Skip to content

Support enabling K8s dashboard without managed resources

What does this MR do and why?

This MR gives flexibility to opt into K8s dashboard without enabling to managed resources. Currently, when an user adds environment.kubernetes.agent in .gitlab-ci.yml, it'll automatically enable both K8s dashboard and managed resources and there are no ways to enable K8s dashboard while disabling managed resources. The flexibility this MR provides is crucial especially in the instance-wide agent.

  • Currently supported case: environment.kubernetes.agent that enables both K8s dashboard and managed resources
deploy:
  image:
    name: bitnami/kubectl:latest
    entrypoint: ['']
  environment:
    name: env1
    deployment_tier: staging
    kubernetes:
      agent: sandbox/simple-rails:local-cluster-2
  • New field: environment.kubernetes.agent.dashboard that enables K8s dashboard while disabling managed resources
deploy:
  image:
    name: bitnami/kubectl:latest
    entrypoint: ['']
  environment:
    name: env1
    deployment_tier: staging
    kubernetes:
      agent: 
        dashboard: sandbox/simple-rails:local-cluster-2

For more information, see discussion #515854 (comment 2649916448) and !178824 (comment 2319246487).

References

Part of Support enabling the dashboard for Kubernetes w... (#515854 - closed).

How to set up and validate locally

  1. Run GDK.
  2. Enable GitLab-managed Kubernetes resources.
  3. Make sure the existing works as expected. Confirm the pipeline runs without error, and the managed resources was executed. k get ns and new namespace should be created.
deploy:
  image:
    name: bitnami/kubectl:latest
    entrypoint: ['']
  environment:
    name: env1
    deployment_tier: staging
    kubernetes:
      agent: sandbox/simple-rails:local-cluster-2
  script:
    - kubectl get ns
  1. Change the ci config to allow the agent only for K8s dashboard. Make sure it runs without error, and the managed resources was not triggered.
deploy:
  image:
    name: bitnami/kubectl:latest
    entrypoint: ['']
  environment:
    name: env1
    deployment_tier: staging
    kubernetes:
      agent:
        dashboard: sandbox/simple-rails:local-cluster-2
  script:
    - kubectl get ns

MR acceptance checklist

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

Edited by Taka Nishida

Merge request reports

Loading