Skip to content

Commit

Permalink
chore: change the comment for defaultNamespace in values.yaml (#9793)
Browse files Browse the repository at this point in the history
  • Loading branch information
salonig23 authored Aug 6, 2024
1 parent d3f3e76 commit 4e47a1e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/reference/deploy/master-config-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ on using Determined with Kubernetes, see the :ref:`documentation <determined-on-
``namespace``
-------------

This field has been deprecated, use ``default_namespace`` instead.
This field is no longer supported, use ``default_namespace`` instead.

``default_namespace``
---------------------
Expand Down
3 changes: 2 additions & 1 deletion docs/setup-cluster/k8s/resource-caps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ bindings and resource quotas using either the WebUI or the CLI.
specify a namespace in the namespace field, the workspace is bound to that namespace. If the
field is left blank, the workspace is bound to the namespace specified in the
``resource_manager.default_namespace`` section of your master configuration (when set), and is
otherwise bound to the default Kubernetes "default" namespace.
otherwise bound to the release namespace. For non-helm Determined deployments, it falls back to
the default Kubernetes namespace, ``default``.

#. Toggle the "Auto Create Namespace" option on or off. When enabled, the system automatically
creates a namespace in the cluster, allowing you to edit the resource quota directly in
Expand Down
4 changes: 2 additions & 2 deletions helm/charts/determined/templates/master-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ stringData:
resource_manager:
type: "kubernetes"
{{- if .Values.resourceManager.defaultNamespace }}
default_namespace: {{ .Values.resourceManager.defaultNamespace }}
{{- if $defaultNamespace := coalesce .Values.resourceManager.defaultNamespace .Release.Namespace }}
default_namespace: {{ quote $defaultNamespace }}
{{- end }}
{{- if .Values.resourceManager.clusterName }}
cluster_name: {{ .Values.resourceManager.clusterName }}
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/determined/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,6 @@ resourcePools:
# schedule: "24h"

resourceManager:
# Specifies the namespace where all workloads for that RM will be sent by default.
# Specifies the namespace in a given Kubernetes compute cluster where all workload pods will be sent by default.
defaultNamespace:
clusterName:
11 changes: 0 additions & 11 deletions master/internal/config/resource_manager_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ func (a AgentResourceManagerConfig) Validate() []error {

// KubernetesResourceManagerConfig hosts configuration fields for the kubernetes resource manager.
type KubernetesResourceManagerConfig struct {
// deprecated, no longer in use.
Namespace string `json:"namespace"`
// Changed from "Namespace" to "DefaultNamespace". DefaultNamespace is an optional field that
// allows the user to specify the default namespace to bind a workspace to, for each RM.
DefaultNamespace string `json:"default_namespace"`
Expand Down Expand Up @@ -316,19 +314,10 @@ func (k KubernetesResourceManagerConfig) Validate() []error {
k.SlotResourceRequests.CPU, float32(0), "slot_resource_requests.cpu must be > 0")
}

var checkRMNamespace error
if len(k.DefaultNamespace) > 0 && len(k.Namespace) > 0 {
checkRMNamespace = errors.Errorf("Both ``namespace`` and ``default_namespace`` provided. " +
"Please provide only ``default_namespace`` as ``namespace`` has been deprecated.")
} else {
checkRMNamespace = nil
}

return []error{
checkSlotType,
checkCPUResource,
check.NotEmpty(k.ClusterName, "cluster_name is required"),
checkRMNamespace,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ func New(
db: db,
}

if len(k.config.Namespace) > 0 {
k.config.DefaultNamespace = k.config.Namespace
}

k.jobsService, err = newJobsService(
k.config.DefaultNamespace,
k.config.ClusterName,
Expand Down

0 comments on commit 4e47a1e

Please sign in to comment.