-
Notifications
You must be signed in to change notification settings - Fork 112
/
ingress.go
307 lines (247 loc) · 11.5 KB
/
ingress.go
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
// *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1beta1
import (
"context"
"reflect"
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.
//
// 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. Ingress object exists.
// 2. Endpoint objects exist with matching names for each Ingress path (except when Service
// type is ExternalName).
// 3. Ingress entry exists for '.status.loadBalancer.ingress'.
//
// If the Ingress 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.
//
// Deprecated: extensions/v1beta1/Ingress is deprecated by networking.k8s.io/v1beta1/Ingress and not supported by Kubernetes v1.20+ clusters.
type Ingress struct {
pulumi.CustomResourceState
// 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
ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
// 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
Kind pulumi.StringPtrOutput `pulumi:"kind"`
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
// Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec IngressSpecPtrOutput `pulumi:"spec"`
// Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Status IngressStatusPtrOutput `pulumi:"status"`
}
// NewIngress registers a new resource with the given unique name, arguments, and options.
func NewIngress(ctx *pulumi.Context,
name string, args *IngressArgs, opts ...pulumi.ResourceOption) (*Ingress, error) {
if args == nil {
args = &IngressArgs{}
}
args.ApiVersion = pulumi.StringPtr("extensions/v1beta1")
args.Kind = pulumi.StringPtr("Ingress")
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("kubernetes:networking.k8s.io/v1:Ingress"),
},
{
Type: pulumi.String("kubernetes:networking.k8s.io/v1beta1:Ingress"),
},
})
opts = append(opts, aliases)
var resource Ingress
err := ctx.RegisterResource("kubernetes:extensions/v1beta1:Ingress", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIngress gets an existing Ingress resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetIngress(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IngressState, opts ...pulumi.ResourceOption) (*Ingress, error) {
var resource Ingress
err := ctx.ReadResource("kubernetes:extensions/v1beta1:Ingress", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Ingress resources.
type ingressState struct {
}
type IngressState struct {
}
func (IngressState) ElementType() reflect.Type {
return reflect.TypeOf((*ingressState)(nil)).Elem()
}
type ingressArgs struct {
// 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
ApiVersion *string `pulumi:"apiVersion"`
// 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
Kind *string `pulumi:"kind"`
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Metadata *metav1.ObjectMeta `pulumi:"metadata"`
// Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec *IngressSpec `pulumi:"spec"`
}
// The set of arguments for constructing a Ingress resource.
type IngressArgs struct {
// 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
ApiVersion pulumi.StringPtrInput
// 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
Kind pulumi.StringPtrInput
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Metadata metav1.ObjectMetaPtrInput
// Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec IngressSpecPtrInput
}
func (IngressArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ingressArgs)(nil)).Elem()
}
type IngressInput interface {
pulumi.Input
ToIngressOutput() IngressOutput
ToIngressOutputWithContext(ctx context.Context) IngressOutput
}
func (*Ingress) ElementType() reflect.Type {
return reflect.TypeOf((*Ingress)(nil))
}
func (i *Ingress) ToIngressOutput() IngressOutput {
return i.ToIngressOutputWithContext(context.Background())
}
func (i *Ingress) ToIngressOutputWithContext(ctx context.Context) IngressOutput {
return pulumi.ToOutputWithContext(ctx, i).(IngressOutput)
}
func (i *Ingress) ToIngressPtrOutput() IngressPtrOutput {
return i.ToIngressPtrOutputWithContext(context.Background())
}
func (i *Ingress) ToIngressPtrOutputWithContext(ctx context.Context) IngressPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(IngressPtrOutput)
}
type IngressPtrInput interface {
pulumi.Input
ToIngressPtrOutput() IngressPtrOutput
ToIngressPtrOutputWithContext(ctx context.Context) IngressPtrOutput
}
type ingressPtrType IngressArgs
func (*ingressPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Ingress)(nil))
}
func (i *ingressPtrType) ToIngressPtrOutput() IngressPtrOutput {
return i.ToIngressPtrOutputWithContext(context.Background())
}
func (i *ingressPtrType) ToIngressPtrOutputWithContext(ctx context.Context) IngressPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(IngressPtrOutput)
}
// IngressArrayInput is an input type that accepts IngressArray and IngressArrayOutput values.
// You can construct a concrete instance of `IngressArrayInput` via:
//
// IngressArray{ IngressArgs{...} }
type IngressArrayInput interface {
pulumi.Input
ToIngressArrayOutput() IngressArrayOutput
ToIngressArrayOutputWithContext(context.Context) IngressArrayOutput
}
type IngressArray []IngressInput
func (IngressArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Ingress)(nil)).Elem()
}
func (i IngressArray) ToIngressArrayOutput() IngressArrayOutput {
return i.ToIngressArrayOutputWithContext(context.Background())
}
func (i IngressArray) ToIngressArrayOutputWithContext(ctx context.Context) IngressArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IngressArrayOutput)
}
// IngressMapInput is an input type that accepts IngressMap and IngressMapOutput values.
// You can construct a concrete instance of `IngressMapInput` via:
//
// IngressMap{ "key": IngressArgs{...} }
type IngressMapInput interface {
pulumi.Input
ToIngressMapOutput() IngressMapOutput
ToIngressMapOutputWithContext(context.Context) IngressMapOutput
}
type IngressMap map[string]IngressInput
func (IngressMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Ingress)(nil)).Elem()
}
func (i IngressMap) ToIngressMapOutput() IngressMapOutput {
return i.ToIngressMapOutputWithContext(context.Background())
}
func (i IngressMap) ToIngressMapOutputWithContext(ctx context.Context) IngressMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IngressMapOutput)
}
type IngressOutput struct {
*pulumi.OutputState
}
func (IngressOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Ingress)(nil))
}
func (o IngressOutput) ToIngressOutput() IngressOutput {
return o
}
func (o IngressOutput) ToIngressOutputWithContext(ctx context.Context) IngressOutput {
return o
}
func (o IngressOutput) ToIngressPtrOutput() IngressPtrOutput {
return o.ToIngressPtrOutputWithContext(context.Background())
}
func (o IngressOutput) ToIngressPtrOutputWithContext(ctx context.Context) IngressPtrOutput {
return o.ApplyT(func(v Ingress) *Ingress {
return &v
}).(IngressPtrOutput)
}
type IngressPtrOutput struct {
*pulumi.OutputState
}
func (IngressPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Ingress)(nil))
}
func (o IngressPtrOutput) ToIngressPtrOutput() IngressPtrOutput {
return o
}
func (o IngressPtrOutput) ToIngressPtrOutputWithContext(ctx context.Context) IngressPtrOutput {
return o
}
type IngressArrayOutput struct{ *pulumi.OutputState }
func (IngressArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Ingress)(nil))
}
func (o IngressArrayOutput) ToIngressArrayOutput() IngressArrayOutput {
return o
}
func (o IngressArrayOutput) ToIngressArrayOutputWithContext(ctx context.Context) IngressArrayOutput {
return o
}
func (o IngressArrayOutput) Index(i pulumi.IntInput) IngressOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Ingress {
return vs[0].([]Ingress)[vs[1].(int)]
}).(IngressOutput)
}
type IngressMapOutput struct{ *pulumi.OutputState }
func (IngressMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Ingress)(nil))
}
func (o IngressMapOutput) ToIngressMapOutput() IngressMapOutput {
return o
}
func (o IngressMapOutput) ToIngressMapOutputWithContext(ctx context.Context) IngressMapOutput {
return o
}
func (o IngressMapOutput) MapIndex(k pulumi.StringInput) IngressOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Ingress {
return vs[0].(map[string]Ingress)[vs[1].(string)]
}).(IngressOutput)
}
func init() {
pulumi.RegisterOutputType(IngressOutput{})
pulumi.RegisterOutputType(IngressPtrOutput{})
pulumi.RegisterOutputType(IngressArrayOutput{})
pulumi.RegisterOutputType(IngressMapOutput{})
}