Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Stackland
  • What's new
  • Installation
    • All tutorials
    • Installing Stackland on Yandex BareMetal
    • Setting up external access to a pod in a cluster
    • All guides
      • All guides
      • Creating a project
      • Managing namespaces
      • Configuring project roles
      • Setting quotas in namespaces
      • Creating a project quota
    • Projects
    • Resource model
  • Access management
  • Pricing policy
  • Diagnostics and troubleshooting

In this article:

  • Getting started
  • Creating a namespace
  • Alternative method: creating via Namespace
  • Viewing the project's namespaces
  • Deletion protection
  • Deleting a namespace
  • What's next
  1. Step-by-step guides
  2. Projects
  3. Managing namespaces

Managing namespaces in a project

Written by
Yandex Cloud
Updated at April 8, 2026
  • Getting started
  • Creating a namespace
    • Alternative method: creating via Namespace
  • Viewing the project's namespaces
  • Deletion protection
  • Deleting a namespace
  • What's next

Project namespaces allows you to organize your resources and maintain their isolation. Each project can contain several namespaces.

Getting startedGetting started

Make sure that:

  • You have the project administrator or cluster administrator role.
  • The project already exists. If not, create one.

Creating a namespaceCreating a namespace

The names of project namespaces must be prefixed with <project_name>-. For example, for a project named test-project, the possible names would be test-project-main or test-project-backend.

Management console
CLI
  1. In the left-hand menu, select Projects.

  2. Select the project from the list.

  3. Click Namespaces on the project’s side panel.

  4. Click + Create namespace.

  5. Specify the parameters:

    • Name: Namespace suffix. The <project_name>- prefix is added automatically. This is a required field.
    • Allow deletion: Remove this flag to protect the namespace from accidental deletion. The flag is removed by default.
  6. Click Create.

To create a namespace, use the ProjectNamespace resource. This resource is created in the service namespace of the project-<project_name> project.

  1. Create a manifest file, e.g., namespace.yaml:

    apiVersion: stackland.yandex.cloud/v1alpha1
    kind: ProjectNamespace
    metadata:
      namespace: project-team-alpha
      name: team-alpha-backend
    spec:
      template:
        labels:
          environment: production
        annotations:
          description: "Backend services"
    

    Where:

    • metadata.namespace: Project's service namespace in project-<project_name> format. This is a required field.
    • metadata.name: Name of the new namespace. Must be prefixed with <project_name>-. This is a required field.
    • spec.template.labels: Additional labels for the namespace. This is an optional field.
    • spec.template.labels: Additional annotations for the namespace. This is an optional field.
  2. Apply the manifest:

    kubectl apply -f namespace.yaml
    

Stackland will automatically create the team-alpha-backend namespace labeled with stackland.yandex.cloud/project-name: team-alpha.

Alternative method: creating via NamespaceAlternative method: creating via Namespace

You can create a namespace directly by specifying a project label:

apiVersion: v1
kind: Namespace
metadata:
  name: team-alpha-backend
  labels:
    stackland.yandex.cloud/project-name: team-alpha

Note

To create a namespace directly, you need permissions to create a Namespace resource in the cluster. The name of your namespace must be prefixed with <project_name>-.

Viewing the project's namespacesViewing the project's namespaces

Management console
CLI
  1. In the left-hand menu, select Projects.
  2. Select the project from the list.
  3. Click Namespaces on the project’s side panel.

To get a list of the project's namespaces, run this command:

kubectl get namespaces -l stackland.yandex.cloud/project-name=team-alpha

To get a list of ProjectNamespace resources:

kubectl get projectnamespaces -n project-team-alpha

Deletion protectionDeletion protection

By default, namespaces are deletion-protected. This protection is controlled by the Allow deletion flag:

  • When the flag is removed, the namespace is deletion-protected.
  • When the flag is set, the namespace can be deleted.

To change the protection setting via the management console:

  1. In the left-hand menu, select Projects.
  2. Select the project from the list.
  3. Click Namespaces on the project’s side panel.
  4. Click the name of the namespace.
  5. Click Edit.
  6. Set or remove the Allow deletion flag.
  7. Click Save.

To change the protection setting via the CLI:

apiVersion: stackland.yandex.cloud/v1alpha1
kind: ProjectNamespace
metadata:
  namespace: project-team-alpha
  name: team-alpha-backend
spec:
  allowDeletion: true

Deleting a namespaceDeleting a namespace

Management console
CLI
  1. In the left-hand menu, select Projects.
  2. Select the project from the list.
  3. Click Namespaces on the project’s side panel.
  4. In the namespace row, click ⋯ and select Delete.
  5. Confirm the deletion.
  1. Disable deletion protection, if it is on:

    kubectl patch projectnamespace team-alpha-backend \
      -n project-team-alpha \
      --type merge \
      -p '{"spec":{"allowDeletion":true}}'
    
  2. Delete the ProjectNamespace resource:

    kubectl delete projectnamespace team-alpha-backend -n project-team-alpha
    

Stackland will automatically delete the associated namespace and all resources inside it.

Warning

Deleting a namespace deletes all resources inside it. This operation is irreversible.

What's nextWhat's next

  • Configuring roles in a project
  • Setting project quotas

Was the article helpful?

Previous
Creating a project
Next
Configuring project roles
© 2026 Direct Cursus Technology L.L.C.