-
Notifications
You must be signed in to change notification settings - Fork 571
/
Copy pathlabels.gen.go
478 lines (432 loc) · 13.8 KB
/
labels.gen.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
// GENERATED FILE -- DO NOT EDIT
package label
type FeatureStatus int
const (
Alpha FeatureStatus = iota
Beta
Stable
)
func (s FeatureStatus) String() string {
switch s {
case Alpha:
return "Alpha"
case Beta:
return "Beta"
case Stable:
return "Stable"
}
return "Unknown"
}
type ResourceTypes int
const (
Unknown ResourceTypes = iota
Any
Deployment
Gateway
GatewayClass
MutatingWebhookConfiguration
Namespace
Node
Pod
Service
ServiceAccount
ServiceEntry
WorkloadEntry
)
func (r ResourceTypes) String() string {
switch r {
case 1:
return "Any"
case 2:
return "Deployment"
case 3:
return "Gateway"
case 4:
return "GatewayClass"
case 5:
return "MutatingWebhookConfiguration"
case 6:
return "Namespace"
case 7:
return "Node"
case 8:
return "Pod"
case 9:
return "Service"
case 10:
return "ServiceAccount"
case 11:
return "ServiceEntry"
case 12:
return "WorkloadEntry"
}
return "Unknown"
}
// Instance describes a single resource label
type Instance struct {
// The name of the label.
Name string
// Description of the label.
Description string
// FeatureStatus of this label.
FeatureStatus FeatureStatus
// Hide the existence of this label when outputting usage information.
Hidden bool
// Mark this label as deprecated when generating usage information.
Deprecated bool
// The types of resources this label applies to.
Resources []ResourceTypes
}
var (
GatewayManaged = Instance {
Name: "gateway.istio.io/managed",
Description: "Automatically added to all resources [automatically "+
"created](/docs/tasks/traffic-management/ingress/gateway-api/#automated-deployment) "+
"by Istio Gateway controller, to indicate which controller "+
"created the resource. Users should not set this label "+
"themselves.",
FeatureStatus: Stable,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
ServiceAccount,
Deployment,
Service,
},
}
IoK8sNetworkingGatewayGatewayName = Instance {
Name: "gateway.networking.k8s.io/gateway-name",
Description: "Automatically added to all resources [automatically "+
"created](/docs/tasks/traffic-management/ingress/gateway-api/#automated-deployment) "+
"by Istio Gateway controller to indicate which `Gateway` "+
"resulted in the object creation. Users should not set "+
"this label themselves.",
FeatureStatus: Stable,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
ServiceAccount,
Deployment,
Service,
},
}
IoIstioDataplaneMode = Instance {
Name: "istio.io/dataplane-mode",
Description: `When set on a resource, indicates the [data plane mode](/docs/overview/dataplane-modes/) to use.
Possible values: "ambient", "none".
Note: users wishing to use sidecar mode should see the "istio-injection" label; there is no value on this label to configure sidecars.
`,
FeatureStatus: Stable,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
Namespace,
},
}
IoIstioRev = Instance {
Name: "istio.io/rev",
Description: "Istio control plane revision or tag associated with the "+
"resource; e.g. `canary`",
FeatureStatus: Beta,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Namespace,
Gateway,
Pod,
},
}
IoIstioTag = Instance {
Name: "istio.io/tag",
Description: "Istio control plane tag name associated with the resource "+
"- for internal use only",
FeatureStatus: Alpha,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
MutatingWebhookConfiguration,
},
}
IoIstioUseWaypoint = Instance {
Name: "istio.io/use-waypoint",
Description: `When set on a resource, indicates the resource has an associated waypoint with the given name.
The waypoint is assumed to be in the same namespace; for cross-namespace, see "istio.io/use-waypoint-namespace".
When set or a "Pod" or a "Service", this binds that specific resource to the waypoint.
When set on a "Namespace", this applies to all "Pod"/"Service" in the namespace.
Note: the waypoint must allow the type, see "istio.io/waypoint-for".
`,
FeatureStatus: Stable,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
WorkloadEntry,
Service,
ServiceEntry,
Namespace,
},
}
IoIstioUseWaypointNamespace = Instance {
Name: "istio.io/use-waypoint-namespace",
Description: `When set on a resource, indicates the resource has an associated waypoint in the provided namespace.
This must be set in addition to "istio.io/use-waypoint", when a cross-namespace reference is desired.
`,
FeatureStatus: Beta,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
WorkloadEntry,
Service,
ServiceEntry,
Namespace,
},
}
IoIstioWaypointFor = Instance {
Name: "istio.io/waypoint-for",
Description: `When set on a waypoint (either by its specific "Gateway", or for the entire collection on the "GatewayClass"),
indicates the type of traffic this waypoint can handle.
Valid options: "service", "workload", "all", and "none".
`,
FeatureStatus: Stable,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
GatewayClass,
Gateway,
},
}
NetworkingEnableAutoallocateIp = Instance {
Name: "networking.istio.io/enable-autoallocate-ip",
Description: `Configures whether a "ServiceEntry" without any "spec.addresses" set should get an IP address automatically allocated for it.
Valid options: "true", "false"
`,
FeatureStatus: Beta,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
ServiceEntry,
},
}
NetworkingGatewayPort = Instance {
Name: "networking.istio.io/gatewayPort",
Description: "IstioGatewayPortLabel overrides the default 15443 value "+
"to use for a multi-network gateway's port",
FeatureStatus: Alpha,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Service,
},
}
OperatorComponent = Instance {
Name: "operator.istio.io/component",
Description: "Istio operator component name of the resource, e.g. "+
"`Pilot`",
FeatureStatus: Alpha,
Hidden: true,
Deprecated: false,
Resources: []ResourceTypes{
Any,
},
}
OperatorManaged = Instance {
Name: "operator.istio.io/managed",
Description: "Set to `Reconcile` if the Istio operator will reconcile "+
"the resource.",
FeatureStatus: Alpha,
Hidden: true,
Deprecated: false,
Resources: []ResourceTypes{
Any,
},
}
OperatorVersion = Instance {
Name: "operator.istio.io/version",
Description: "The Istio operator version that installed the resource, "+
"e.g. `1.6.0`",
FeatureStatus: Alpha,
Hidden: true,
Deprecated: false,
Resources: []ResourceTypes{
Any,
},
}
SecurityTlsMode = Instance {
Name: "security.istio.io/tlsMode",
Description: "Specifies the TLS mode supported by a sidecar proxy. "+
"Valid values are 'istio', 'disabled'. When injecting "+
"sidecars into Pods, the sidecar injector will set the "+
"value of this label to 'istio' indicating that the "+
"sidecar is capable of supporting mTLS. Clients injected "+
"with sidecar proxies will opportunistically use this "+
"label to determine whether or not to secure the traffic "+
"to this workload using Istio mutual TLS.",
FeatureStatus: Alpha,
Hidden: true,
Deprecated: true,
Resources: []ResourceTypes{
Pod,
},
}
ServiceCanonicalName = Instance {
Name: "service.istio.io/canonical-name",
Description: "The name of the canonical service a workload belongs to",
FeatureStatus: Alpha,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
},
}
ServiceCanonicalRevision = Instance {
Name: "service.istio.io/canonical-revision",
Description: "The name of a revision within a canonical service that "+
"the workload belongs to",
FeatureStatus: Alpha,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
},
}
ServiceWorkloadName = Instance {
Name: "service.istio.io/workload-name",
Description: `The workload name of the application a workload belongs to. If unset, defaults to the detect parent resource.
For example, a "Pod" resource may default to the "Deployment" name.
`,
FeatureStatus: Alpha,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
WorkloadEntry,
},
}
SidecarInject = Instance {
Name: "sidecar.istio.io/inject",
Description: "Specifies whether or not an Envoy sidecar should be "+
"automatically injected into the workload.",
FeatureStatus: Beta,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
},
}
TopologyCluster = Instance {
Name: "topology.istio.io/cluster",
Description: "This label is applied to a workload internally that "+
"identifies the Kubernetes cluster containing the "+
"workload. The cluster ID is specified during Istio "+
"installation for each cluster via "+
"`values.global.multiCluster.clusterName`. It should be "+
"noted that this is only used internally within Istio and "+
"is not an actual label on workload pods. If a pod "+
"contains this label, it will be overridden by Istio "+
"internally with the cluster ID specified during Istio "+
"installation. This label provides a way to select "+
"workloads by cluster when using DestinationRules. For "+
"example, a service owner could create a DestinationRule "+
"containing a subset per cluster and then use these "+
"subsets to control traffic flow to each cluster "+
"independently.",
FeatureStatus: Alpha,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Pod,
},
}
TopologyNetwork = Instance {
Name: "topology.istio.io/network",
Description: `A label used to identify the network for one or more pods. This is used
internally by Istio to group pods resident in the same L3 domain/network.
Istio assumes that pods in the same network are directly reachable from
one another. When pods are in different networks, an Istio Gateway
(e.g. east-west gateway) is typically used to establish connectivity
(with AUTO_PASSTHROUGH mode). This label can be applied to the following
resources to help automate Istio's multi-network configuration.
* Istio System Namespace: Applying this label to the system namespace
establishes a default network for pods managed by the control plane.
This is typically configured during control plane installation using an
admin-specified value.
* Pod: Applying this label to a pod allows overriding the default network
on a per-pod basis. This is typically applied to the pod via webhook
injection, but can also be manually specified on the pod by the service
owner. The Istio installation in each cluster configures webhook injection
using an admin-specified value.
* Gateway Service: Applying this label to the Service for an Istio Gateway,
indicates that Istio should use this service as the gateway for the
network, when configuring cross-network traffic. Istio will configure
pods residing outside of the network to access the Gateway service
via "spec.externalIPs", "status.loadBalancer.ingress[].ip", or in the case
of a NodePort service, the Node's address. The label is configured when
installing the gateway (e.g. east-west gateway) and should match either
the default network for the control plane (as specified by the Istio System
Namespace label) or the network of the targeted pods.`,
FeatureStatus: Beta,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Namespace,
Pod,
Service,
},
}
TopologySubzone = Instance {
Name: "topology.istio.io/subzone",
Description: "User-provided node label for identifying the locality "+
"subzone of a workload. This allows admins to specify a "+
"more granular level of locality than what is offered by "+
"default with Kubernetes regions and zones.",
FeatureStatus: Beta,
Hidden: false,
Deprecated: false,
Resources: []ResourceTypes{
Node,
},
}
)
func AllResourceLabels() []*Instance {
return []*Instance {
&GatewayManaged,
&IoK8sNetworkingGatewayGatewayName,
&IoIstioDataplaneMode,
&IoIstioRev,
&IoIstioTag,
&IoIstioUseWaypoint,
&IoIstioUseWaypointNamespace,
&IoIstioWaypointFor,
&NetworkingEnableAutoallocateIp,
&NetworkingGatewayPort,
&OperatorComponent,
&OperatorManaged,
&OperatorVersion,
&SecurityTlsMode,
&ServiceCanonicalName,
&ServiceCanonicalRevision,
&ServiceWorkloadName,
&SidecarInject,
&TopologyCluster,
&TopologyNetwork,
&TopologySubzone,
}
}
func AllResourceTypes() []string {
return []string {
"Any",
"Deployment",
"Gateway",
"GatewayClass",
"MutatingWebhookConfiguration",
"Namespace",
"Node",
"Pod",
"Service",
"ServiceAccount",
"ServiceEntry",
"WorkloadEntry",
}
}