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",
},
});
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",
})
package main
import (
"github.com/pulumi/pulumi-rancher2/sdk/v7/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={
"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",
})
package main
import (
"github.com/pulumi/pulumi-rancher2/sdk/v7/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, 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 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", "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,
});
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),
})
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());
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)
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,
});
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
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:
- Project
Id 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)
- Container
Resource NamespaceLimit Container Resource Limit - 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 string
- The name of the namespace (string)
- Resource
Quota NamespaceResource Quota - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- Wait
For boolCluster - Wait for cluster becomes active. Default
false
(bool)
- Project
Id 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)
- Container
Resource NamespaceLimit Container Resource Limit Args - 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 string
- The name of the namespace (string)
- Resource
Quota NamespaceResource Quota Args - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- Wait
For boolCluster - Wait for cluster becomes active. Default
false
(bool)
- project
Id 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)
- container
Resource NamespaceLimit Container Resource Limit - 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 String
- The name of the namespace (string)
- resource
Quota NamespaceResource Quota - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait
For BooleanCluster - Wait for cluster becomes active. Default
false
(bool)
- project
Id 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)
- container
Resource NamespaceLimit Container Resource Limit - 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 string
- The name of the namespace (string)
- resource
Quota NamespaceResource Quota - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait
For booleanCluster - 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, str]
- Annotations for Node Pool object (map)
- container_
resource_ Namespacelimit Container Resource Limit Args - 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 str
- The name of the namespace (string)
- resource_
quota NamespaceResource Quota Args - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait_
for_ boolcluster - Wait for cluster becomes active. Default
false
(bool)
- project
Id 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)
- container
Resource Property MapLimit - 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 String
- The name of the namespace (string)
- resource
Quota Property Map - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait
For BooleanCluster - 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)
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.
- Annotations Dictionary<string, string>
- Annotations for Node Pool object (map)
- Container
Resource NamespaceLimit Container Resource Limit - 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 string
- The name of the namespace (string)
- Project
Id 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) - Resource
Quota NamespaceResource Quota - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- Wait
For boolCluster - Wait for cluster becomes active. Default
false
(bool)
- Annotations map[string]string
- Annotations for Node Pool object (map)
- Container
Resource NamespaceLimit Container Resource Limit Args - 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 string
- The name of the namespace (string)
- Project
Id 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) - Resource
Quota NamespaceResource Quota Args - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- Wait
For boolCluster - Wait for cluster becomes active. Default
false
(bool)
- annotations Map<String,String>
- Annotations for Node Pool object (map)
- container
Resource NamespaceLimit Container Resource Limit - 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 String
- The name of the namespace (string)
- project
Id 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) - resource
Quota NamespaceResource Quota - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait
For BooleanCluster - Wait for cluster becomes active. Default
false
(bool)
- annotations {[key: string]: string}
- Annotations for Node Pool object (map)
- container
Resource NamespaceLimit Container Resource Limit - 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 string
- The name of the namespace (string)
- project
Id 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) - resource
Quota NamespaceResource Quota - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait
For booleanCluster - Wait for cluster becomes active. Default
false
(bool)
- annotations Mapping[str, str]
- Annotations for Node Pool object (map)
- container_
resource_ Namespacelimit Container Resource Limit Args - 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 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 NamespaceResource Quota Args - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait_
for_ boolcluster - Wait for cluster becomes active. Default
false
(bool)
- annotations Map<String>
- Annotations for Node Pool object (map)
- container
Resource Property MapLimit - 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 String
- The name of the namespace (string)
- project
Id 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) - resource
Quota Property Map - Resource quota for namespace. Rancher v2.1.x or higher (list maxitems:1)
- wait
For BooleanCluster - Wait for cluster becomes active. Default
false
(bool)
Supporting Types
NamespaceContainerResourceLimit, NamespaceContainerResourceLimitArgs
- Limits
Cpu string - Limit for limits cpu in namespace (string)
- Limits
Memory string - Limit for limits memory in namespace (string)
- Requests
Cpu string - Limit for requests cpu in namespace (string)
- Requests
Memory string - Limit for requests memory in namespace (string)
- Limits
Cpu string - Limit for limits cpu in namespace (string)
- Limits
Memory string - Limit for limits memory in namespace (string)
- Requests
Cpu string - Limit for requests cpu in namespace (string)
- Requests
Memory string - Limit for requests memory in namespace (string)
- limits
Cpu String - Limit for limits cpu in namespace (string)
- limits
Memory String - Limit for limits memory in namespace (string)
- requests
Cpu String - Limit for requests cpu in namespace (string)
- requests
Memory String - Limit for requests memory in namespace (string)
- limits
Cpu string - Limit for limits cpu in namespace (string)
- limits
Memory string - Limit for limits memory in namespace (string)
- requests
Cpu string - Limit for requests cpu in namespace (string)
- requests
Memory 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)
- limits
Cpu String - Limit for limits cpu in namespace (string)
- limits
Memory String - Limit for limits memory in namespace (string)
- requests
Cpu String - Limit for requests cpu in namespace (string)
- requests
Memory String - Limit for requests memory in namespace (string)
NamespaceResourceQuota, NamespaceResourceQuotaArgs
- Limit
Namespace
Resource Quota Limit - Resource quota limit for namespace (list maxitems:1)
- Limit
Namespace
Resource Quota Limit - Resource quota limit for namespace (list maxitems:1)
- limit
Namespace
Resource Quota Limit - Resource quota limit for namespace (list maxitems:1)
- limit
Namespace
Resource Quota Limit - Resource quota limit for namespace (list maxitems:1)
- limit
Namespace
Resource Quota Limit - Resource quota limit for namespace (list maxitems:1)
- limit Property Map
- Resource quota limit for namespace (list maxitems:1)
NamespaceResourceQuotaLimit, NamespaceResourceQuotaLimitArgs
- Config
Maps string - Limit for config maps in namespace (string)
- Limits
Cpu string - Limit for limits cpu in namespace (string)
- Limits
Memory string - Limit for limits memory in namespace (string)
- Persistent
Volume stringClaims - Limit for persistent volume claims in namespace (string)
- Pods string
- Limit for pods in namespace (string)
- Replication
Controllers string - Limit for replication controllers in namespace (string)
- Requests
Cpu string - Limit for requests cpu in namespace (string)
- Requests
Memory string - Limit for requests memory in namespace (string)
- Requests
Storage string - Limit for requests storage in namespace (string)
- Secrets string
- Limit for secrets in namespace (string)
- Services string
- Services
Load stringBalancers - Limit for services load balancers in namespace (string)
- Services
Node stringPorts Limit for services node ports in namespace (string)
More info at resource-quotas
- Config
Maps string - Limit for config maps in namespace (string)
- Limits
Cpu string - Limit for limits cpu in namespace (string)
- Limits
Memory string - Limit for limits memory in namespace (string)
- Persistent
Volume stringClaims - Limit for persistent volume claims in namespace (string)
- Pods string
- Limit for pods in namespace (string)
- Replication
Controllers string - Limit for replication controllers in namespace (string)
- Requests
Cpu string - Limit for requests cpu in namespace (string)
- Requests
Memory string - Limit for requests memory in namespace (string)
- Requests
Storage string - Limit for requests storage in namespace (string)
- Secrets string
- Limit for secrets in namespace (string)
- Services string
- Services
Load stringBalancers - Limit for services load balancers in namespace (string)
- Services
Node stringPorts Limit for services node ports in namespace (string)
More info at resource-quotas
- config
Maps String - Limit for config maps in namespace (string)
- limits
Cpu String - Limit for limits cpu in namespace (string)
- limits
Memory String - Limit for limits memory in namespace (string)
- persistent
Volume StringClaims - Limit for persistent volume claims in namespace (string)
- pods String
- Limit for pods in namespace (string)
- replication
Controllers String - Limit for replication controllers in namespace (string)
- requests
Cpu String - Limit for requests cpu in namespace (string)
- requests
Memory String - Limit for requests memory in namespace (string)
- requests
Storage String - Limit for requests storage in namespace (string)
- secrets String
- Limit for secrets in namespace (string)
- services String
- services
Load StringBalancers - Limit for services load balancers in namespace (string)
- services
Node StringPorts Limit for services node ports in namespace (string)
More info at resource-quotas
- config
Maps string - Limit for config maps in namespace (string)
- limits
Cpu string - Limit for limits cpu in namespace (string)
- limits
Memory string - Limit for limits memory in namespace (string)
- persistent
Volume stringClaims - Limit for persistent volume claims in namespace (string)
- pods string
- Limit for pods in namespace (string)
- replication
Controllers string - Limit for replication controllers in namespace (string)
- requests
Cpu string - Limit for requests cpu in namespace (string)
- requests
Memory string - Limit for requests memory in namespace (string)
- requests
Storage string - Limit for requests storage in namespace (string)
- secrets string
- Limit for secrets in namespace (string)
- services string
- services
Load stringBalancers - Limit for services load balancers in namespace (string)
- services
Node stringPorts 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_ strclaims - 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_ strbalancers - Limit for services load balancers in namespace (string)
- services_
node_ strports Limit for services node ports in namespace (string)
More info at resource-quotas
- config
Maps String - Limit for config maps in namespace (string)
- limits
Cpu String - Limit for limits cpu in namespace (string)
- limits
Memory String - Limit for limits memory in namespace (string)
- persistent
Volume StringClaims - Limit for persistent volume claims in namespace (string)
- pods String
- Limit for pods in namespace (string)
- replication
Controllers String - Limit for replication controllers in namespace (string)
- requests
Cpu String - Limit for requests cpu in namespace (string)
- requests
Memory String - Limit for requests memory in namespace (string)
- requests
Storage String - Limit for requests storage in namespace (string)
- secrets String
- Limit for secrets in namespace (string)
- services String
- services
Load StringBalancers - Limit for services load balancers in namespace (string)
- services
Node StringPorts 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 <project_id>.<namespaces_id>
<project_id>
is in the format <cluster_id>:<id>
, but
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 samecluster_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.