github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apps/v1beta1/statefulSet.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  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // StatefulSet represents a set of pods with consistent identities. Identities are defined as:
    15  //   - Network: A single stable DNS and hostname.
    16  //   - Storage: As many VolumeClaims as requested.
    17  //     The StatefulSet guarantees that a given network identity will always map to the same storage identity.
    18  //
    19  // This resource waits until its status is ready before registering success
    20  // for create/update, and populating output properties from the current state of the resource.
    21  // The following conditions are used to determine whether the resource creation has
    22  // succeeded or failed:
    23  //
    24  //  1. The value of 'spec.replicas' matches '.status.replicas', '.status.currentReplicas',
    25  //     and '.status.readyReplicas'.
    26  //  2. The value of '.status.updateRevision' matches '.status.currentRevision'.
    27  //
    28  // If the StatefulSet has not reached a Ready state after 10 minutes, it will
    29  // time out and mark the resource update as Failed. You can override the default timeout value
    30  // by setting the 'customTimeouts' option on the resource.
    31  //
    32  // Deprecated: apps/v1beta1/StatefulSet is deprecated by apps/v1/StatefulSet and not supported by Kubernetes v1.16+ clusters.
    33  type StatefulSet struct {
    34  	pulumi.CustomResourceState
    35  
    36  	// 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
    37  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    38  	// 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
    39  	Kind     pulumi.StringPtrOutput     `pulumi:"kind"`
    40  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    41  	// Spec defines the desired identities of pods in this set.
    42  	Spec StatefulSetSpecPtrOutput `pulumi:"spec"`
    43  	// Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time.
    44  	Status StatefulSetStatusPtrOutput `pulumi:"status"`
    45  }
    46  
    47  // NewStatefulSet registers a new resource with the given unique name, arguments, and options.
    48  func NewStatefulSet(ctx *pulumi.Context,
    49  	name string, args *StatefulSetArgs, opts ...pulumi.ResourceOption) (*StatefulSet, error) {
    50  	if args == nil {
    51  		args = &StatefulSetArgs{}
    52  	}
    53  
    54  	args.ApiVersion = pulumi.StringPtr("apps/v1beta1")
    55  	args.Kind = pulumi.StringPtr("StatefulSet")
    56  	aliases := pulumi.Aliases([]pulumi.Alias{
    57  		{
    58  			Type: pulumi.String("kubernetes:apps/v1:StatefulSet"),
    59  		},
    60  		{
    61  			Type: pulumi.String("kubernetes:apps/v1beta2:StatefulSet"),
    62  		},
    63  	})
    64  	opts = append(opts, aliases)
    65  	var resource StatefulSet
    66  	err := ctx.RegisterResource("kubernetes:apps/v1beta1:StatefulSet", name, args, &resource, opts...)
    67  	if err != nil {
    68  		return nil, err
    69  	}
    70  	return &resource, nil
    71  }
    72  
    73  // GetStatefulSet gets an existing StatefulSet resource's state with the given name, ID, and optional
    74  // state properties that are used to uniquely qualify the lookup (nil if not required).
    75  func GetStatefulSet(ctx *pulumi.Context,
    76  	name string, id pulumi.IDInput, state *StatefulSetState, opts ...pulumi.ResourceOption) (*StatefulSet, error) {
    77  	var resource StatefulSet
    78  	err := ctx.ReadResource("kubernetes:apps/v1beta1:StatefulSet", name, id, state, &resource, opts...)
    79  	if err != nil {
    80  		return nil, err
    81  	}
    82  	return &resource, nil
    83  }
    84  
    85  // Input properties used for looking up and filtering StatefulSet resources.
    86  type statefulSetState struct {
    87  }
    88  
    89  type StatefulSetState struct {
    90  }
    91  
    92  func (StatefulSetState) ElementType() reflect.Type {
    93  	return reflect.TypeOf((*statefulSetState)(nil)).Elem()
    94  }
    95  
    96  type statefulSetArgs struct {
    97  	// 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
    98  	ApiVersion *string `pulumi:"apiVersion"`
    99  	// 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
   100  	Kind     *string            `pulumi:"kind"`
   101  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
   102  	// Spec defines the desired identities of pods in this set.
   103  	Spec *StatefulSetSpec `pulumi:"spec"`
   104  }
   105  
   106  // The set of arguments for constructing a StatefulSet resource.
   107  type StatefulSetArgs struct {
   108  	// 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
   109  	ApiVersion pulumi.StringPtrInput
   110  	// 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
   111  	Kind     pulumi.StringPtrInput
   112  	Metadata metav1.ObjectMetaPtrInput
   113  	// Spec defines the desired identities of pods in this set.
   114  	Spec StatefulSetSpecPtrInput
   115  }
   116  
   117  func (StatefulSetArgs) ElementType() reflect.Type {
   118  	return reflect.TypeOf((*statefulSetArgs)(nil)).Elem()
   119  }
   120  
   121  type StatefulSetInput interface {
   122  	pulumi.Input
   123  
   124  	ToStatefulSetOutput() StatefulSetOutput
   125  	ToStatefulSetOutputWithContext(ctx context.Context) StatefulSetOutput
   126  }
   127  
   128  func (*StatefulSet) ElementType() reflect.Type {
   129  	return reflect.TypeOf((**StatefulSet)(nil)).Elem()
   130  }
   131  
   132  func (i *StatefulSet) ToStatefulSetOutput() StatefulSetOutput {
   133  	return i.ToStatefulSetOutputWithContext(context.Background())
   134  }
   135  
   136  func (i *StatefulSet) ToStatefulSetOutputWithContext(ctx context.Context) StatefulSetOutput {
   137  	return pulumi.ToOutputWithContext(ctx, i).(StatefulSetOutput)
   138  }
   139  
   140  // StatefulSetArrayInput is an input type that accepts StatefulSetArray and StatefulSetArrayOutput values.
   141  // You can construct a concrete instance of `StatefulSetArrayInput` via:
   142  //
   143  //	StatefulSetArray{ StatefulSetArgs{...} }
   144  type StatefulSetArrayInput interface {
   145  	pulumi.Input
   146  
   147  	ToStatefulSetArrayOutput() StatefulSetArrayOutput
   148  	ToStatefulSetArrayOutputWithContext(context.Context) StatefulSetArrayOutput
   149  }
   150  
   151  type StatefulSetArray []StatefulSetInput
   152  
   153  func (StatefulSetArray) ElementType() reflect.Type {
   154  	return reflect.TypeOf((*[]*StatefulSet)(nil)).Elem()
   155  }
   156  
   157  func (i StatefulSetArray) ToStatefulSetArrayOutput() StatefulSetArrayOutput {
   158  	return i.ToStatefulSetArrayOutputWithContext(context.Background())
   159  }
   160  
   161  func (i StatefulSetArray) ToStatefulSetArrayOutputWithContext(ctx context.Context) StatefulSetArrayOutput {
   162  	return pulumi.ToOutputWithContext(ctx, i).(StatefulSetArrayOutput)
   163  }
   164  
   165  // StatefulSetMapInput is an input type that accepts StatefulSetMap and StatefulSetMapOutput values.
   166  // You can construct a concrete instance of `StatefulSetMapInput` via:
   167  //
   168  //	StatefulSetMap{ "key": StatefulSetArgs{...} }
   169  type StatefulSetMapInput interface {
   170  	pulumi.Input
   171  
   172  	ToStatefulSetMapOutput() StatefulSetMapOutput
   173  	ToStatefulSetMapOutputWithContext(context.Context) StatefulSetMapOutput
   174  }
   175  
   176  type StatefulSetMap map[string]StatefulSetInput
   177  
   178  func (StatefulSetMap) ElementType() reflect.Type {
   179  	return reflect.TypeOf((*map[string]*StatefulSet)(nil)).Elem()
   180  }
   181  
   182  func (i StatefulSetMap) ToStatefulSetMapOutput() StatefulSetMapOutput {
   183  	return i.ToStatefulSetMapOutputWithContext(context.Background())
   184  }
   185  
   186  func (i StatefulSetMap) ToStatefulSetMapOutputWithContext(ctx context.Context) StatefulSetMapOutput {
   187  	return pulumi.ToOutputWithContext(ctx, i).(StatefulSetMapOutput)
   188  }
   189  
   190  type StatefulSetOutput struct{ *pulumi.OutputState }
   191  
   192  func (StatefulSetOutput) ElementType() reflect.Type {
   193  	return reflect.TypeOf((**StatefulSet)(nil)).Elem()
   194  }
   195  
   196  func (o StatefulSetOutput) ToStatefulSetOutput() StatefulSetOutput {
   197  	return o
   198  }
   199  
   200  func (o StatefulSetOutput) ToStatefulSetOutputWithContext(ctx context.Context) StatefulSetOutput {
   201  	return o
   202  }
   203  
   204  // 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
   205  func (o StatefulSetOutput) ApiVersion() pulumi.StringPtrOutput {
   206  	return o.ApplyT(func(v *StatefulSet) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   207  }
   208  
   209  // 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
   210  func (o StatefulSetOutput) Kind() pulumi.StringPtrOutput {
   211  	return o.ApplyT(func(v *StatefulSet) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   212  }
   213  
   214  func (o StatefulSetOutput) Metadata() metav1.ObjectMetaPtrOutput {
   215  	return o.ApplyT(func(v *StatefulSet) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   216  }
   217  
   218  // Spec defines the desired identities of pods in this set.
   219  func (o StatefulSetOutput) Spec() StatefulSetSpecPtrOutput {
   220  	return o.ApplyT(func(v *StatefulSet) StatefulSetSpecPtrOutput { return v.Spec }).(StatefulSetSpecPtrOutput)
   221  }
   222  
   223  // Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time.
   224  func (o StatefulSetOutput) Status() StatefulSetStatusPtrOutput {
   225  	return o.ApplyT(func(v *StatefulSet) StatefulSetStatusPtrOutput { return v.Status }).(StatefulSetStatusPtrOutput)
   226  }
   227  
   228  type StatefulSetArrayOutput struct{ *pulumi.OutputState }
   229  
   230  func (StatefulSetArrayOutput) ElementType() reflect.Type {
   231  	return reflect.TypeOf((*[]*StatefulSet)(nil)).Elem()
   232  }
   233  
   234  func (o StatefulSetArrayOutput) ToStatefulSetArrayOutput() StatefulSetArrayOutput {
   235  	return o
   236  }
   237  
   238  func (o StatefulSetArrayOutput) ToStatefulSetArrayOutputWithContext(ctx context.Context) StatefulSetArrayOutput {
   239  	return o
   240  }
   241  
   242  func (o StatefulSetArrayOutput) Index(i pulumi.IntInput) StatefulSetOutput {
   243  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StatefulSet {
   244  		return vs[0].([]*StatefulSet)[vs[1].(int)]
   245  	}).(StatefulSetOutput)
   246  }
   247  
   248  type StatefulSetMapOutput struct{ *pulumi.OutputState }
   249  
   250  func (StatefulSetMapOutput) ElementType() reflect.Type {
   251  	return reflect.TypeOf((*map[string]*StatefulSet)(nil)).Elem()
   252  }
   253  
   254  func (o StatefulSetMapOutput) ToStatefulSetMapOutput() StatefulSetMapOutput {
   255  	return o
   256  }
   257  
   258  func (o StatefulSetMapOutput) ToStatefulSetMapOutputWithContext(ctx context.Context) StatefulSetMapOutput {
   259  	return o
   260  }
   261  
   262  func (o StatefulSetMapOutput) MapIndex(k pulumi.StringInput) StatefulSetOutput {
   263  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StatefulSet {
   264  		return vs[0].(map[string]*StatefulSet)[vs[1].(string)]
   265  	}).(StatefulSetOutput)
   266  }
   267  
   268  func init() {
   269  	pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetInput)(nil)).Elem(), &StatefulSet{})
   270  	pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetArrayInput)(nil)).Elem(), StatefulSetArray{})
   271  	pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetMapInput)(nil)).Elem(), StatefulSetMap{})
   272  	pulumi.RegisterOutputType(StatefulSetOutput{})
   273  	pulumi.RegisterOutputType(StatefulSetArrayOutput{})
   274  	pulumi.RegisterOutputType(StatefulSetMapOutput{})
   275  }