Allow to Select Kubernetes Namespace in Environment setting page
Problem
For Render Kubernetes resources in Environment inde... (#390769 - closed), users need to specify which namespace to be used for fetching Kubernetes resources.
Proposal
- User visits Project > Deployments > Environments. This is Environment index page.
- User clicks an environment name, which navigates to Environment details page.
- User clicks "Edit" button
- User select an namespace from dropdown list.
Prerequisites
To do this, we likely need to finish Authenticate/authorize the user access with bro... (#390767 - closed) for fetching available namespace list.
Permission
It follows update_environment
permission. Developer+ is allowed to edit. If the environment is protected, users who are allowed to access can update the environment.
UI
Technical details
- We add a column to
environments
table.
# Existing table
environments:
kubernetes_namespace: string
- In environment edit page, frontend shows a drop down to select a Kubernetes Namespace. Namespace list can be fetched with
kubectl get namespaces
Kubernetes API. - After the namespace is set, the form is submitted to
UpdateEnvironment
GraphQL mutation. It's persisted intoenvironments.kubernetes_namespace
. - The specified
kubernetes_namespace
is exposed inTypes::EnvironmentType
, something like:
{
project(fullPath: "group/project") {
id
environment(name: "<environment-name>") {
slug
agent {
id
name
project
}
kubernetes_namespace
}
}
}
Edited by Shinya Maeda