1. Packages
  2. Rancher2 Provider
  3. API Docs
  4. Namespace
Rancher 2 v8.1.5 published on Wednesday, Apr 9, 2025 by Pulumi

rancher2.Namespace

Explore with Pulumi AI

Provides a Rancher v2 Namespace resource. This can be used to create namespaces for Rancher v2 environments and retrieve their information.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";

// Create a new rancher2 Namespace
const foo = new rancher2.Namespace("foo", {
    name: "foo",
    projectId: "<PROJECT_ID>",
    description: "foo namespace",
    resourceQuota: {
        limit: {
            limitsCpu: "100m",
            limitsMemory: "100Mi",
            requestsStorage: "1Gi",
        },
    },
    containerResourceLimit: {
        limitsCpu: "20m",
        limitsMemory: "20Mi",
        requestsCpu: "1m",
        requestsMemory: "1Mi",
    },
});
Copy
import pulumi
import pulumi_rancher2 as rancher2

# Create a new rancher2 Namespace
foo = rancher2.Namespace("foo",
    name="foo",
    project_id="<PROJECT_ID>",
    description="foo namespace",
    resource_quota={
        "limit": {
            "limits_cpu": "100m",
            "limits_memory": "100Mi",
            "requests_storage": "1Gi",
        },
    },
    container_resource_limit={
        "limits_cpu": "20m",
        "limits_memory": "20Mi",
        "requests_cpu": "1m",
        "requests_memory": "1Mi",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-rancher2/sdk/v8/go/rancher2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a new rancher2 Namespace
		_, err := rancher2.NewNamespace(ctx, "foo", &rancher2.NamespaceArgs{
			Name:        pulumi.String("foo"),
			ProjectId:   pulumi.String("<PROJECT_ID>"),
			Description: pulumi.String("foo namespace"),
			ResourceQuota: &rancher2.NamespaceResourceQuotaArgs{
				Limit: &rancher2.NamespaceResourceQuotaLimitArgs{
					LimitsCpu:       pulumi.String("100m"),
					LimitsMemory:    pulumi.String("100Mi"),
					RequestsStorage: pulumi.String("1Gi"),
				},
			},
			ContainerResourceLimit: &rancher2.NamespaceContainerResourceLimitArgs{
				LimitsCpu:      pulumi.String("20m"),
				LimitsMemory:   pulumi.String("20Mi"),
				RequestsCpu:    pulumi.String("1m"),
				RequestsMemory: pulumi.String("1Mi"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Rancher2 = Pulumi.Rancher2;

return await Deployment.RunAsync(() => 
{
    // Create a new rancher2 Namespace
    var foo = new Rancher2.Namespace("foo", new()
    {
        Name = "foo",
        ProjectId = "<PROJECT_ID>",
        Description = "foo namespace",
        ResourceQuota = new Rancher2.Inputs.NamespaceResourceQuotaArgs
        {
            Limit = new Rancher2.Inputs.NamespaceResourceQuotaLimitArgs
            {
                LimitsCpu = "100m",
                LimitsMemory = "100Mi",
                RequestsStorage = "1Gi",
            },
        },
        ContainerResourceLimit = new Rancher2.Inputs.NamespaceContainerResourceLimitArgs
        {
            LimitsCpu = "20m",
            LimitsMemory = "20Mi",
            RequestsCpu = "1m",
            RequestsMemory = "1Mi",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rancher2.Namespace;
import com.pulumi.rancher2.NamespaceArgs;
import com.pulumi.rancher2.inputs.NamespaceResourceQuotaArgs;
import com.pulumi.rancher2.inputs.NamespaceResourceQuotaLimitArgs;
import com.pulumi.rancher2.inputs.NamespaceContainerResourceLimitArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        // Create a new rancher2 Namespace
        var foo = new Namespace("foo", NamespaceArgs.builder()
            .name("foo")
            .projectId("<PROJECT_ID>")
            .description("foo namespace")
            .resourceQuota(NamespaceResourceQuotaArgs.builder()
                .limit(NamespaceResourceQuotaLimitArgs.builder()
                    .limitsCpu("100m")
                    .limitsMemory("100Mi")
                    .requestsStorage("1Gi")
                    .build())
                .build())
            .containerResourceLimit(NamespaceContainerResourceLimitArgs.builder()
                .limitsCpu("20m")
                .limitsMemory("20Mi")
                .requestsCpu("1m")
                .requestsMemory("1Mi")
                .build())
            .build());

    }
}
Copy
resources:
  # Create a new rancher2 Namespace
  foo:
    type: rancher2:Namespace
    properties:
      name: foo
      projectId: <PROJECT_ID>
      description: foo namespace
      resourceQuota:
        limit:
          limitsCpu: 100m
          limitsMemory: 100Mi
          requestsStorage: 1Gi
      containerResourceLimit:
        limitsCpu: 20m
        limitsMemory: 20Mi
        requestsCpu: 1m
        requestsMemory: 1Mi
Copy
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";

// Create a new rancher2 Cluster 
const foo_custom = new rancher2.Cluster("foo-custom", {
    name: "foo-custom",
    description: "Foo rancher2 custom cluster",
    rkeConfig: {
        network: {
            plugin: "canal",
        },
    },
});
// Create a new rancher2 Namespace assigned to default cluster project
const foo = new rancher2.Namespace("foo", {
    name: "foo",
    projectId: foo_custom.defaultProjectId,
    description: "foo namespace",
    resourceQuota: {
        limit: {
            limitsCpu: "100m",
            limitsMemory: "100Mi",
            requestsStorage: "1Gi",
        },
    },
    containerResourceLimit: {
        limitsCpu: "20m",
        limitsMemory: "20Mi",
        requestsCpu: "1m",
        requestsMemory: "1Mi",
    },
});
Copy
import pulumi
import pulumi_rancher2 as rancher2

# Create a new rancher2 Cluster 
foo_custom = rancher2.Cluster("foo-custom",
    name="foo-custom",
    description="Foo rancher2 custom cluster",
    rke_config={
        "network": {
            "plugin": "canal",
        },
    })
# Create a new rancher2 Namespace assigned to default cluster project
foo = rancher2.Namespace("foo",
    name="foo",
    project_id=foo_custom.default_project_id,
    description="foo namespace",
    resource_quota={
        "limit": {
            "limits_cpu": "100m",
            "limits_memory": "100Mi",
            "requests_storage": "1Gi",
        },
    },
    container_resource_limit={
        "limits_cpu": "20m",
        "limits_memory": "20Mi",
        "requests_cpu": "1m",
        "requests_memory": "1Mi",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-rancher2/sdk/v8/go/rancher2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a new rancher2 Cluster
		foo_custom, err := rancher2.NewCluster(ctx, "foo-custom", &rancher2.ClusterArgs{
			Name:        pulumi.String("foo-custom"),
			Description: pulumi.String("Foo rancher2 custom cluster"),
			RkeConfig: &rancher2.ClusterRkeConfigArgs{
				Network: &rancher2.ClusterRkeConfigNetworkArgs{
					Plugin: pulumi.String("canal"),
				},
			},
		})
		if err != nil {
			return err
		}
		// Create a new rancher2 Namespace assigned to default cluster project
		_, err = rancher2.NewNamespace(ctx, "foo", &rancher2.NamespaceArgs{
			Name:        pulumi.String("foo"),
			ProjectId:   foo_custom.DefaultProjectId,
			Description: pulumi.String("foo namespace"),
			ResourceQuota: &rancher2.NamespaceResourceQuotaArgs{
				Limit: &rancher2.NamespaceResourceQuotaLimitArgs{
					LimitsCpu:       pulumi.String("100m"),
					LimitsMemory:    pulumi.String("100Mi"),
					RequestsStorage: pulumi.String("1Gi"),
				},
			},
			ContainerResourceLimit: &rancher2.NamespaceContainerResourceLimitArgs{
				LimitsCpu:      pulumi.String("20m"),
				LimitsMemory:   pulumi.String("20Mi"),
				RequestsCpu:    pulumi.String("1m"),
				RequestsMemory: pulumi.String("1Mi"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Rancher2 = Pulumi.Rancher2;

return await Deployment.RunAsync(() => 
{
    // Create a new rancher2 Cluster 
    var foo_custom = new Rancher2.Cluster("foo-custom", new()
    {
        Name = "foo-custom",
        Description = "Foo rancher2 custom cluster",
        RkeConfig = new Rancher2.Inputs.ClusterRkeConfigArgs
        {
            Network = new Rancher2.Inputs.ClusterRkeConfigNetworkArgs
            {
                Plugin = "canal",
            },
        },
    });

    // Create a new rancher2 Namespace assigned to default cluster project
    var foo = new Rancher2.Namespace("foo", new()
    {
        Name = "foo",
        ProjectId = foo_custom.DefaultProjectId,
        Description = "foo namespace",
        ResourceQuota = new Rancher2.Inputs.NamespaceResourceQuotaArgs
        {
            Limit = new Rancher2.Inputs.NamespaceResourceQuotaLimitArgs
            {
                LimitsCpu = "100m",
                LimitsMemory = "100Mi",
                RequestsStorage = "1Gi",
            },
        },
        ContainerResourceLimit = new Rancher2.Inputs.NamespaceContainerResourceLimitArgs
        {
            LimitsCpu = "20m",
            LimitsMemory = "20Mi",
            RequestsCpu = "1m",
            RequestsMemory = "1Mi",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rancher2.Cluster;
import com.pulumi.rancher2.ClusterArgs;
import com.pulumi.rancher2.inputs.ClusterRkeConfigArgs;
import com.pulumi.rancher2.inputs.ClusterRkeConfigNetworkArgs;
import com.pulumi.rancher2.Namespace;
import com.pulumi.rancher2.NamespaceArgs;
import com.pulumi.rancher2.inputs.NamespaceResourceQuotaArgs;
import com.pulumi.rancher2.inputs.NamespaceResourceQuotaLimitArgs;
import com.pulumi.rancher2.inputs.NamespaceContainerResourceLimitArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        // Create a new rancher2 Cluster 
        var foo_custom = new Cluster("foo-custom", ClusterArgs.builder()
            .name("foo-custom")
            .description("Foo rancher2 custom cluster")
            .rkeConfig(ClusterRkeConfigArgs.builder()
                .network(ClusterRkeConfigNetworkArgs.builder()
                    .plugin("canal")
                    .build())
                .build())
            .build());

        // Create a new rancher2 Namespace assigned to default cluster project
        var foo = new Namespace("foo", NamespaceArgs.builder()
            .name("foo")
            .projectId(foo_custom.defaultProjectId())
            .description("foo namespace")
            .resourceQuota(NamespaceResourceQuotaArgs.builder()
                .limit(NamespaceResourceQuotaLimitArgs.builder()
                    .limitsCpu("100m")
                    .limitsMemory("100Mi")
                    .requestsStorage("1Gi")
                    .build())
                .build())
            .containerResourceLimit(NamespaceContainerResourceLimitArgs.builder()
                .limitsCpu("20m")
                .limitsMemory("20Mi")
                .requestsCpu("1m")
                .requestsMemory("1Mi")
                .build())
            .build());

    }
}
Copy
resources:
  # Create a new rancher2 Cluster
  foo-custom:
    type: rancher2:Cluster
    properties:
      name: foo-custom
      description: Foo rancher2 custom cluster
      rkeConfig:
        network:
          plugin: canal
  # Create a new rancher2 Namespace assigned to default cluster project
  foo:
    type: rancher2:Namespace
    properties:
      name: foo
      projectId: ${["foo-custom"].defaultProjectId}
      description: foo namespace
      resourceQuota:
        limit:
          limitsCpu: 100m
          limitsMemory: 100Mi
          requestsStorage: 1Gi
      containerResourceLimit:
        limitsCpu: 20m
        limitsMemory: 20Mi
        requestsCpu: 1m
        requestsMemory: 1Mi
Copy

Create Namespace Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Namespace(name: string, args: NamespaceArgs, opts?: CustomResourceOptions);
@overload
def Namespace(resource_name: str,
              args: NamespaceArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def Namespace(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              project_id: Optional[str] = None,
              annotations: Optional[Mapping[str, str]] = None,
              container_resource_limit: Optional[NamespaceContainerResourceLimitArgs] = None,
              description: Optional[str] = None,
              labels: Optional[Mapping[str, str]] = None,
              name: Optional[str] = None,
              resource_quota: Optional[NamespaceResourceQuotaArgs] = None,
              wait_for_cluster: Optional[bool] = None)
func NewNamespace(ctx *Context, name string, args NamespaceArgs, opts ...ResourceOption) (*Namespace, error)
public Namespace(string name, NamespaceArgs args, CustomResourceOptions? opts = null)
public Namespace(String name, NamespaceArgs args)
public Namespace(String name, NamespaceArgs args, CustomResourceOptions options)
type: rancher2:Namespace
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var namespaceResource = new Rancher2.Namespace("namespaceResource", new()
{
    ProjectId = "string",
    Annotations = 
    {
        { "string", "string" },
    },
    ContainerResourceLimit = new Rancher2.Inputs.NamespaceContainerResourceLimitArgs
    {
        LimitsCpu = "string",
        LimitsMemory = "string",
        RequestsCpu = "string",
        RequestsMemory = "string",
    },
    Description = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    ResourceQuota = new Rancher2.Inputs.NamespaceResourceQuotaArgs
    {
        Limit = new Rancher2.Inputs.NamespaceResourceQuotaLimitArgs
        {
            ConfigMaps = "string",
            LimitsCpu = "string",
            LimitsMemory = "string",
            PersistentVolumeClaims = "string",
            Pods = "string",
            ReplicationControllers = "string",
            RequestsCpu = "string",
            RequestsMemory = "string",
            RequestsStorage = "string",
            Secrets = "string",
            Services = "string",
            ServicesLoadBalancers = "string",
            ServicesNodePorts = "string",
        },
    },
    WaitForCluster = false,
});
Copy
example, err := rancher2.NewNamespace(ctx, "namespaceResource", &rancher2.NamespaceArgs{
	ProjectId: pulumi.String("string"),
	Annotations: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	ContainerResourceLimit: &rancher2.NamespaceContainerResourceLimitArgs{
		LimitsCpu:      pulumi.String("string"),
		LimitsMemory:   pulumi.String("string"),
		RequestsCpu:    pulumi.String("string"),
		RequestsMemory: pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name: pulumi.String("string"),
	ResourceQuota: &rancher2.NamespaceResourceQuotaArgs{
		Limit: &rancher2.NamespaceResourceQuotaLimitArgs{
			ConfigMaps:             pulumi.String("string"),
			LimitsCpu:              pulumi.String("string"),
			LimitsMemory:           pulumi.String("string"),
			PersistentVolumeClaims: pulumi.String("string"),
			Pods:                   pulumi.String("string"),
			ReplicationControllers: pulumi.String("string"),
			RequestsCpu:            pulumi.String("string"),
			RequestsMemory:         pulumi.String("string"),
			RequestsStorage:        pulumi.String("string"),
			Secrets:                pulumi.String("string"),
			Services:               pulumi.String("string"),
			ServicesLoadBalancers:  pulumi.String("string"),
			ServicesNodePorts:      pulumi.String("string"),
		},
	},
	WaitForCluster: pulumi.Bool(false),
})
Copy
var namespaceResource = new Namespace("namespaceResource", NamespaceArgs.builder()
    .projectId("string")
    .annotations(Map.of("string", "string"))
    .containerResourceLimit(NamespaceContainerResourceLimitArgs.builder()
        .limitsCpu("string")
        .limitsMemory("string")
        .requestsCpu("string")
        .requestsMemory("string")
        .build())
    .description("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .resourceQuota(NamespaceResourceQuotaArgs.builder()
        .limit(NamespaceResourceQuotaLimitArgs.builder()
            .configMaps("string")
            .limitsCpu("string")
            .limitsMemory("string")
            .persistentVolumeClaims("string")
            .pods("string")
            .replicationControllers("string")
            .requestsCpu("string")
            .requestsMemory("string")
            .requestsStorage("string")
            .secrets("string")
            .services("string")
            .servicesLoadBalancers("string")
            .servicesNodePorts("string")
            .build())
        .build())
    .waitForCluster(false)
    .build());
Copy
namespace_resource = rancher2.Namespace("namespaceResource",
    project_id="string",
    annotations={
        "string": "string",
    },
    container_resource_limit={
        "limits_cpu": "string",
        "limits_memory": "string",
        "requests_cpu": "string",
        "requests_memory": "string",
    },
    description="string",
    labels={
        "string": "string",
    },
    name="string",
    resource_quota={
        "limit": {
            "config_maps": "string",
            "limits_cpu": "string",
            "limits_memory": "string",
            "persistent_volume_claims": "string",
            "pods": "string",
            "replication_controllers": "string",
            "requests_cpu": "string",
            "requests_memory": "string",
            "requests_storage": "string",
            "secrets": "string",
            "services": "string",
            "services_load_balancers": "string",
            "services_node_ports": "string",
        },
    },
    wait_for_cluster=False)
Copy
const namespaceResource = new rancher2.Namespace("namespaceResource", {
    projectId: "string",
    annotations: {
        string: "string",
    },
    containerResourceLimit: {
        limitsCpu: "string",
        limitsMemory: "string",
        requestsCpu: "string",
        requestsMemory: "string",
    },
    description: "string",
    labels: {
        string: "string",
    },
    name: "string",
    resourceQuota: {
        limit: {
            configMaps: "string",
            limitsCpu: "string",
            limitsMemory: "string",
            persistentVolumeClaims: "string",
            pods: "string",
            replicationControllers: "string",
            requestsCpu: "string",
            requestsMemory: "string",
            requestsStorage: "string",
            secrets: "string",
            services: "string",
            servicesLoadBalancers: "string",
            servicesNodePorts: "string",
        },
    },
    waitForCluster: false,
});
Copy
type: rancher2:Namespace
properties:
    annotations:
        string: string
    containerResourceLimit:
        limitsCpu: string
        limitsMemory: string
        requestsCpu: string
        requestsMemory: string
    description: string
    labels:
        string: string
    name: string
    projectId: string
    resourceQuota:
        limit:
            configMaps: string
            limitsCpu: string
            limitsMemory: string
            persistentVolumeClaims: string
            pods: string
            replicationControllers: string
            requestsCpu: string
            requestsMemory: string
            requestsStorage: string
            secrets: string
            services: string
            servicesLoadBalancers: string
            servicesNodePorts: string
    waitForCluster: false
Copy

Namespace Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Namespace resource accepts the following input properties:

ProjectId This property is required. string
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
Annotations Dictionary<string, string>
Annotations for Node Pool object (map)
ContainerResourceLimit NamespaceContainerResourceLimit
Default containers resource limits on namespace (List maxitem:1)
Description string
A namespace description (string)
Labels Dictionary<string, string>
Labels for Node Pool object (map)
Name Changes to this property will trigger replacement. string
The name of the namespace (string)
ResourceQuota NamespaceResourceQuota
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
WaitForCluster bool
Wait for cluster becomes active. Default false (bool)
ProjectId This property is required. string
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
Annotations map[string]string
Annotations for Node Pool object (map)
ContainerResourceLimit NamespaceContainerResourceLimitArgs
Default containers resource limits on namespace (List maxitem:1)
Description string
A namespace description (string)
Labels map[string]string
Labels for Node Pool object (map)
Name Changes to this property will trigger replacement. string
The name of the namespace (string)
ResourceQuota NamespaceResourceQuotaArgs
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
WaitForCluster bool
Wait for cluster becomes active. Default false (bool)
projectId This property is required. String
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
annotations Map<String,String>
Annotations for Node Pool object (map)
containerResourceLimit NamespaceContainerResourceLimit
Default containers resource limits on namespace (List maxitem:1)
description String
A namespace description (string)
labels Map<String,String>
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. String
The name of the namespace (string)
resourceQuota NamespaceResourceQuota
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
waitForCluster Boolean
Wait for cluster becomes active. Default false (bool)
projectId This property is required. string
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
annotations {[key: string]: string}
Annotations for Node Pool object (map)
containerResourceLimit NamespaceContainerResourceLimit
Default containers resource limits on namespace (List maxitem:1)
description string
A namespace description (string)
labels {[key: string]: string}
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. string
The name of the namespace (string)
resourceQuota NamespaceResourceQuota
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
waitForCluster boolean
Wait for cluster becomes active. Default false (bool)
project_id This property is required. str
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
annotations Mapping[str, str]
Annotations for Node Pool object (map)
container_resource_limit NamespaceContainerResourceLimitArgs
Default containers resource limits on namespace (List maxitem:1)
description str
A namespace description (string)
labels Mapping[str, str]
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. str
The name of the namespace (string)
resource_quota NamespaceResourceQuotaArgs
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
wait_for_cluster bool
Wait for cluster becomes active. Default false (bool)
projectId This property is required. String
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
annotations Map<String>
Annotations for Node Pool object (map)
containerResourceLimit Property Map
Default containers resource limits on namespace (List maxitem:1)
description String
A namespace description (string)
labels Map<String>
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. String
The name of the namespace (string)
resourceQuota Property Map
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
waitForCluster Boolean
Wait for cluster becomes active. Default false (bool)

Outputs

All input properties are implicitly available as output properties. Additionally, the Namespace resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Namespace Resource

Get an existing Namespace resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: NamespaceState, opts?: CustomResourceOptions): Namespace
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        annotations: Optional[Mapping[str, str]] = None,
        container_resource_limit: Optional[NamespaceContainerResourceLimitArgs] = None,
        description: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        project_id: Optional[str] = None,
        resource_quota: Optional[NamespaceResourceQuotaArgs] = None,
        wait_for_cluster: Optional[bool] = None) -> Namespace
func GetNamespace(ctx *Context, name string, id IDInput, state *NamespaceState, opts ...ResourceOption) (*Namespace, error)
public static Namespace Get(string name, Input<string> id, NamespaceState? state, CustomResourceOptions? opts = null)
public static Namespace get(String name, Output<String> id, NamespaceState state, CustomResourceOptions options)
resources:  _:    type: rancher2:Namespace    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Annotations Dictionary<string, string>
Annotations for Node Pool object (map)
ContainerResourceLimit NamespaceContainerResourceLimit
Default containers resource limits on namespace (List maxitem:1)
Description string
A namespace description (string)
Labels Dictionary<string, string>
Labels for Node Pool object (map)
Name Changes to this property will trigger replacement. string
The name of the namespace (string)
ProjectId string
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
ResourceQuota NamespaceResourceQuota
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
WaitForCluster bool
Wait for cluster becomes active. Default false (bool)
Annotations map[string]string
Annotations for Node Pool object (map)
ContainerResourceLimit NamespaceContainerResourceLimitArgs
Default containers resource limits on namespace (List maxitem:1)
Description string
A namespace description (string)
Labels map[string]string
Labels for Node Pool object (map)
Name Changes to this property will trigger replacement. string
The name of the namespace (string)
ProjectId string
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
ResourceQuota NamespaceResourceQuotaArgs
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
WaitForCluster bool
Wait for cluster becomes active. Default false (bool)
annotations Map<String,String>
Annotations for Node Pool object (map)
containerResourceLimit NamespaceContainerResourceLimit
Default containers resource limits on namespace (List maxitem:1)
description String
A namespace description (string)
labels Map<String,String>
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. String
The name of the namespace (string)
projectId String
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
resourceQuota NamespaceResourceQuota
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
waitForCluster Boolean
Wait for cluster becomes active. Default false (bool)
annotations {[key: string]: string}
Annotations for Node Pool object (map)
containerResourceLimit NamespaceContainerResourceLimit
Default containers resource limits on namespace (List maxitem:1)
description string
A namespace description (string)
labels {[key: string]: string}
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. string
The name of the namespace (string)
projectId string
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
resourceQuota NamespaceResourceQuota
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
waitForCluster boolean
Wait for cluster becomes active. Default false (bool)
annotations Mapping[str, str]
Annotations for Node Pool object (map)
container_resource_limit NamespaceContainerResourceLimitArgs
Default containers resource limits on namespace (List maxitem:1)
description str
A namespace description (string)
labels Mapping[str, str]
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. str
The name of the namespace (string)
project_id str
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
resource_quota NamespaceResourceQuotaArgs
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
wait_for_cluster bool
Wait for cluster becomes active. Default false (bool)
annotations Map<String>
Annotations for Node Pool object (map)
containerResourceLimit Property Map
Default containers resource limits on namespace (List maxitem:1)
description String
A namespace description (string)
labels Map<String>
Labels for Node Pool object (map)
name Changes to this property will trigger replacement. String
The name of the namespace (string)
projectId String
The project id where assign namespace. It's on the form project_id=<cluster_id>:<id>. Updating <id> part on same <cluster_id> namespace will be moved between projects (string)
resourceQuota Property Map
Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
waitForCluster Boolean
Wait for cluster becomes active. Default false (bool)

Supporting Types

NamespaceContainerResourceLimit
, NamespaceContainerResourceLimitArgs

LimitsCpu string
Limit for limits cpu in namespace (string)
LimitsMemory string
Limit for limits memory in namespace (string)
RequestsCpu string
Limit for requests cpu in namespace (string)
RequestsMemory string
Limit for requests memory in namespace (string)
LimitsCpu string
Limit for limits cpu in namespace (string)
LimitsMemory string
Limit for limits memory in namespace (string)
RequestsCpu string
Limit for requests cpu in namespace (string)
RequestsMemory string
Limit for requests memory in namespace (string)
limitsCpu String
Limit for limits cpu in namespace (string)
limitsMemory String
Limit for limits memory in namespace (string)
requestsCpu String
Limit for requests cpu in namespace (string)
requestsMemory String
Limit for requests memory in namespace (string)
limitsCpu string
Limit for limits cpu in namespace (string)
limitsMemory string
Limit for limits memory in namespace (string)
requestsCpu string
Limit for requests cpu in namespace (string)
requestsMemory string
Limit for requests memory in namespace (string)
limits_cpu str
Limit for limits cpu in namespace (string)
limits_memory str
Limit for limits memory in namespace (string)
requests_cpu str
Limit for requests cpu in namespace (string)
requests_memory str
Limit for requests memory in namespace (string)
limitsCpu String
Limit for limits cpu in namespace (string)
limitsMemory String
Limit for limits memory in namespace (string)
requestsCpu String
Limit for requests cpu in namespace (string)
requestsMemory String
Limit for requests memory in namespace (string)

NamespaceResourceQuota
, NamespaceResourceQuotaArgs

Limit This property is required. NamespaceResourceQuotaLimit
Resource quota limit for namespace (list maxitems:1)
Limit This property is required. NamespaceResourceQuotaLimit
Resource quota limit for namespace (list maxitems:1)
limit This property is required. NamespaceResourceQuotaLimit
Resource quota limit for namespace (list maxitems:1)
limit This property is required. NamespaceResourceQuotaLimit
Resource quota limit for namespace (list maxitems:1)
limit This property is required. NamespaceResourceQuotaLimit
Resource quota limit for namespace (list maxitems:1)
limit This property is required. Property Map
Resource quota limit for namespace (list maxitems:1)

NamespaceResourceQuotaLimit
, NamespaceResourceQuotaLimitArgs

ConfigMaps string
Limit for config maps in namespace (string)
LimitsCpu string
Limit for limits cpu in namespace (string)
LimitsMemory string
Limit for limits memory in namespace (string)
PersistentVolumeClaims string
Limit for persistent volume claims in namespace (string)
Pods string
Limit for pods in namespace (string)
ReplicationControllers string
Limit for replication controllers in namespace (string)
RequestsCpu string
Limit for requests cpu in namespace (string)
RequestsMemory string
Limit for requests memory in namespace (string)
RequestsStorage string
Limit for requests storage in namespace (string)
Secrets string
Limit for secrets in namespace (string)
Services string
ServicesLoadBalancers string
Limit for services load balancers in namespace (string)
ServicesNodePorts string

Limit for services node ports in namespace (string)

More info at resource-quotas

ConfigMaps string
Limit for config maps in namespace (string)
LimitsCpu string
Limit for limits cpu in namespace (string)
LimitsMemory string
Limit for limits memory in namespace (string)
PersistentVolumeClaims string
Limit for persistent volume claims in namespace (string)
Pods string
Limit for pods in namespace (string)
ReplicationControllers string
Limit for replication controllers in namespace (string)
RequestsCpu string
Limit for requests cpu in namespace (string)
RequestsMemory string
Limit for requests memory in namespace (string)
RequestsStorage string
Limit for requests storage in namespace (string)
Secrets string
Limit for secrets in namespace (string)
Services string
ServicesLoadBalancers string
Limit for services load balancers in namespace (string)
ServicesNodePorts string

Limit for services node ports in namespace (string)

More info at resource-quotas

configMaps String
Limit for config maps in namespace (string)
limitsCpu String
Limit for limits cpu in namespace (string)
limitsMemory String
Limit for limits memory in namespace (string)
persistentVolumeClaims String
Limit for persistent volume claims in namespace (string)
pods String
Limit for pods in namespace (string)
replicationControllers String
Limit for replication controllers in namespace (string)
requestsCpu String
Limit for requests cpu in namespace (string)
requestsMemory String
Limit for requests memory in namespace (string)
requestsStorage String
Limit for requests storage in namespace (string)
secrets String
Limit for secrets in namespace (string)
services String
servicesLoadBalancers String
Limit for services load balancers in namespace (string)
servicesNodePorts String

Limit for services node ports in namespace (string)

More info at resource-quotas

configMaps string
Limit for config maps in namespace (string)
limitsCpu string
Limit for limits cpu in namespace (string)
limitsMemory string
Limit for limits memory in namespace (string)
persistentVolumeClaims string
Limit for persistent volume claims in namespace (string)
pods string
Limit for pods in namespace (string)
replicationControllers string
Limit for replication controllers in namespace (string)
requestsCpu string
Limit for requests cpu in namespace (string)
requestsMemory string
Limit for requests memory in namespace (string)
requestsStorage string
Limit for requests storage in namespace (string)
secrets string
Limit for secrets in namespace (string)
services string
servicesLoadBalancers string
Limit for services load balancers in namespace (string)
servicesNodePorts string

Limit for services node ports in namespace (string)

More info at resource-quotas

config_maps str
Limit for config maps in namespace (string)
limits_cpu str
Limit for limits cpu in namespace (string)
limits_memory str
Limit for limits memory in namespace (string)
persistent_volume_claims str
Limit for persistent volume claims in namespace (string)
pods str
Limit for pods in namespace (string)
replication_controllers str
Limit for replication controllers in namespace (string)
requests_cpu str
Limit for requests cpu in namespace (string)
requests_memory str
Limit for requests memory in namespace (string)
requests_storage str
Limit for requests storage in namespace (string)
secrets str
Limit for secrets in namespace (string)
services str
services_load_balancers str
Limit for services load balancers in namespace (string)
services_node_ports str

Limit for services node ports in namespace (string)

More info at resource-quotas

configMaps String
Limit for config maps in namespace (string)
limitsCpu String
Limit for limits cpu in namespace (string)
limitsMemory String
Limit for limits memory in namespace (string)
persistentVolumeClaims String
Limit for persistent volume claims in namespace (string)
pods String
Limit for pods in namespace (string)
replicationControllers String
Limit for replication controllers in namespace (string)
requestsCpu String
Limit for requests cpu in namespace (string)
requestsMemory String
Limit for requests memory in namespace (string)
requestsStorage String
Limit for requests storage in namespace (string)
secrets String
Limit for secrets in namespace (string)
services String
servicesLoadBalancers String
Limit for services load balancers in namespace (string)
servicesNodePorts String

Limit for services node ports in namespace (string)

More info at resource-quotas

Import

Namespaces can be imported using the namespace ID in the format <project_id>.<namespace_id>

$ pulumi import rancher2:index/namespace:Namespace foo &lt;project_id&gt;.&lt;namespaces_id&gt;
Copy

<project_id> is in the format <cluster_id>:<id>, but part is optional:

  • If full project_id is provided, <project_id>=<cluster_id>:<id>, the namespace’ll be assigned to corresponding cluster project once it’s imported.

  • If <id> part is omitted <project_id>=<cluster_id>, the namespace’ll not be assigned to any project. To move it into a project, <project_id>=<cluster_id>:<id> needs to be updated in tf file. Namespace movement is only supported inside same cluster_id.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Rancher2 pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.