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