Skip to content

Commit

Permalink
depracating resource_manager.namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
salonig23 committed Aug 5, 2024
1 parent bf57e3b commit 6a526a7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 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. We fall back to the default Kubernetes namespace,
"default", during non-helm determined deployments.

#. 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
9 changes: 0 additions & 9 deletions master/internal/config/resource_manager_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,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 6a526a7

Please sign in to comment.