github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/node/v1/runtimeClass.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 v1
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod.  For more details, see https://kubernetes.io/docs/concepts/containers/runtime-class/
    16  type RuntimeClass struct {
    17  	pulumi.CustomResourceState
    18  
    19  	// 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
    20  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    21  	// handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration.  It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called "runc" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.
    22  	Handler pulumi.StringOutput `pulumi:"handler"`
    23  	// 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
    24  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    25  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    26  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    27  	// overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see
    28  	//  https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
    29  	Overhead OverheadPtrOutput `pulumi:"overhead"`
    30  	// scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.
    31  	Scheduling SchedulingPtrOutput `pulumi:"scheduling"`
    32  }
    33  
    34  // NewRuntimeClass registers a new resource with the given unique name, arguments, and options.
    35  func NewRuntimeClass(ctx *pulumi.Context,
    36  	name string, args *RuntimeClassArgs, opts ...pulumi.ResourceOption) (*RuntimeClass, error) {
    37  	if args == nil {
    38  		return nil, errors.New("missing one or more required arguments")
    39  	}
    40  
    41  	if args.Handler == nil {
    42  		return nil, errors.New("invalid value for required argument 'Handler'")
    43  	}
    44  	args.ApiVersion = pulumi.StringPtr("node.k8s.io/v1")
    45  	args.Kind = pulumi.StringPtr("RuntimeClass")
    46  	aliases := pulumi.Aliases([]pulumi.Alias{
    47  		{
    48  			Type: pulumi.String("kubernetes:node.k8s.io/v1alpha1:RuntimeClass"),
    49  		},
    50  		{
    51  			Type: pulumi.String("kubernetes:node.k8s.io/v1beta1:RuntimeClass"),
    52  		},
    53  	})
    54  	opts = append(opts, aliases)
    55  	var resource RuntimeClass
    56  	err := ctx.RegisterResource("kubernetes:node.k8s.io/v1:RuntimeClass", name, args, &resource, opts...)
    57  	if err != nil {
    58  		return nil, err
    59  	}
    60  	return &resource, nil
    61  }
    62  
    63  // GetRuntimeClass gets an existing RuntimeClass resource's state with the given name, ID, and optional
    64  // state properties that are used to uniquely qualify the lookup (nil if not required).
    65  func GetRuntimeClass(ctx *pulumi.Context,
    66  	name string, id pulumi.IDInput, state *RuntimeClassState, opts ...pulumi.ResourceOption) (*RuntimeClass, error) {
    67  	var resource RuntimeClass
    68  	err := ctx.ReadResource("kubernetes:node.k8s.io/v1:RuntimeClass", name, id, state, &resource, opts...)
    69  	if err != nil {
    70  		return nil, err
    71  	}
    72  	return &resource, nil
    73  }
    74  
    75  // Input properties used for looking up and filtering RuntimeClass resources.
    76  type runtimeClassState struct {
    77  }
    78  
    79  type RuntimeClassState struct {
    80  }
    81  
    82  func (RuntimeClassState) ElementType() reflect.Type {
    83  	return reflect.TypeOf((*runtimeClassState)(nil)).Elem()
    84  }
    85  
    86  type runtimeClassArgs struct {
    87  	// 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
    88  	ApiVersion *string `pulumi:"apiVersion"`
    89  	// handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration.  It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called "runc" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.
    90  	Handler string `pulumi:"handler"`
    91  	// 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
    92  	Kind *string `pulumi:"kind"`
    93  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    94  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    95  	// overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see
    96  	//  https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
    97  	Overhead *Overhead `pulumi:"overhead"`
    98  	// scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.
    99  	Scheduling *Scheduling `pulumi:"scheduling"`
   100  }
   101  
   102  // The set of arguments for constructing a RuntimeClass resource.
   103  type RuntimeClassArgs struct {
   104  	// 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
   105  	ApiVersion pulumi.StringPtrInput
   106  	// handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration.  It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called "runc" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.
   107  	Handler pulumi.StringInput
   108  	// 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
   109  	Kind pulumi.StringPtrInput
   110  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   111  	Metadata metav1.ObjectMetaPtrInput
   112  	// overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see
   113  	//  https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
   114  	Overhead OverheadPtrInput
   115  	// scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.
   116  	Scheduling SchedulingPtrInput
   117  }
   118  
   119  func (RuntimeClassArgs) ElementType() reflect.Type {
   120  	return reflect.TypeOf((*runtimeClassArgs)(nil)).Elem()
   121  }
   122  
   123  type RuntimeClassInput interface {
   124  	pulumi.Input
   125  
   126  	ToRuntimeClassOutput() RuntimeClassOutput
   127  	ToRuntimeClassOutputWithContext(ctx context.Context) RuntimeClassOutput
   128  }
   129  
   130  func (*RuntimeClass) ElementType() reflect.Type {
   131  	return reflect.TypeOf((**RuntimeClass)(nil)).Elem()
   132  }
   133  
   134  func (i *RuntimeClass) ToRuntimeClassOutput() RuntimeClassOutput {
   135  	return i.ToRuntimeClassOutputWithContext(context.Background())
   136  }
   137  
   138  func (i *RuntimeClass) ToRuntimeClassOutputWithContext(ctx context.Context) RuntimeClassOutput {
   139  	return pulumi.ToOutputWithContext(ctx, i).(RuntimeClassOutput)
   140  }
   141  
   142  // RuntimeClassArrayInput is an input type that accepts RuntimeClassArray and RuntimeClassArrayOutput values.
   143  // You can construct a concrete instance of `RuntimeClassArrayInput` via:
   144  //
   145  //	RuntimeClassArray{ RuntimeClassArgs{...} }
   146  type RuntimeClassArrayInput interface {
   147  	pulumi.Input
   148  
   149  	ToRuntimeClassArrayOutput() RuntimeClassArrayOutput
   150  	ToRuntimeClassArrayOutputWithContext(context.Context) RuntimeClassArrayOutput
   151  }
   152  
   153  type RuntimeClassArray []RuntimeClassInput
   154  
   155  func (RuntimeClassArray) ElementType() reflect.Type {
   156  	return reflect.TypeOf((*[]*RuntimeClass)(nil)).Elem()
   157  }
   158  
   159  func (i RuntimeClassArray) ToRuntimeClassArrayOutput() RuntimeClassArrayOutput {
   160  	return i.ToRuntimeClassArrayOutputWithContext(context.Background())
   161  }
   162  
   163  func (i RuntimeClassArray) ToRuntimeClassArrayOutputWithContext(ctx context.Context) RuntimeClassArrayOutput {
   164  	return pulumi.ToOutputWithContext(ctx, i).(RuntimeClassArrayOutput)
   165  }
   166  
   167  // RuntimeClassMapInput is an input type that accepts RuntimeClassMap and RuntimeClassMapOutput values.
   168  // You can construct a concrete instance of `RuntimeClassMapInput` via:
   169  //
   170  //	RuntimeClassMap{ "key": RuntimeClassArgs{...} }
   171  type RuntimeClassMapInput interface {
   172  	pulumi.Input
   173  
   174  	ToRuntimeClassMapOutput() RuntimeClassMapOutput
   175  	ToRuntimeClassMapOutputWithContext(context.Context) RuntimeClassMapOutput
   176  }
   177  
   178  type RuntimeClassMap map[string]RuntimeClassInput
   179  
   180  func (RuntimeClassMap) ElementType() reflect.Type {
   181  	return reflect.TypeOf((*map[string]*RuntimeClass)(nil)).Elem()
   182  }
   183  
   184  func (i RuntimeClassMap) ToRuntimeClassMapOutput() RuntimeClassMapOutput {
   185  	return i.ToRuntimeClassMapOutputWithContext(context.Background())
   186  }
   187  
   188  func (i RuntimeClassMap) ToRuntimeClassMapOutputWithContext(ctx context.Context) RuntimeClassMapOutput {
   189  	return pulumi.ToOutputWithContext(ctx, i).(RuntimeClassMapOutput)
   190  }
   191  
   192  type RuntimeClassOutput struct{ *pulumi.OutputState }
   193  
   194  func (RuntimeClassOutput) ElementType() reflect.Type {
   195  	return reflect.TypeOf((**RuntimeClass)(nil)).Elem()
   196  }
   197  
   198  func (o RuntimeClassOutput) ToRuntimeClassOutput() RuntimeClassOutput {
   199  	return o
   200  }
   201  
   202  func (o RuntimeClassOutput) ToRuntimeClassOutputWithContext(ctx context.Context) RuntimeClassOutput {
   203  	return o
   204  }
   205  
   206  // 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
   207  func (o RuntimeClassOutput) ApiVersion() pulumi.StringPtrOutput {
   208  	return o.ApplyT(func(v *RuntimeClass) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   209  }
   210  
   211  // handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration.  It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called "runc" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.
   212  func (o RuntimeClassOutput) Handler() pulumi.StringOutput {
   213  	return o.ApplyT(func(v *RuntimeClass) pulumi.StringOutput { return v.Handler }).(pulumi.StringOutput)
   214  }
   215  
   216  // 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
   217  func (o RuntimeClassOutput) Kind() pulumi.StringPtrOutput {
   218  	return o.ApplyT(func(v *RuntimeClass) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   219  }
   220  
   221  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   222  func (o RuntimeClassOutput) Metadata() metav1.ObjectMetaPtrOutput {
   223  	return o.ApplyT(func(v *RuntimeClass) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   224  }
   225  
   226  // overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see
   227  //
   228  //	https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
   229  func (o RuntimeClassOutput) Overhead() OverheadPtrOutput {
   230  	return o.ApplyT(func(v *RuntimeClass) OverheadPtrOutput { return v.Overhead }).(OverheadPtrOutput)
   231  }
   232  
   233  // scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.
   234  func (o RuntimeClassOutput) Scheduling() SchedulingPtrOutput {
   235  	return o.ApplyT(func(v *RuntimeClass) SchedulingPtrOutput { return v.Scheduling }).(SchedulingPtrOutput)
   236  }
   237  
   238  type RuntimeClassArrayOutput struct{ *pulumi.OutputState }
   239  
   240  func (RuntimeClassArrayOutput) ElementType() reflect.Type {
   241  	return reflect.TypeOf((*[]*RuntimeClass)(nil)).Elem()
   242  }
   243  
   244  func (o RuntimeClassArrayOutput) ToRuntimeClassArrayOutput() RuntimeClassArrayOutput {
   245  	return o
   246  }
   247  
   248  func (o RuntimeClassArrayOutput) ToRuntimeClassArrayOutputWithContext(ctx context.Context) RuntimeClassArrayOutput {
   249  	return o
   250  }
   251  
   252  func (o RuntimeClassArrayOutput) Index(i pulumi.IntInput) RuntimeClassOutput {
   253  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RuntimeClass {
   254  		return vs[0].([]*RuntimeClass)[vs[1].(int)]
   255  	}).(RuntimeClassOutput)
   256  }
   257  
   258  type RuntimeClassMapOutput struct{ *pulumi.OutputState }
   259  
   260  func (RuntimeClassMapOutput) ElementType() reflect.Type {
   261  	return reflect.TypeOf((*map[string]*RuntimeClass)(nil)).Elem()
   262  }
   263  
   264  func (o RuntimeClassMapOutput) ToRuntimeClassMapOutput() RuntimeClassMapOutput {
   265  	return o
   266  }
   267  
   268  func (o RuntimeClassMapOutput) ToRuntimeClassMapOutputWithContext(ctx context.Context) RuntimeClassMapOutput {
   269  	return o
   270  }
   271  
   272  func (o RuntimeClassMapOutput) MapIndex(k pulumi.StringInput) RuntimeClassOutput {
   273  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RuntimeClass {
   274  		return vs[0].(map[string]*RuntimeClass)[vs[1].(string)]
   275  	}).(RuntimeClassOutput)
   276  }
   277  
   278  func init() {
   279  	pulumi.RegisterInputType(reflect.TypeOf((*RuntimeClassInput)(nil)).Elem(), &RuntimeClass{})
   280  	pulumi.RegisterInputType(reflect.TypeOf((*RuntimeClassArrayInput)(nil)).Elem(), RuntimeClassArray{})
   281  	pulumi.RegisterInputType(reflect.TypeOf((*RuntimeClassMapInput)(nil)).Elem(), RuntimeClassMap{})
   282  	pulumi.RegisterOutputType(RuntimeClassOutput{})
   283  	pulumi.RegisterOutputType(RuntimeClassArrayOutput{})
   284  	pulumi.RegisterOutputType(RuntimeClassMapOutput{})
   285  }