github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/networking/v1alpha1/clusterCIDR.go (about)

     1  // Code generated by pulumigen DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package v1alpha1
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // ClusterCIDR represents a single configuration for per-Node Pod CIDR allocations when the MultiCIDRRangeAllocator is enabled (see the config for kube-controller-manager).  A cluster may have any number of ClusterCIDR resources, all of which will be considered when allocating a CIDR for a Node.  A ClusterCIDR is eligible to be used for a given Node when the node selector matches the node in question and has free CIDRs to allocate.  In case of multiple matching ClusterCIDR resources, the allocator will attempt to break ties using internal heuristics, but any ClusterCIDR whose node selector matches the Node may be used.
    15  type ClusterCIDR struct {
    16  	pulumi.CustomResourceState
    17  
    18  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    19  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    20  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    21  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    22  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    23  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    24  	// spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    25  	Spec ClusterCIDRSpecPtrOutput `pulumi:"spec"`
    26  }
    27  
    28  // NewClusterCIDR registers a new resource with the given unique name, arguments, and options.
    29  func NewClusterCIDR(ctx *pulumi.Context,
    30  	name string, args *ClusterCIDRArgs, opts ...pulumi.ResourceOption) (*ClusterCIDR, error) {
    31  	if args == nil {
    32  		args = &ClusterCIDRArgs{}
    33  	}
    34  
    35  	args.ApiVersion = pulumi.StringPtr("networking.k8s.io/v1alpha1")
    36  	args.Kind = pulumi.StringPtr("ClusterCIDR")
    37  	var resource ClusterCIDR
    38  	err := ctx.RegisterResource("kubernetes:networking.k8s.io/v1alpha1:ClusterCIDR", name, args, &resource, opts...)
    39  	if err != nil {
    40  		return nil, err
    41  	}
    42  	return &resource, nil
    43  }
    44  
    45  // GetClusterCIDR gets an existing ClusterCIDR resource's state with the given name, ID, and optional
    46  // state properties that are used to uniquely qualify the lookup (nil if not required).
    47  func GetClusterCIDR(ctx *pulumi.Context,
    48  	name string, id pulumi.IDInput, state *ClusterCIDRState, opts ...pulumi.ResourceOption) (*ClusterCIDR, error) {
    49  	var resource ClusterCIDR
    50  	err := ctx.ReadResource("kubernetes:networking.k8s.io/v1alpha1:ClusterCIDR", name, id, state, &resource, opts...)
    51  	if err != nil {
    52  		return nil, err
    53  	}
    54  	return &resource, nil
    55  }
    56  
    57  // Input properties used for looking up and filtering ClusterCIDR resources.
    58  type clusterCIDRState struct {
    59  }
    60  
    61  type ClusterCIDRState struct {
    62  }
    63  
    64  func (ClusterCIDRState) ElementType() reflect.Type {
    65  	return reflect.TypeOf((*clusterCIDRState)(nil)).Elem()
    66  }
    67  
    68  type clusterCIDRArgs struct {
    69  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    70  	ApiVersion *string `pulumi:"apiVersion"`
    71  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    72  	Kind *string `pulumi:"kind"`
    73  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    74  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    75  	// spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    76  	Spec *ClusterCIDRSpec `pulumi:"spec"`
    77  }
    78  
    79  // The set of arguments for constructing a ClusterCIDR resource.
    80  type ClusterCIDRArgs struct {
    81  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    82  	ApiVersion pulumi.StringPtrInput
    83  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    84  	Kind pulumi.StringPtrInput
    85  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    86  	Metadata metav1.ObjectMetaPtrInput
    87  	// spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    88  	Spec ClusterCIDRSpecPtrInput
    89  }
    90  
    91  func (ClusterCIDRArgs) ElementType() reflect.Type {
    92  	return reflect.TypeOf((*clusterCIDRArgs)(nil)).Elem()
    93  }
    94  
    95  type ClusterCIDRInput interface {
    96  	pulumi.Input
    97  
    98  	ToClusterCIDROutput() ClusterCIDROutput
    99  	ToClusterCIDROutputWithContext(ctx context.Context) ClusterCIDROutput
   100  }
   101  
   102  func (*ClusterCIDR) ElementType() reflect.Type {
   103  	return reflect.TypeOf((**ClusterCIDR)(nil)).Elem()
   104  }
   105  
   106  func (i *ClusterCIDR) ToClusterCIDROutput() ClusterCIDROutput {
   107  	return i.ToClusterCIDROutputWithContext(context.Background())
   108  }
   109  
   110  func (i *ClusterCIDR) ToClusterCIDROutputWithContext(ctx context.Context) ClusterCIDROutput {
   111  	return pulumi.ToOutputWithContext(ctx, i).(ClusterCIDROutput)
   112  }
   113  
   114  // ClusterCIDRArrayInput is an input type that accepts ClusterCIDRArray and ClusterCIDRArrayOutput values.
   115  // You can construct a concrete instance of `ClusterCIDRArrayInput` via:
   116  //
   117  //	ClusterCIDRArray{ ClusterCIDRArgs{...} }
   118  type ClusterCIDRArrayInput interface {
   119  	pulumi.Input
   120  
   121  	ToClusterCIDRArrayOutput() ClusterCIDRArrayOutput
   122  	ToClusterCIDRArrayOutputWithContext(context.Context) ClusterCIDRArrayOutput
   123  }
   124  
   125  type ClusterCIDRArray []ClusterCIDRInput
   126  
   127  func (ClusterCIDRArray) ElementType() reflect.Type {
   128  	return reflect.TypeOf((*[]*ClusterCIDR)(nil)).Elem()
   129  }
   130  
   131  func (i ClusterCIDRArray) ToClusterCIDRArrayOutput() ClusterCIDRArrayOutput {
   132  	return i.ToClusterCIDRArrayOutputWithContext(context.Background())
   133  }
   134  
   135  func (i ClusterCIDRArray) ToClusterCIDRArrayOutputWithContext(ctx context.Context) ClusterCIDRArrayOutput {
   136  	return pulumi.ToOutputWithContext(ctx, i).(ClusterCIDRArrayOutput)
   137  }
   138  
   139  // ClusterCIDRMapInput is an input type that accepts ClusterCIDRMap and ClusterCIDRMapOutput values.
   140  // You can construct a concrete instance of `ClusterCIDRMapInput` via:
   141  //
   142  //	ClusterCIDRMap{ "key": ClusterCIDRArgs{...} }
   143  type ClusterCIDRMapInput interface {
   144  	pulumi.Input
   145  
   146  	ToClusterCIDRMapOutput() ClusterCIDRMapOutput
   147  	ToClusterCIDRMapOutputWithContext(context.Context) ClusterCIDRMapOutput
   148  }
   149  
   150  type ClusterCIDRMap map[string]ClusterCIDRInput
   151  
   152  func (ClusterCIDRMap) ElementType() reflect.Type {
   153  	return reflect.TypeOf((*map[string]*ClusterCIDR)(nil)).Elem()
   154  }
   155  
   156  func (i ClusterCIDRMap) ToClusterCIDRMapOutput() ClusterCIDRMapOutput {
   157  	return i.ToClusterCIDRMapOutputWithContext(context.Background())
   158  }
   159  
   160  func (i ClusterCIDRMap) ToClusterCIDRMapOutputWithContext(ctx context.Context) ClusterCIDRMapOutput {
   161  	return pulumi.ToOutputWithContext(ctx, i).(ClusterCIDRMapOutput)
   162  }
   163  
   164  type ClusterCIDROutput struct{ *pulumi.OutputState }
   165  
   166  func (ClusterCIDROutput) ElementType() reflect.Type {
   167  	return reflect.TypeOf((**ClusterCIDR)(nil)).Elem()
   168  }
   169  
   170  func (o ClusterCIDROutput) ToClusterCIDROutput() ClusterCIDROutput {
   171  	return o
   172  }
   173  
   174  func (o ClusterCIDROutput) ToClusterCIDROutputWithContext(ctx context.Context) ClusterCIDROutput {
   175  	return o
   176  }
   177  
   178  // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
   179  func (o ClusterCIDROutput) ApiVersion() pulumi.StringPtrOutput {
   180  	return o.ApplyT(func(v *ClusterCIDR) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   181  }
   182  
   183  // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
   184  func (o ClusterCIDROutput) Kind() pulumi.StringPtrOutput {
   185  	return o.ApplyT(func(v *ClusterCIDR) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   186  }
   187  
   188  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   189  func (o ClusterCIDROutput) Metadata() metav1.ObjectMetaPtrOutput {
   190  	return o.ApplyT(func(v *ClusterCIDR) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   191  }
   192  
   193  // spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   194  func (o ClusterCIDROutput) Spec() ClusterCIDRSpecPtrOutput {
   195  	return o.ApplyT(func(v *ClusterCIDR) ClusterCIDRSpecPtrOutput { return v.Spec }).(ClusterCIDRSpecPtrOutput)
   196  }
   197  
   198  type ClusterCIDRArrayOutput struct{ *pulumi.OutputState }
   199  
   200  func (ClusterCIDRArrayOutput) ElementType() reflect.Type {
   201  	return reflect.TypeOf((*[]*ClusterCIDR)(nil)).Elem()
   202  }
   203  
   204  func (o ClusterCIDRArrayOutput) ToClusterCIDRArrayOutput() ClusterCIDRArrayOutput {
   205  	return o
   206  }
   207  
   208  func (o ClusterCIDRArrayOutput) ToClusterCIDRArrayOutputWithContext(ctx context.Context) ClusterCIDRArrayOutput {
   209  	return o
   210  }
   211  
   212  func (o ClusterCIDRArrayOutput) Index(i pulumi.IntInput) ClusterCIDROutput {
   213  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterCIDR {
   214  		return vs[0].([]*ClusterCIDR)[vs[1].(int)]
   215  	}).(ClusterCIDROutput)
   216  }
   217  
   218  type ClusterCIDRMapOutput struct{ *pulumi.OutputState }
   219  
   220  func (ClusterCIDRMapOutput) ElementType() reflect.Type {
   221  	return reflect.TypeOf((*map[string]*ClusterCIDR)(nil)).Elem()
   222  }
   223  
   224  func (o ClusterCIDRMapOutput) ToClusterCIDRMapOutput() ClusterCIDRMapOutput {
   225  	return o
   226  }
   227  
   228  func (o ClusterCIDRMapOutput) ToClusterCIDRMapOutputWithContext(ctx context.Context) ClusterCIDRMapOutput {
   229  	return o
   230  }
   231  
   232  func (o ClusterCIDRMapOutput) MapIndex(k pulumi.StringInput) ClusterCIDROutput {
   233  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterCIDR {
   234  		return vs[0].(map[string]*ClusterCIDR)[vs[1].(string)]
   235  	}).(ClusterCIDROutput)
   236  }
   237  
   238  func init() {
   239  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterCIDRInput)(nil)).Elem(), &ClusterCIDR{})
   240  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterCIDRArrayInput)(nil)).Elem(), ClusterCIDRArray{})
   241  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterCIDRMapInput)(nil)).Elem(), ClusterCIDRMap{})
   242  	pulumi.RegisterOutputType(ClusterCIDROutput{})
   243  	pulumi.RegisterOutputType(ClusterCIDRArrayOutput{})
   244  	pulumi.RegisterOutputType(ClusterCIDRMapOutput{})
   245  }