The module is enabled by default in the following bundles: Default, Managed. The module is disabled by default in the Minimal bundle.

How to explicitly enable the module…

Set the spec.enabled module parameter to true or false in the ModuleConfig/namespace-configurator resource (create it, if necessary) to explicitly enable or disable the module, or use the deckhouse-controller module command in the d8-system/deckhouse pod.

Example of enabling the module:

  • by using the ModuleConfig resource:

    apiVersion: deckhouse.io/v1alpha1
    kind: ModuleConfig
    metadata:
      name: namespace-configurator
    spec:
      enabled: true
    
  • by using the deckhouse-controller command (you need a kubectl, configured to work with the cluster):

    kubectl -ti -n d8-system exec svc/deckhouse-leader -c deckhouse -- deckhouse-controller module enable namespace-configurator
    

Example of disabling the module:

  • by using the ModuleConfig resource:

    apiVersion: deckhouse.io/v1alpha1
    kind: ModuleConfig
    metadata:
      name: namespace-configurator
    spec:
      enabled: false
    
  • by using the deckhouse-controller command (you need a kubectl, configured to work with the cluster):

    kubectl -ti -n d8-system exec svc/deckhouse-leader -c deckhouse -- deckhouse-controller module disable namespace-configurator
    

The module is configured using the ModuleConfig custom resource named namespace-configurator (learn more about setting up Deckhouse…).

Example of the ModuleConfig/namespace-configurator resource for configuring the module:

apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
  name: namespace-configurator
spec:
  version: 1
  enabled: true
  settings: # <-- Module parameters from the "Parameters" section below.

Parameters

Schema version: 1

  • configurations
    array of objects
    • configurations.annotations
      object

      A list of annotations in the key: "value" format.

      Example:

      annotations:
        example: 'true'
      
    • configurations.excludeNames
      array of strings

      A list of namespace patterns to exclude.

      Default: []

      Example:

      excludeNames:
      - infra-test
      
    • configurations.includeNames
      array of strings

      Required value

      A list of namespace patterns to include.

      Default: []

      Example:

      includeNames:
      - prod-.*
      - infra-.*
      
    • configurations.labels
      object

      A list of labels in the key: "value" format.

      Example:

      labels:
        istio-injection: 'true'