This Pull Request will enable users use KubeDownscaler Without Cluster Wide Access (Namespaced Access).
Changes
Python Code:
--namespace argument will now accept a list of string
Introduced constrianed_downscaler variable that will be automatically set to true if --namespace arg is specified
--namespace and --exclude-namespaces are now mutually exclusive, --namespacewill take precedence and override --exclude-namespaces.
--namespace and --admission-controller are now mutually exclusive, the user will still be able to downscale jobs natively as specified inside pull request #71
If --namespace arg is specified, the Kubernetes API Server will receive different API Calls that don't target Cluster Wide operations
Added 403 and 404 error handling to API Calls
refactored unit tests
Docs:
Explained how to use KubeDownscaler without cluster wide access (installation and recommendations on how to set parameters and which mode to choose)
Helm Chart
Introduced 2 parameters inside values.yaml (constrainedDownscaler, constrainedNamespaces). The first one is boolean value and the second one is a list of namespaces where the KubeDownscaler can operate
Added error handling if user specifies constrainedDownscaler without constrainedNamespaces
If constrainedDownscaler is true the Helm Chart will deploy a set of Roles and RoleBindings instead of a single ClusterRole and ClusterRoleBinding. This will setup the needed communications to use Constrained Mode
Added {{ .Release.Namespace }} to Deployment, ConfigMap and ServiceAccount, in order to help the user to configure a differrent namespace for installation
Motivation
This Pull Request will enable users use KubeDownscaler Without Cluster Wide Access (Namespaced Access).
Changes
Python Code:
--namespace
argument will now accept a list of stringconstrianed_downscaler
variable that will be automatically set to true if--namespace
arg is specified--namespace
and--exclude-namespaces
are now mutually exclusive,--namespace
will take precedence and override--exclude-namespaces
.--namespace
and--admission-controller
are now mutually exclusive, the user will still be able to downscale jobs natively as specified inside pull request #71--namespace
arg is specified, the Kubernetes API Server will receive different API Calls that don't target Cluster Wide operationsDocs:
Helm Chart
constrainedDownscaler
,constrainedNamespaces
). The first one is boolean value and the second one is a list of namespaces where the KubeDownscaler can operateconstrainedDownscaler
withoutconstrainedNamespaces
Constrained Mode
{{ .Release.Namespace }}
to Deployment, ConfigMap and ServiceAccount, in order to help the user to configure a differrent namespace for installationTests done
TODO