1. Packages
  2. Rancher2
  3. API Docs
  4. Namespace
Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi

rancher2.Namespace

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi

    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",
        },
    });
    
    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=rancher2.NamespaceResourceQuotaArgs(
            limit=rancher2.NamespaceResourceQuotaLimitArgs(
                limits_cpu="100m",
                limits_memory="100Mi",
                requests_storage="1Gi",
            ),
        ),
        container_resource_limit=rancher2.NamespaceContainerResourceLimitArgs(
            limits_cpu="20m",
            limits_memory="20Mi",
            requests_cpu="1m",
            requests_memory="1Mi",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/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
    	})
    }
    
    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",
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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
    
    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",
        },
    });
    
    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=rancher2.ClusterRkeConfigArgs(
            network=rancher2.ClusterRkeConfigNetworkArgs(
                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=rancher2.NamespaceResourceQuotaArgs(
            limit=rancher2.NamespaceResourceQuotaLimitArgs(
                limits_cpu="100m",
                limits_memory="100Mi",
                requests_storage="1Gi",
            ),
        ),
        container_resource_limit=rancher2.NamespaceContainerResourceLimitArgs(
            limits_cpu="20m",
            limits_memory="20Mi",
            requests_cpu="1m",
            requests_memory="1Mi",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/go/rancher2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new rancher2 Cluster
    		_, 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
    	})
    }
    
    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",
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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, Any]] = None,
                  container_resource_limit: Optional[NamespaceContainerResourceLimitArgs] = None,
                  description: Optional[str] = None,
                  labels: Optional[Mapping[str, Any]] = 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 string
    The unique name of the resource.
    args NamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args NamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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", "any" },
        },
        ContainerResourceLimit = new Rancher2.Inputs.NamespaceContainerResourceLimitArgs
        {
            LimitsCpu = "string",
            LimitsMemory = "string",
            RequestsCpu = "string",
            RequestsMemory = "string",
        },
        Description = "string",
        Labels = 
        {
            { "string", "any" },
        },
        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,
    });
    
    example, err := rancher2.NewNamespace(ctx, "namespaceResource", &rancher2.NamespaceArgs{
    	ProjectId: pulumi.String("string"),
    	Annotations: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	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.Map{
    		"string": pulumi.Any("any"),
    	},
    	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),
    })
    
    var namespaceResource = new Namespace("namespaceResource", NamespaceArgs.builder()
        .projectId("string")
        .annotations(Map.of("string", "any"))
        .containerResourceLimit(NamespaceContainerResourceLimitArgs.builder()
            .limitsCpu("string")
            .limitsMemory("string")
            .requestsCpu("string")
            .requestsMemory("string")
            .build())
        .description("string")
        .labels(Map.of("string", "any"))
        .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());
    
    namespace_resource = rancher2.Namespace("namespaceResource",
        project_id="string",
        annotations={
            "string": "any",
        },
        container_resource_limit=rancher2.NamespaceContainerResourceLimitArgs(
            limits_cpu="string",
            limits_memory="string",
            requests_cpu="string",
            requests_memory="string",
        ),
        description="string",
        labels={
            "string": "any",
        },
        name="string",
        resource_quota=rancher2.NamespaceResourceQuotaArgs(
            limit=rancher2.NamespaceResourceQuotaLimitArgs(
                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)
    
    const namespaceResource = new rancher2.Namespace("namespaceResource", {
        projectId: "string",
        annotations: {
            string: "any",
        },
        containerResourceLimit: {
            limitsCpu: "string",
            limitsMemory: "string",
            requestsCpu: "string",
            requestsMemory: "string",
        },
        description: "string",
        labels: {
            string: "any",
        },
        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,
    });
    
    type: rancher2:Namespace
    properties:
        annotations:
            string: any
        containerResourceLimit:
            limitsCpu: string
            limitsMemory: string
            requestsCpu: string
            requestsMemory: string
        description: string
        labels:
            string: any
        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
    

    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

    The Namespace resource accepts the following input properties:

    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)
    Annotations Dictionary<string, object>
    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, object>
    Labels for Node Pool object (map)
    Name 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 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]interface{}
    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]interface{}
    Labels for Node Pool object (map)
    Name 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 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,Object>
    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,Object>
    Labels for Node Pool object (map)
    name 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 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]: any}
    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]: any}
    Labels for Node Pool object (map)
    name 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 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, Any]
    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, Any]
    Labels for Node Pool object (map)
    name 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 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<Any>
    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<Any>
    Labels for Node Pool object (map)
    name 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, Any]] = None,
            container_resource_limit: Optional[NamespaceContainerResourceLimitArgs] = None,
            description: Optional[str] = None,
            labels: Optional[Mapping[str, Any]] = 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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, object>
    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, object>
    Labels for Node Pool object (map)
    Name 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]interface{}
    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]interface{}
    Labels for Node Pool object (map)
    Name 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,Object>
    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,Object>
    Labels for Node Pool object (map)
    name 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]: any}
    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]: any}
    Labels for Node Pool object (map)
    name 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, Any]
    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, Any]
    Labels for Node Pool object (map)
    name 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<Any>
    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<Any>
    Labels for Node Pool object (map)
    name 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

    NamespaceResourceQuota, NamespaceResourceQuotaArgs

    NamespaceResourceQuotaLimit, NamespaceResourceQuotaLimitArgs

    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;
    

    <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.
    rancher2 logo
    Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi