Skip to main content
Version: 2.11

Configure Admin Namespace

Portworx Backup allows you to configure a dedicated and standard custom admin namespace to save all your backup-related Kubernetes resources such as secrets, backup and restore CRs, schedule CRs, and so on for multi-namespace backups and restores.

Earlier custom resources related to Portworx Backup were stored in the kube-system namespace along with other key Kubernetes resources. Custom admin namespace segregates critical backup custom resources from kube-system and enables the latter to contain only Kubernetes resources.

Prerequisites​

Operator method​

If you have installed Stork with Portworx operator method, perform the following steps to configure a namespace of your choice as admin namespace:

  1. Run the following command to edit the Stork configuration within the storagecluster:

    kubectl edit storagecluster <clusterspec-name> -n <portworx-namespace>
  2. In the editor, update the arguments in the Stork spec to specify the cluster admin namespace using the admin-namespace parameter.

    stork:
    args:
    admin-namespace: <custom-admin-namespace>
    webhook-controller: "true"

    In the above example, you configured a namespace of your choice called custom-admin-namespace as admin namespace.

  3. Save the changes, wait until all the Stork pods are recreated and are in Running state after the changes are applied:

    kubectl get pods -l name=stork -n <portworx-namespace>

    Output:

    NAME READY STATUS RESTARTS AGE
    stork-6fdd7d567b-4w86q 1/1 Running 0 63s
    stork-6fdd7d567b-lj47r 1/1 Running 0 60s
    stork-6fdd7d567b-m6pk7 1/1 Running 0 59s
    caution

    After you configure a custom admin namespace, ensure that it always exists and is never deleted. Backups fail if the admin namespace does not exist.

    note

    Admin namespace configuration is a one-time activity, once a custom admin namespace is configured do not reconfigure another namespace as an admin namespace.

Deployment method​

If you have installed Stork using deployment method, configure admin namespace with the below commands:

  1. Edit the Stork deployment from Kubernetes CLI:

    kubectl edit deployment stork -n <stork-namespace>
  2. In the deployment spec, add the parameter - --admin-namespace=<custom-admin-namespace> under containers section:

    containers:
    - command:
    - /stork
    - --admin-namespace=<custom-admin-namespace>
    - --verbose
    - --leader-elect=true
    - --health-monitor-interval=120
    - --webhook-controller=true
  3. Save the changes, wait for all the Stork pods to be recreated and are in a Running state after the changes are applied.

    kubectl get pods -l name=stork -n <stork-namespace>

    Output:

    NAME READY STATUS RESTARTS AGE
    stork-6fdd7d567b-4w86q 1/1 Running 0 63s
    stork-6fdd7d567b-lj47r 1/1 Running 0 60s
    stork-6fdd7d567b-m6pk7 1/1 Running 0 59s
  4. Verify that the --admin-namespace flag is in effect by checking the Stork deployment arguments:

    kubectl get deployment stork -n <stork-namespace> -o jsonpath='{.spec.template.spec.containers[0].command}' | tr ',' '\n' | grep admin-namespace

    Expected output:

    --admin-namespace=<custom-admin-namespace>

    If the flag is not visible in the output, the configuration did not take effect. Re-apply the changes and ensure the Stork pods have restarted.

    note

    Admin namespace configuration remains unchanged with Stork upgrade regardless of the Stork deployment method.

In this topic: