-
Notifications
You must be signed in to change notification settings - Fork 115
/
Deployment.py
268 lines (235 loc) · 13.7 KB
/
Deployment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ... import core as _core
from ... import meta as _meta
from ._inputs import *
__all__ = ['DeploymentArgs', 'Deployment']
@pulumi.input_type
class DeploymentArgs:
def __init__(__self__, *,
api_version: Optional[pulumi.Input[str]] = None,
kind: Optional[pulumi.Input[str]] = None,
metadata: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']] = None,
spec: Optional[pulumi.Input['DeploymentSpecArgs']] = None):
"""
The set of arguments for constructing a Deployment resource.
:param pulumi.Input[str] api_version: 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
:param pulumi.Input[str] kind: 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
:param pulumi.Input['_meta.v1.ObjectMetaArgs'] metadata: Standard object metadata.
:param pulumi.Input['DeploymentSpecArgs'] spec: Specification of the desired behavior of the Deployment.
"""
if api_version is not None:
pulumi.set(__self__, "api_version", 'apps/v1beta2')
if kind is not None:
pulumi.set(__self__, "kind", 'Deployment')
if metadata is not None:
pulumi.set(__self__, "metadata", metadata)
if spec is not None:
pulumi.set(__self__, "spec", spec)
@property
@pulumi.getter(name="apiVersion")
def api_version(self) -> Optional[pulumi.Input[str]]:
"""
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
"""
return pulumi.get(self, "api_version")
@api_version.setter
def api_version(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "api_version", value)
@property
@pulumi.getter
def kind(self) -> Optional[pulumi.Input[str]]:
"""
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
"""
return pulumi.get(self, "kind")
@kind.setter
def kind(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "kind", value)
@property
@pulumi.getter
def metadata(self) -> Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]:
"""
Standard object metadata.
"""
return pulumi.get(self, "metadata")
@metadata.setter
def metadata(self, value: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]):
pulumi.set(self, "metadata", value)
@property
@pulumi.getter
def spec(self) -> Optional[pulumi.Input['DeploymentSpecArgs']]:
"""
Specification of the desired behavior of the Deployment.
"""
return pulumi.get(self, "spec")
@spec.setter
def spec(self, value: Optional[pulumi.Input['DeploymentSpecArgs']]):
pulumi.set(self, "spec", value)
class Deployment(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
api_version: Optional[pulumi.Input[str]] = None,
kind: Optional[pulumi.Input[str]] = None,
metadata: Optional[pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaArgs']]] = None,
spec: Optional[pulumi.Input[pulumi.InputType['DeploymentSpecArgs']]] = None,
__props__=None):
"""
Deployment enables declarative updates for Pods and ReplicaSets.
This resource waits until its status is ready before registering success
for create/update, and populating output properties from the current state of the resource.
The following conditions are used to determine whether the resource creation has
succeeded or failed:
1. The Deployment has begun to be updated by the Deployment controller. If the current
generation of the Deployment is > 1, then this means that the current generation must
be different from the generation reported by the last outputs.
2. There exists a ReplicaSet whose revision is equal to the current revision of the
Deployment.
3. The Deployment's '.status.conditions' has a status of type 'Available' whose 'status'
member is set to 'True'.
4. If the Deployment has generation > 1, then '.status.conditions' has a status of type
'Progressing', whose 'status' member is set to 'True', and whose 'reason' is
'NewReplicaSetAvailable'. For generation <= 1, this status field does not exist,
because it doesn't do a rollout (i.e., it simply creates the Deployment and
corresponding ReplicaSet), and therefore there is no rollout to mark as 'Progressing'.
If the Deployment has not reached a Ready state after 10 minutes, it will
time out and mark the resource update as Failed. You can override the default timeout value
by setting the 'customTimeouts' option on the resource.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] api_version: 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
:param pulumi.Input[str] kind: 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
:param pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaArgs']] metadata: Standard object metadata.
:param pulumi.Input[pulumi.InputType['DeploymentSpecArgs']] spec: Specification of the desired behavior of the Deployment.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: Optional[DeploymentArgs] = None,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Deployment enables declarative updates for Pods and ReplicaSets.
This resource waits until its status is ready before registering success
for create/update, and populating output properties from the current state of the resource.
The following conditions are used to determine whether the resource creation has
succeeded or failed:
1. The Deployment has begun to be updated by the Deployment controller. If the current
generation of the Deployment is > 1, then this means that the current generation must
be different from the generation reported by the last outputs.
2. There exists a ReplicaSet whose revision is equal to the current revision of the
Deployment.
3. The Deployment's '.status.conditions' has a status of type 'Available' whose 'status'
member is set to 'True'.
4. If the Deployment has generation > 1, then '.status.conditions' has a status of type
'Progressing', whose 'status' member is set to 'True', and whose 'reason' is
'NewReplicaSetAvailable'. For generation <= 1, this status field does not exist,
because it doesn't do a rollout (i.e., it simply creates the Deployment and
corresponding ReplicaSet), and therefore there is no rollout to mark as 'Progressing'.
If the Deployment has not reached a Ready state after 10 minutes, it will
time out and mark the resource update as Failed. You can override the default timeout value
by setting the 'customTimeouts' option on the resource.
:param str resource_name: The name of the resource.
:param DeploymentArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(DeploymentArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
api_version: Optional[pulumi.Input[str]] = None,
kind: Optional[pulumi.Input[str]] = None,
metadata: Optional[pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaArgs']]] = None,
spec: Optional[pulumi.Input[pulumi.InputType['DeploymentSpecArgs']]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = DeploymentArgs.__new__(DeploymentArgs)
__props__.__dict__["api_version"] = 'apps/v1beta2'
__props__.__dict__["kind"] = 'Deployment'
__props__.__dict__["metadata"] = metadata
__props__.__dict__["spec"] = spec
__props__.__dict__["status"] = None
alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="kubernetes:apps/v1:Deployment"), pulumi.Alias(type_="kubernetes:apps/v1beta1:Deployment"), pulumi.Alias(type_="kubernetes:extensions/v1beta1:Deployment")])
opts = pulumi.ResourceOptions.merge(opts, alias_opts)
super(Deployment, __self__).__init__(
'kubernetes:apps/v1beta2:Deployment',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'Deployment':
"""
Get an existing Deployment resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = DeploymentArgs.__new__(DeploymentArgs)
__props__.__dict__["api_version"] = None
__props__.__dict__["kind"] = None
__props__.__dict__["metadata"] = None
__props__.__dict__["spec"] = None
__props__.__dict__["status"] = None
return Deployment(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="apiVersion")
def api_version(self) -> pulumi.Output[Optional[str]]:
"""
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
"""
return pulumi.get(self, "api_version")
@property
@pulumi.getter
def kind(self) -> pulumi.Output[Optional[str]]:
"""
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
"""
return pulumi.get(self, "kind")
@property
@pulumi.getter
def metadata(self) -> pulumi.Output[Optional['_meta.v1.outputs.ObjectMeta']]:
"""
Standard object metadata.
"""
return pulumi.get(self, "metadata")
@property
@pulumi.getter
def spec(self) -> pulumi.Output[Optional['outputs.DeploymentSpec']]:
"""
Specification of the desired behavior of the Deployment.
"""
return pulumi.get(self, "spec")
@property
@pulumi.getter
def status(self) -> pulumi.Output[Optional['outputs.DeploymentStatus']]:
"""
Most recently observed status of the Deployment.
"""
return pulumi.get(self, "status")