github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apps/v1beta2/deployment.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 v1beta2 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 // Deployment enables declarative updates for Pods and ReplicaSets. 15 // 16 // This resource waits until its status is ready before registering success 17 // for create/update, and populating output properties from the current state of the resource. 18 // The following conditions are used to determine whether the resource creation has 19 // succeeded or failed: 20 // 21 // 1. The Deployment has begun to be updated by the Deployment controller. If the current 22 // generation of the Deployment is > 1, then this means that the current generation must 23 // be different from the generation reported by the last outputs. 24 // 2. There exists a ReplicaSet whose revision is equal to the current revision of the 25 // Deployment. 26 // 3. The Deployment's '.status.conditions' has a status of type 'Available' whose 'status' 27 // member is set to 'True'. 28 // 4. If the Deployment has generation > 1, then '.status.conditions' has a status of type 29 // 'Progressing', whose 'status' member is set to 'True', and whose 'reason' is 30 // 'NewReplicaSetAvailable'. For generation <= 1, this status field does not exist, 31 // because it doesn't do a rollout (i.e., it simply creates the Deployment and 32 // corresponding ReplicaSet), and therefore there is no rollout to mark as 'Progressing'. 33 // 34 // If the Deployment has not reached a Ready state after 10 minutes, it will 35 // time out and mark the resource update as Failed. You can override the default timeout value 36 // by setting the 'customTimeouts' option on the resource. 37 // 38 // Deprecated: apps/v1beta2/Deployment is deprecated by apps/v1/Deployment and not supported by Kubernetes v1.16+ clusters. 39 type Deployment struct { 40 pulumi.CustomResourceState 41 42 // 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 43 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 44 // 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 45 Kind pulumi.StringPtrOutput `pulumi:"kind"` 46 // Standard object metadata. 47 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 48 // Specification of the desired behavior of the Deployment. 49 Spec DeploymentSpecPtrOutput `pulumi:"spec"` 50 // Most recently observed status of the Deployment. 51 Status DeploymentStatusPtrOutput `pulumi:"status"` 52 } 53 54 // NewDeployment registers a new resource with the given unique name, arguments, and options. 55 func NewDeployment(ctx *pulumi.Context, 56 name string, args *DeploymentArgs, opts ...pulumi.ResourceOption) (*Deployment, error) { 57 if args == nil { 58 args = &DeploymentArgs{} 59 } 60 61 args.ApiVersion = pulumi.StringPtr("apps/v1beta2") 62 args.Kind = pulumi.StringPtr("Deployment") 63 aliases := pulumi.Aliases([]pulumi.Alias{ 64 { 65 Type: pulumi.String("kubernetes:apps/v1:Deployment"), 66 }, 67 { 68 Type: pulumi.String("kubernetes:apps/v1beta1:Deployment"), 69 }, 70 { 71 Type: pulumi.String("kubernetes:extensions/v1beta1:Deployment"), 72 }, 73 }) 74 opts = append(opts, aliases) 75 var resource Deployment 76 err := ctx.RegisterResource("kubernetes:apps/v1beta2:Deployment", name, args, &resource, opts...) 77 if err != nil { 78 return nil, err 79 } 80 return &resource, nil 81 } 82 83 // GetDeployment gets an existing Deployment resource's state with the given name, ID, and optional 84 // state properties that are used to uniquely qualify the lookup (nil if not required). 85 func GetDeployment(ctx *pulumi.Context, 86 name string, id pulumi.IDInput, state *DeploymentState, opts ...pulumi.ResourceOption) (*Deployment, error) { 87 var resource Deployment 88 err := ctx.ReadResource("kubernetes:apps/v1beta2:Deployment", name, id, state, &resource, opts...) 89 if err != nil { 90 return nil, err 91 } 92 return &resource, nil 93 } 94 95 // Input properties used for looking up and filtering Deployment resources. 96 type deploymentState struct { 97 } 98 99 type DeploymentState struct { 100 } 101 102 func (DeploymentState) ElementType() reflect.Type { 103 return reflect.TypeOf((*deploymentState)(nil)).Elem() 104 } 105 106 type deploymentArgs struct { 107 // 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 108 ApiVersion *string `pulumi:"apiVersion"` 109 // 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 110 Kind *string `pulumi:"kind"` 111 // Standard object metadata. 112 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 113 // Specification of the desired behavior of the Deployment. 114 Spec *DeploymentSpec `pulumi:"spec"` 115 } 116 117 // The set of arguments for constructing a Deployment resource. 118 type DeploymentArgs struct { 119 // 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 120 ApiVersion pulumi.StringPtrInput 121 // 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 122 Kind pulumi.StringPtrInput 123 // Standard object metadata. 124 Metadata metav1.ObjectMetaPtrInput 125 // Specification of the desired behavior of the Deployment. 126 Spec DeploymentSpecPtrInput 127 } 128 129 func (DeploymentArgs) ElementType() reflect.Type { 130 return reflect.TypeOf((*deploymentArgs)(nil)).Elem() 131 } 132 133 type DeploymentInput interface { 134 pulumi.Input 135 136 ToDeploymentOutput() DeploymentOutput 137 ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput 138 } 139 140 func (*Deployment) ElementType() reflect.Type { 141 return reflect.TypeOf((**Deployment)(nil)).Elem() 142 } 143 144 func (i *Deployment) ToDeploymentOutput() DeploymentOutput { 145 return i.ToDeploymentOutputWithContext(context.Background()) 146 } 147 148 func (i *Deployment) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput { 149 return pulumi.ToOutputWithContext(ctx, i).(DeploymentOutput) 150 } 151 152 // DeploymentArrayInput is an input type that accepts DeploymentArray and DeploymentArrayOutput values. 153 // You can construct a concrete instance of `DeploymentArrayInput` via: 154 // 155 // DeploymentArray{ DeploymentArgs{...} } 156 type DeploymentArrayInput interface { 157 pulumi.Input 158 159 ToDeploymentArrayOutput() DeploymentArrayOutput 160 ToDeploymentArrayOutputWithContext(context.Context) DeploymentArrayOutput 161 } 162 163 type DeploymentArray []DeploymentInput 164 165 func (DeploymentArray) ElementType() reflect.Type { 166 return reflect.TypeOf((*[]*Deployment)(nil)).Elem() 167 } 168 169 func (i DeploymentArray) ToDeploymentArrayOutput() DeploymentArrayOutput { 170 return i.ToDeploymentArrayOutputWithContext(context.Background()) 171 } 172 173 func (i DeploymentArray) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput { 174 return pulumi.ToOutputWithContext(ctx, i).(DeploymentArrayOutput) 175 } 176 177 // DeploymentMapInput is an input type that accepts DeploymentMap and DeploymentMapOutput values. 178 // You can construct a concrete instance of `DeploymentMapInput` via: 179 // 180 // DeploymentMap{ "key": DeploymentArgs{...} } 181 type DeploymentMapInput interface { 182 pulumi.Input 183 184 ToDeploymentMapOutput() DeploymentMapOutput 185 ToDeploymentMapOutputWithContext(context.Context) DeploymentMapOutput 186 } 187 188 type DeploymentMap map[string]DeploymentInput 189 190 func (DeploymentMap) ElementType() reflect.Type { 191 return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem() 192 } 193 194 func (i DeploymentMap) ToDeploymentMapOutput() DeploymentMapOutput { 195 return i.ToDeploymentMapOutputWithContext(context.Background()) 196 } 197 198 func (i DeploymentMap) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput { 199 return pulumi.ToOutputWithContext(ctx, i).(DeploymentMapOutput) 200 } 201 202 type DeploymentOutput struct{ *pulumi.OutputState } 203 204 func (DeploymentOutput) ElementType() reflect.Type { 205 return reflect.TypeOf((**Deployment)(nil)).Elem() 206 } 207 208 func (o DeploymentOutput) ToDeploymentOutput() DeploymentOutput { 209 return o 210 } 211 212 func (o DeploymentOutput) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput { 213 return o 214 } 215 216 // 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 217 func (o DeploymentOutput) ApiVersion() pulumi.StringPtrOutput { 218 return o.ApplyT(func(v *Deployment) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 219 } 220 221 // 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 222 func (o DeploymentOutput) Kind() pulumi.StringPtrOutput { 223 return o.ApplyT(func(v *Deployment) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 224 } 225 226 // Standard object metadata. 227 func (o DeploymentOutput) Metadata() metav1.ObjectMetaPtrOutput { 228 return o.ApplyT(func(v *Deployment) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 229 } 230 231 // Specification of the desired behavior of the Deployment. 232 func (o DeploymentOutput) Spec() DeploymentSpecPtrOutput { 233 return o.ApplyT(func(v *Deployment) DeploymentSpecPtrOutput { return v.Spec }).(DeploymentSpecPtrOutput) 234 } 235 236 // Most recently observed status of the Deployment. 237 func (o DeploymentOutput) Status() DeploymentStatusPtrOutput { 238 return o.ApplyT(func(v *Deployment) DeploymentStatusPtrOutput { return v.Status }).(DeploymentStatusPtrOutput) 239 } 240 241 type DeploymentArrayOutput struct{ *pulumi.OutputState } 242 243 func (DeploymentArrayOutput) ElementType() reflect.Type { 244 return reflect.TypeOf((*[]*Deployment)(nil)).Elem() 245 } 246 247 func (o DeploymentArrayOutput) ToDeploymentArrayOutput() DeploymentArrayOutput { 248 return o 249 } 250 251 func (o DeploymentArrayOutput) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput { 252 return o 253 } 254 255 func (o DeploymentArrayOutput) Index(i pulumi.IntInput) DeploymentOutput { 256 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Deployment { 257 return vs[0].([]*Deployment)[vs[1].(int)] 258 }).(DeploymentOutput) 259 } 260 261 type DeploymentMapOutput struct{ *pulumi.OutputState } 262 263 func (DeploymentMapOutput) ElementType() reflect.Type { 264 return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem() 265 } 266 267 func (o DeploymentMapOutput) ToDeploymentMapOutput() DeploymentMapOutput { 268 return o 269 } 270 271 func (o DeploymentMapOutput) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput { 272 return o 273 } 274 275 func (o DeploymentMapOutput) MapIndex(k pulumi.StringInput) DeploymentOutput { 276 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Deployment { 277 return vs[0].(map[string]*Deployment)[vs[1].(string)] 278 }).(DeploymentOutput) 279 } 280 281 func init() { 282 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentInput)(nil)).Elem(), &Deployment{}) 283 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentArrayInput)(nil)).Elem(), DeploymentArray{}) 284 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentMapInput)(nil)).Elem(), DeploymentMap{}) 285 pulumi.RegisterOutputType(DeploymentOutput{}) 286 pulumi.RegisterOutputType(DeploymentArrayOutput{}) 287 pulumi.RegisterOutputType(DeploymentMapOutput{}) 288 }