Support enabling the dashboard for Kubernetes without using managed cluster resources
The following discussion from !178824 (merged) should be addressed:
-
@tigerwnz started a discussion: (+5 comments) @nagyv-gitlab @ash2k @takax we have ended up with a bit of a clash with the
environment.kubernetes.agent
CI keyword. Currently it is used to configure an environment to use the dashboard - that is, it sets theGitLab agent
field in the environment edit page. This requires a user access entry in the config file.Now with managed resources we also want this keyword to trigger managed resource creation. This requires a ci access entry in the config file.
The question is, will the agent managing resources and the agent for the dashboard always be the same? I suspect the answer is yes, but if not we are going to run into problems where one overrides the other. Specifically, setting
environment.kubernetes.agent
to opt-in to managed resources will always associate the chosen agent with the environment for the purpose of enabling the dashboard, overwriting any existing value (assuming user access is enabled). Is there a valid use case where we want to use managed resources but don't want to enable the dashboard?
Proposal
See #515854 (comment 2674090018) for the discussion.
deploy:
script: ...
environment:
kubernetes:
agent: path/to/project:agent
namespace: ... # Deprecated, keep for backwards-compatibility
flux_resource_path: ... # Deprecated, keep for backwards-compatibility
managed_resources:
enabled: true # Default is true (for backwards-compatibility), can be false to opt-out
dashboard:
namespace: ...
flux_resource_path: ...
Previous proposal
We will add No. 2 option - enable dashboard while opting-out managed resources. For more details, see !199518 (comment 2657838989).
- Same agent for both (current)
👉 Supported already - Associated for dashboard, no managed resources
👉 Add support in this MR - Enabled managed resources, no dashboard
❌ No support for now - Different agents for both (is this valid?)
❌ No support for now
# Same agent for both (current)
environment:
name: example-env
kubernetes:
agent: path/to/agent/project:agent-name
# Associated for dashboard, no managed resources
environment:
name: example-env
kubernetes:
agent:
dashboard: path/to/agent/project:agent-name
Not supported in this MR and issue, but maybe in the future:
# Enabled managed resources, no dashboard
environment:
name: example-env
kubernetes:
agent:
managed_resources: path/to/agent/project:agent-name
# Different agents for both (is this valid?)
environment:
name: example-env
kubernetes:
agent:
dashboard: path/to/agent/project:agent-name
managed_resources: path/to/another/agent/project:second-agent-name