pulumi-kubernetes 4.19.0a1733937243__py3-none-any.whl → 4.19.0a1733970382__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pulumi-kubernetes might be problematic. Click here for more details.
- pulumi_kubernetes/__init__.py +36 -0
- pulumi_kubernetes/admissionregistration/v1/_inputs.py +6 -6
- pulumi_kubernetes/admissionregistration/v1/outputs.py +4 -4
- pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicy.py +214 -0
- pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBinding.py +222 -0
- pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBindingList.py +215 -0
- pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBindingPatch.py +234 -0
- pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyList.py +215 -0
- pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyPatch.py +226 -0
- pulumi_kubernetes/admissionregistration/v1alpha1/ValidatingAdmissionPolicyBinding.py +0 -8
- pulumi_kubernetes/admissionregistration/v1alpha1/ValidatingAdmissionPolicyBindingPatch.py +0 -8
- pulumi_kubernetes/admissionregistration/v1alpha1/__init__.py +6 -0
- pulumi_kubernetes/admissionregistration/v1alpha1/_inputs.py +1818 -315
- pulumi_kubernetes/admissionregistration/v1alpha1/outputs.py +1365 -246
- pulumi_kubernetes/admissionregistration/v1beta1/_inputs.py +6 -6
- pulumi_kubernetes/admissionregistration/v1beta1/outputs.py +4 -4
- pulumi_kubernetes/apiextensions/v1/_inputs.py +6 -6
- pulumi_kubernetes/apiextensions/v1/outputs.py +4 -4
- pulumi_kubernetes/apps/v1/_inputs.py +6 -6
- pulumi_kubernetes/apps/v1/outputs.py +4 -4
- pulumi_kubernetes/autoscaling/v2/_inputs.py +15 -15
- pulumi_kubernetes/autoscaling/v2/outputs.py +12 -12
- pulumi_kubernetes/batch/v1/_inputs.py +6 -6
- pulumi_kubernetes/batch/v1/outputs.py +4 -4
- pulumi_kubernetes/coordination/__init__.py +3 -0
- pulumi_kubernetes/coordination/v1alpha1/LeaseCandidate.py +2 -0
- pulumi_kubernetes/coordination/v1alpha1/LeaseCandidatePatch.py +2 -0
- pulumi_kubernetes/coordination/v1alpha2/LeaseCandidate.py +216 -0
- pulumi_kubernetes/coordination/v1alpha2/LeaseCandidateList.py +215 -0
- pulumi_kubernetes/coordination/v1alpha2/LeaseCandidatePatch.py +228 -0
- pulumi_kubernetes/coordination/v1alpha2/__init__.py +12 -0
- pulumi_kubernetes/coordination/v1alpha2/_inputs.py +393 -0
- pulumi_kubernetes/coordination/v1alpha2/outputs.py +313 -0
- pulumi_kubernetes/core/v1/Binding.py +2 -2
- pulumi_kubernetes/core/v1/BindingPatch.py +2 -2
- pulumi_kubernetes/core/v1/ServiceAccount.py +4 -4
- pulumi_kubernetes/core/v1/ServiceAccountPatch.py +4 -4
- pulumi_kubernetes/core/v1/_inputs.py +564 -313
- pulumi_kubernetes/core/v1/outputs.py +418 -230
- pulumi_kubernetes/flowcontrol/v1beta3/_inputs.py +12 -12
- pulumi_kubernetes/flowcontrol/v1beta3/outputs.py +8 -8
- pulumi_kubernetes/pulumi-plugin.json +1 -1
- pulumi_kubernetes/resource/__init__.py +3 -0
- pulumi_kubernetes/resource/v1alpha1/ResourceClaim.py +1 -1
- pulumi_kubernetes/resource/v1alpha1/ResourceClaimPatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha1/ResourceClaimTemplate.py +1 -1
- pulumi_kubernetes/resource/v1alpha1/ResourceClaimTemplatePatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha2/ResourceClaim.py +1 -1
- pulumi_kubernetes/resource/v1alpha2/ResourceClaimPatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha2/ResourceClaimTemplate.py +1 -1
- pulumi_kubernetes/resource/v1alpha2/ResourceClaimTemplatePatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha2/ResourceSlice.py +1 -1
- pulumi_kubernetes/resource/v1alpha2/ResourceSlicePatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha3/DeviceClass.py +2 -0
- pulumi_kubernetes/resource/v1alpha3/DeviceClassPatch.py +2 -0
- pulumi_kubernetes/resource/v1alpha3/ResourceClaim.py +1 -1
- pulumi_kubernetes/resource/v1alpha3/ResourceClaimPatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha3/ResourceClaimTemplate.py +1 -1
- pulumi_kubernetes/resource/v1alpha3/ResourceClaimTemplatePatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha3/ResourceSlice.py +8 -8
- pulumi_kubernetes/resource/v1alpha3/ResourceSliceList.py +245 -0
- pulumi_kubernetes/resource/v1alpha3/ResourceSlicePatch.py +1 -1
- pulumi_kubernetes/resource/v1alpha3/__init__.py +1 -0
- pulumi_kubernetes/resource/v1alpha3/_inputs.py +455 -7
- pulumi_kubernetes/resource/v1alpha3/outputs.py +592 -5
- pulumi_kubernetes/resource/v1beta1/DeviceClass.py +237 -0
- pulumi_kubernetes/resource/v1beta1/DeviceClassList.py +215 -0
- pulumi_kubernetes/resource/v1beta1/DeviceClassPatch.py +248 -0
- pulumi_kubernetes/resource/v1beta1/ResourceClaim.py +232 -0
- pulumi_kubernetes/resource/v1beta1/ResourceClaimList.py +216 -0
- pulumi_kubernetes/resource/v1beta1/ResourceClaimPatch.py +243 -0
- pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplate.py +229 -0
- pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplateList.py +215 -0
- pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplatePatch.py +240 -0
- pulumi_kubernetes/resource/v1beta1/ResourceSlice.py +246 -0
- pulumi_kubernetes/resource/v1beta1/ResourceSliceList.py +216 -0
- pulumi_kubernetes/resource/v1beta1/ResourceSlicePatch.py +257 -0
- pulumi_kubernetes/resource/v1beta1/__init__.py +21 -0
- pulumi_kubernetes/resource/v1beta1/_inputs.py +3867 -0
- pulumi_kubernetes/resource/v1beta1/outputs.py +3334 -0
- pulumi_kubernetes/storage/v1/_inputs.py +4 -4
- pulumi_kubernetes/storage/v1/outputs.py +4 -4
- pulumi_kubernetes/yaml/yaml.py +90 -0
- {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/METADATA +1 -1
- {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/RECORD +87 -59
- {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/WHEEL +0 -0
- {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/top_level.txt +0 -0
|
@@ -17,14 +17,26 @@ from . import outputs
|
|
|
17
17
|
from ... import meta as _meta
|
|
18
18
|
|
|
19
19
|
__all__ = [
|
|
20
|
+
'ApplyConfiguration',
|
|
21
|
+
'ApplyConfigurationPatch',
|
|
20
22
|
'AuditAnnotation',
|
|
21
23
|
'AuditAnnotationPatch',
|
|
22
24
|
'ExpressionWarning',
|
|
23
25
|
'ExpressionWarningPatch',
|
|
26
|
+
'JSONPatch',
|
|
27
|
+
'JSONPatchPatch',
|
|
24
28
|
'MatchCondition',
|
|
25
29
|
'MatchConditionPatch',
|
|
26
30
|
'MatchResources',
|
|
27
31
|
'MatchResourcesPatch',
|
|
32
|
+
'MutatingAdmissionPolicy',
|
|
33
|
+
'MutatingAdmissionPolicyBinding',
|
|
34
|
+
'MutatingAdmissionPolicyBindingSpec',
|
|
35
|
+
'MutatingAdmissionPolicyBindingSpecPatch',
|
|
36
|
+
'MutatingAdmissionPolicySpec',
|
|
37
|
+
'MutatingAdmissionPolicySpecPatch',
|
|
38
|
+
'Mutation',
|
|
39
|
+
'MutationPatch',
|
|
28
40
|
'NamedRuleWithOperations',
|
|
29
41
|
'NamedRuleWithOperationsPatch',
|
|
30
42
|
'ParamKind',
|
|
@@ -47,6 +59,160 @@ __all__ = [
|
|
|
47
59
|
'VariablePatch',
|
|
48
60
|
]
|
|
49
61
|
|
|
62
|
+
@pulumi.output_type
|
|
63
|
+
class ApplyConfiguration(dict):
|
|
64
|
+
"""
|
|
65
|
+
ApplyConfiguration defines the desired configuration values of an object.
|
|
66
|
+
"""
|
|
67
|
+
def __init__(__self__, *,
|
|
68
|
+
expression: Optional[str] = None):
|
|
69
|
+
"""
|
|
70
|
+
ApplyConfiguration defines the desired configuration values of an object.
|
|
71
|
+
:param str expression: expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
|
|
72
|
+
|
|
73
|
+
Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
|
|
74
|
+
|
|
75
|
+
Object{
|
|
76
|
+
spec: Object.spec{
|
|
77
|
+
serviceAccountName: "example"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
|
|
82
|
+
|
|
83
|
+
CEL expressions have access to the object types needed to create apply configurations:
|
|
84
|
+
|
|
85
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
86
|
+
|
|
87
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
88
|
+
|
|
89
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
90
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
91
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
92
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
93
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
94
|
+
request resource.
|
|
95
|
+
|
|
96
|
+
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
97
|
+
|
|
98
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
99
|
+
"""
|
|
100
|
+
if expression is not None:
|
|
101
|
+
pulumi.set(__self__, "expression", expression)
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
@pulumi.getter
|
|
105
|
+
def expression(self) -> Optional[str]:
|
|
106
|
+
"""
|
|
107
|
+
expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
|
|
108
|
+
|
|
109
|
+
Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
|
|
110
|
+
|
|
111
|
+
Object{
|
|
112
|
+
spec: Object.spec{
|
|
113
|
+
serviceAccountName: "example"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
|
|
118
|
+
|
|
119
|
+
CEL expressions have access to the object types needed to create apply configurations:
|
|
120
|
+
|
|
121
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
122
|
+
|
|
123
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
124
|
+
|
|
125
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
126
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
127
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
128
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
129
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
130
|
+
request resource.
|
|
131
|
+
|
|
132
|
+
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
133
|
+
|
|
134
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
135
|
+
"""
|
|
136
|
+
return pulumi.get(self, "expression")
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
@pulumi.output_type
|
|
140
|
+
class ApplyConfigurationPatch(dict):
|
|
141
|
+
"""
|
|
142
|
+
ApplyConfiguration defines the desired configuration values of an object.
|
|
143
|
+
"""
|
|
144
|
+
def __init__(__self__, *,
|
|
145
|
+
expression: Optional[str] = None):
|
|
146
|
+
"""
|
|
147
|
+
ApplyConfiguration defines the desired configuration values of an object.
|
|
148
|
+
:param str expression: expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
|
|
149
|
+
|
|
150
|
+
Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
|
|
151
|
+
|
|
152
|
+
Object{
|
|
153
|
+
spec: Object.spec{
|
|
154
|
+
serviceAccountName: "example"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
|
|
159
|
+
|
|
160
|
+
CEL expressions have access to the object types needed to create apply configurations:
|
|
161
|
+
|
|
162
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
163
|
+
|
|
164
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
165
|
+
|
|
166
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
167
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
168
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
169
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
170
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
171
|
+
request resource.
|
|
172
|
+
|
|
173
|
+
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
174
|
+
|
|
175
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
176
|
+
"""
|
|
177
|
+
if expression is not None:
|
|
178
|
+
pulumi.set(__self__, "expression", expression)
|
|
179
|
+
|
|
180
|
+
@property
|
|
181
|
+
@pulumi.getter
|
|
182
|
+
def expression(self) -> Optional[str]:
|
|
183
|
+
"""
|
|
184
|
+
expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
|
|
185
|
+
|
|
186
|
+
Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
|
|
187
|
+
|
|
188
|
+
Object{
|
|
189
|
+
spec: Object.spec{
|
|
190
|
+
serviceAccountName: "example"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
|
|
195
|
+
|
|
196
|
+
CEL expressions have access to the object types needed to create apply configurations:
|
|
197
|
+
|
|
198
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
199
|
+
|
|
200
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
201
|
+
|
|
202
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
203
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
204
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
205
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
206
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
207
|
+
request resource.
|
|
208
|
+
|
|
209
|
+
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
210
|
+
|
|
211
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
212
|
+
"""
|
|
213
|
+
return pulumi.get(self, "expression")
|
|
214
|
+
|
|
215
|
+
|
|
50
216
|
@pulumi.output_type
|
|
51
217
|
class AuditAnnotation(dict):
|
|
52
218
|
"""
|
|
@@ -291,6 +457,264 @@ class ExpressionWarningPatch(dict):
|
|
|
291
457
|
return pulumi.get(self, "warning")
|
|
292
458
|
|
|
293
459
|
|
|
460
|
+
@pulumi.output_type
|
|
461
|
+
class JSONPatch(dict):
|
|
462
|
+
"""
|
|
463
|
+
JSONPatch defines a JSON Patch.
|
|
464
|
+
"""
|
|
465
|
+
def __init__(__self__, *,
|
|
466
|
+
expression: Optional[str] = None):
|
|
467
|
+
"""
|
|
468
|
+
JSONPatch defines a JSON Patch.
|
|
469
|
+
:param str expression: expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
|
|
470
|
+
|
|
471
|
+
expression must return an array of JSONPatch values.
|
|
472
|
+
|
|
473
|
+
For example, this CEL expression returns a JSON patch to conditionally modify a value:
|
|
474
|
+
|
|
475
|
+
[
|
|
476
|
+
JSONPatch{op: "test", path: "/spec/example", value: "Red"},
|
|
477
|
+
JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
|
|
478
|
+
]
|
|
479
|
+
|
|
480
|
+
To define an object for the patch value, use Object types. For example:
|
|
481
|
+
|
|
482
|
+
[
|
|
483
|
+
JSONPatch{
|
|
484
|
+
op: "add",
|
|
485
|
+
path: "/spec/selector",
|
|
486
|
+
value: Object.spec.selector{matchLabels: {"environment": "test"}}
|
|
487
|
+
}
|
|
488
|
+
]
|
|
489
|
+
|
|
490
|
+
To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
|
|
491
|
+
|
|
492
|
+
[
|
|
493
|
+
JSONPatch{
|
|
494
|
+
op: "add",
|
|
495
|
+
path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
|
|
496
|
+
value: "test"
|
|
497
|
+
},
|
|
498
|
+
]
|
|
499
|
+
|
|
500
|
+
CEL expressions have access to the types needed to create JSON patches and objects:
|
|
501
|
+
|
|
502
|
+
- 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
|
|
503
|
+
See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
|
|
504
|
+
integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
|
|
505
|
+
[JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
|
|
506
|
+
function may be used to escape path keys containing '/' and '~'.
|
|
507
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
508
|
+
|
|
509
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
510
|
+
|
|
511
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
512
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
513
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
514
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
515
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
516
|
+
request resource.
|
|
517
|
+
|
|
518
|
+
CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
|
|
519
|
+
|
|
520
|
+
- 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
|
|
521
|
+
|
|
522
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
523
|
+
"""
|
|
524
|
+
if expression is not None:
|
|
525
|
+
pulumi.set(__self__, "expression", expression)
|
|
526
|
+
|
|
527
|
+
@property
|
|
528
|
+
@pulumi.getter
|
|
529
|
+
def expression(self) -> Optional[str]:
|
|
530
|
+
"""
|
|
531
|
+
expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
|
|
532
|
+
|
|
533
|
+
expression must return an array of JSONPatch values.
|
|
534
|
+
|
|
535
|
+
For example, this CEL expression returns a JSON patch to conditionally modify a value:
|
|
536
|
+
|
|
537
|
+
[
|
|
538
|
+
JSONPatch{op: "test", path: "/spec/example", value: "Red"},
|
|
539
|
+
JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
|
|
540
|
+
]
|
|
541
|
+
|
|
542
|
+
To define an object for the patch value, use Object types. For example:
|
|
543
|
+
|
|
544
|
+
[
|
|
545
|
+
JSONPatch{
|
|
546
|
+
op: "add",
|
|
547
|
+
path: "/spec/selector",
|
|
548
|
+
value: Object.spec.selector{matchLabels: {"environment": "test"}}
|
|
549
|
+
}
|
|
550
|
+
]
|
|
551
|
+
|
|
552
|
+
To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
|
|
553
|
+
|
|
554
|
+
[
|
|
555
|
+
JSONPatch{
|
|
556
|
+
op: "add",
|
|
557
|
+
path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
|
|
558
|
+
value: "test"
|
|
559
|
+
},
|
|
560
|
+
]
|
|
561
|
+
|
|
562
|
+
CEL expressions have access to the types needed to create JSON patches and objects:
|
|
563
|
+
|
|
564
|
+
- 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
|
|
565
|
+
See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
|
|
566
|
+
integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
|
|
567
|
+
[JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
|
|
568
|
+
function may be used to escape path keys containing '/' and '~'.
|
|
569
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
570
|
+
|
|
571
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
572
|
+
|
|
573
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
574
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
575
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
576
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
577
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
578
|
+
request resource.
|
|
579
|
+
|
|
580
|
+
CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
|
|
581
|
+
|
|
582
|
+
- 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
|
|
583
|
+
|
|
584
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
585
|
+
"""
|
|
586
|
+
return pulumi.get(self, "expression")
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
@pulumi.output_type
|
|
590
|
+
class JSONPatchPatch(dict):
|
|
591
|
+
"""
|
|
592
|
+
JSONPatch defines a JSON Patch.
|
|
593
|
+
"""
|
|
594
|
+
def __init__(__self__, *,
|
|
595
|
+
expression: Optional[str] = None):
|
|
596
|
+
"""
|
|
597
|
+
JSONPatch defines a JSON Patch.
|
|
598
|
+
:param str expression: expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
|
|
599
|
+
|
|
600
|
+
expression must return an array of JSONPatch values.
|
|
601
|
+
|
|
602
|
+
For example, this CEL expression returns a JSON patch to conditionally modify a value:
|
|
603
|
+
|
|
604
|
+
[
|
|
605
|
+
JSONPatch{op: "test", path: "/spec/example", value: "Red"},
|
|
606
|
+
JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
|
|
607
|
+
]
|
|
608
|
+
|
|
609
|
+
To define an object for the patch value, use Object types. For example:
|
|
610
|
+
|
|
611
|
+
[
|
|
612
|
+
JSONPatch{
|
|
613
|
+
op: "add",
|
|
614
|
+
path: "/spec/selector",
|
|
615
|
+
value: Object.spec.selector{matchLabels: {"environment": "test"}}
|
|
616
|
+
}
|
|
617
|
+
]
|
|
618
|
+
|
|
619
|
+
To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
|
|
620
|
+
|
|
621
|
+
[
|
|
622
|
+
JSONPatch{
|
|
623
|
+
op: "add",
|
|
624
|
+
path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
|
|
625
|
+
value: "test"
|
|
626
|
+
},
|
|
627
|
+
]
|
|
628
|
+
|
|
629
|
+
CEL expressions have access to the types needed to create JSON patches and objects:
|
|
630
|
+
|
|
631
|
+
- 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
|
|
632
|
+
See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
|
|
633
|
+
integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
|
|
634
|
+
[JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
|
|
635
|
+
function may be used to escape path keys containing '/' and '~'.
|
|
636
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
637
|
+
|
|
638
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
639
|
+
|
|
640
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
641
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
642
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
643
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
644
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
645
|
+
request resource.
|
|
646
|
+
|
|
647
|
+
CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
|
|
648
|
+
|
|
649
|
+
- 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
|
|
650
|
+
|
|
651
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
652
|
+
"""
|
|
653
|
+
if expression is not None:
|
|
654
|
+
pulumi.set(__self__, "expression", expression)
|
|
655
|
+
|
|
656
|
+
@property
|
|
657
|
+
@pulumi.getter
|
|
658
|
+
def expression(self) -> Optional[str]:
|
|
659
|
+
"""
|
|
660
|
+
expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
|
|
661
|
+
|
|
662
|
+
expression must return an array of JSONPatch values.
|
|
663
|
+
|
|
664
|
+
For example, this CEL expression returns a JSON patch to conditionally modify a value:
|
|
665
|
+
|
|
666
|
+
[
|
|
667
|
+
JSONPatch{op: "test", path: "/spec/example", value: "Red"},
|
|
668
|
+
JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
|
|
669
|
+
]
|
|
670
|
+
|
|
671
|
+
To define an object for the patch value, use Object types. For example:
|
|
672
|
+
|
|
673
|
+
[
|
|
674
|
+
JSONPatch{
|
|
675
|
+
op: "add",
|
|
676
|
+
path: "/spec/selector",
|
|
677
|
+
value: Object.spec.selector{matchLabels: {"environment": "test"}}
|
|
678
|
+
}
|
|
679
|
+
]
|
|
680
|
+
|
|
681
|
+
To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
|
|
682
|
+
|
|
683
|
+
[
|
|
684
|
+
JSONPatch{
|
|
685
|
+
op: "add",
|
|
686
|
+
path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
|
|
687
|
+
value: "test"
|
|
688
|
+
},
|
|
689
|
+
]
|
|
690
|
+
|
|
691
|
+
CEL expressions have access to the types needed to create JSON patches and objects:
|
|
692
|
+
|
|
693
|
+
- 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
|
|
694
|
+
See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
|
|
695
|
+
integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
|
|
696
|
+
[JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
|
|
697
|
+
function may be used to escape path keys containing '/' and '~'.
|
|
698
|
+
- 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
|
699
|
+
|
|
700
|
+
CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
|
701
|
+
|
|
702
|
+
- 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
|
703
|
+
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
704
|
+
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
705
|
+
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
706
|
+
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
707
|
+
request resource.
|
|
708
|
+
|
|
709
|
+
CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
|
|
710
|
+
|
|
711
|
+
- 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
|
|
712
|
+
|
|
713
|
+
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
|
|
714
|
+
"""
|
|
715
|
+
return pulumi.get(self, "expression")
|
|
716
|
+
|
|
717
|
+
|
|
294
718
|
@pulumi.output_type
|
|
295
719
|
class MatchCondition(dict):
|
|
296
720
|
def __init__(__self__, *,
|
|
@@ -502,229 +926,984 @@ class MatchResources(dict):
|
|
|
502
926
|
|
|
503
927
|
Defaults to "Equivalent"
|
|
504
928
|
"""
|
|
505
|
-
return pulumi.get(self, "match_policy")
|
|
929
|
+
return pulumi.get(self, "match_policy")
|
|
930
|
+
|
|
931
|
+
@property
|
|
932
|
+
@pulumi.getter(name="namespaceSelector")
|
|
933
|
+
def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:
|
|
934
|
+
"""
|
|
935
|
+
NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
|
|
936
|
+
|
|
937
|
+
For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
|
|
938
|
+
"matchExpressions": [
|
|
939
|
+
{
|
|
940
|
+
"key": "runlevel",
|
|
941
|
+
"operator": "NotIn",
|
|
942
|
+
"values": [
|
|
943
|
+
"0",
|
|
944
|
+
"1"
|
|
945
|
+
]
|
|
946
|
+
}
|
|
947
|
+
]
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
|
|
951
|
+
"matchExpressions": [
|
|
952
|
+
{
|
|
953
|
+
"key": "environment",
|
|
954
|
+
"operator": "In",
|
|
955
|
+
"values": [
|
|
956
|
+
"prod",
|
|
957
|
+
"staging"
|
|
958
|
+
]
|
|
959
|
+
}
|
|
960
|
+
]
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
|
|
964
|
+
|
|
965
|
+
Default to the empty LabelSelector, which matches everything.
|
|
966
|
+
"""
|
|
967
|
+
return pulumi.get(self, "namespace_selector")
|
|
968
|
+
|
|
969
|
+
@property
|
|
970
|
+
@pulumi.getter(name="objectSelector")
|
|
971
|
+
def object_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:
|
|
972
|
+
"""
|
|
973
|
+
ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
|
|
974
|
+
"""
|
|
975
|
+
return pulumi.get(self, "object_selector")
|
|
976
|
+
|
|
977
|
+
@property
|
|
978
|
+
@pulumi.getter(name="resourceRules")
|
|
979
|
+
def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperations']]:
|
|
980
|
+
"""
|
|
981
|
+
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
|
|
982
|
+
"""
|
|
983
|
+
return pulumi.get(self, "resource_rules")
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
@pulumi.output_type
|
|
987
|
+
class MatchResourcesPatch(dict):
|
|
988
|
+
"""
|
|
989
|
+
MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
|
|
990
|
+
"""
|
|
991
|
+
@staticmethod
|
|
992
|
+
def __key_warning(key: str):
|
|
993
|
+
suggest = None
|
|
994
|
+
if key == "excludeResourceRules":
|
|
995
|
+
suggest = "exclude_resource_rules"
|
|
996
|
+
elif key == "matchPolicy":
|
|
997
|
+
suggest = "match_policy"
|
|
998
|
+
elif key == "namespaceSelector":
|
|
999
|
+
suggest = "namespace_selector"
|
|
1000
|
+
elif key == "objectSelector":
|
|
1001
|
+
suggest = "object_selector"
|
|
1002
|
+
elif key == "resourceRules":
|
|
1003
|
+
suggest = "resource_rules"
|
|
1004
|
+
|
|
1005
|
+
if suggest:
|
|
1006
|
+
pulumi.log.warn(f"Key '{key}' not found in MatchResourcesPatch. Access the value via the '{suggest}' property getter instead.")
|
|
1007
|
+
|
|
1008
|
+
def __getitem__(self, key: str) -> Any:
|
|
1009
|
+
MatchResourcesPatch.__key_warning(key)
|
|
1010
|
+
return super().__getitem__(key)
|
|
1011
|
+
|
|
1012
|
+
def get(self, key: str, default = None) -> Any:
|
|
1013
|
+
MatchResourcesPatch.__key_warning(key)
|
|
1014
|
+
return super().get(key, default)
|
|
1015
|
+
|
|
1016
|
+
def __init__(__self__, *,
|
|
1017
|
+
exclude_resource_rules: Optional[Sequence['outputs.NamedRuleWithOperationsPatch']] = None,
|
|
1018
|
+
match_policy: Optional[str] = None,
|
|
1019
|
+
namespace_selector: Optional['_meta.v1.outputs.LabelSelectorPatch'] = None,
|
|
1020
|
+
object_selector: Optional['_meta.v1.outputs.LabelSelectorPatch'] = None,
|
|
1021
|
+
resource_rules: Optional[Sequence['outputs.NamedRuleWithOperationsPatch']] = None):
|
|
1022
|
+
"""
|
|
1023
|
+
MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
|
|
1024
|
+
:param Sequence['NamedRuleWithOperationsPatchArgs'] exclude_resource_rules: ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
|
|
1025
|
+
:param str match_policy: matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
|
|
1026
|
+
|
|
1027
|
+
- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
|
|
1028
|
+
|
|
1029
|
+
- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
|
|
1030
|
+
|
|
1031
|
+
Defaults to "Equivalent"
|
|
1032
|
+
:param '_meta.v1.LabelSelectorPatchArgs' namespace_selector: NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
|
|
1033
|
+
|
|
1034
|
+
For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
|
|
1035
|
+
"matchExpressions": [
|
|
1036
|
+
{
|
|
1037
|
+
"key": "runlevel",
|
|
1038
|
+
"operator": "NotIn",
|
|
1039
|
+
"values": [
|
|
1040
|
+
"0",
|
|
1041
|
+
"1"
|
|
1042
|
+
]
|
|
1043
|
+
}
|
|
1044
|
+
]
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
|
|
1048
|
+
"matchExpressions": [
|
|
1049
|
+
{
|
|
1050
|
+
"key": "environment",
|
|
1051
|
+
"operator": "In",
|
|
1052
|
+
"values": [
|
|
1053
|
+
"prod",
|
|
1054
|
+
"staging"
|
|
1055
|
+
]
|
|
1056
|
+
}
|
|
1057
|
+
]
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
|
|
1061
|
+
|
|
1062
|
+
Default to the empty LabelSelector, which matches everything.
|
|
1063
|
+
:param '_meta.v1.LabelSelectorPatchArgs' object_selector: ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
|
|
1064
|
+
:param Sequence['NamedRuleWithOperationsPatchArgs'] resource_rules: ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
|
|
1065
|
+
"""
|
|
1066
|
+
if exclude_resource_rules is not None:
|
|
1067
|
+
pulumi.set(__self__, "exclude_resource_rules", exclude_resource_rules)
|
|
1068
|
+
if match_policy is not None:
|
|
1069
|
+
pulumi.set(__self__, "match_policy", match_policy)
|
|
1070
|
+
if namespace_selector is not None:
|
|
1071
|
+
pulumi.set(__self__, "namespace_selector", namespace_selector)
|
|
1072
|
+
if object_selector is not None:
|
|
1073
|
+
pulumi.set(__self__, "object_selector", object_selector)
|
|
1074
|
+
if resource_rules is not None:
|
|
1075
|
+
pulumi.set(__self__, "resource_rules", resource_rules)
|
|
1076
|
+
|
|
1077
|
+
@property
|
|
1078
|
+
@pulumi.getter(name="excludeResourceRules")
|
|
1079
|
+
def exclude_resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:
|
|
1080
|
+
"""
|
|
1081
|
+
ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
|
|
1082
|
+
"""
|
|
1083
|
+
return pulumi.get(self, "exclude_resource_rules")
|
|
1084
|
+
|
|
1085
|
+
@property
|
|
1086
|
+
@pulumi.getter(name="matchPolicy")
|
|
1087
|
+
def match_policy(self) -> Optional[str]:
|
|
1088
|
+
"""
|
|
1089
|
+
matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
|
|
1090
|
+
|
|
1091
|
+
- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
|
|
1092
|
+
|
|
1093
|
+
- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
|
|
1094
|
+
|
|
1095
|
+
Defaults to "Equivalent"
|
|
1096
|
+
"""
|
|
1097
|
+
return pulumi.get(self, "match_policy")
|
|
1098
|
+
|
|
1099
|
+
@property
|
|
1100
|
+
@pulumi.getter(name="namespaceSelector")
|
|
1101
|
+
def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:
|
|
1102
|
+
"""
|
|
1103
|
+
NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
|
|
1104
|
+
|
|
1105
|
+
For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
|
|
1106
|
+
"matchExpressions": [
|
|
1107
|
+
{
|
|
1108
|
+
"key": "runlevel",
|
|
1109
|
+
"operator": "NotIn",
|
|
1110
|
+
"values": [
|
|
1111
|
+
"0",
|
|
1112
|
+
"1"
|
|
1113
|
+
]
|
|
1114
|
+
}
|
|
1115
|
+
]
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
|
|
1119
|
+
"matchExpressions": [
|
|
1120
|
+
{
|
|
1121
|
+
"key": "environment",
|
|
1122
|
+
"operator": "In",
|
|
1123
|
+
"values": [
|
|
1124
|
+
"prod",
|
|
1125
|
+
"staging"
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
]
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
|
|
1132
|
+
|
|
1133
|
+
Default to the empty LabelSelector, which matches everything.
|
|
1134
|
+
"""
|
|
1135
|
+
return pulumi.get(self, "namespace_selector")
|
|
1136
|
+
|
|
1137
|
+
@property
|
|
1138
|
+
@pulumi.getter(name="objectSelector")
|
|
1139
|
+
def object_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:
|
|
1140
|
+
"""
|
|
1141
|
+
ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
|
|
1142
|
+
"""
|
|
1143
|
+
return pulumi.get(self, "object_selector")
|
|
1144
|
+
|
|
1145
|
+
@property
|
|
1146
|
+
@pulumi.getter(name="resourceRules")
|
|
1147
|
+
def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:
|
|
1148
|
+
"""
|
|
1149
|
+
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
|
|
1150
|
+
"""
|
|
1151
|
+
return pulumi.get(self, "resource_rules")
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
@pulumi.output_type
|
|
1155
|
+
class MutatingAdmissionPolicy(dict):
|
|
1156
|
+
"""
|
|
1157
|
+
MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
|
|
1158
|
+
"""
|
|
1159
|
+
@staticmethod
|
|
1160
|
+
def __key_warning(key: str):
|
|
1161
|
+
suggest = None
|
|
1162
|
+
if key == "apiVersion":
|
|
1163
|
+
suggest = "api_version"
|
|
1164
|
+
|
|
1165
|
+
if suggest:
|
|
1166
|
+
pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicy. Access the value via the '{suggest}' property getter instead.")
|
|
1167
|
+
|
|
1168
|
+
def __getitem__(self, key: str) -> Any:
|
|
1169
|
+
MutatingAdmissionPolicy.__key_warning(key)
|
|
1170
|
+
return super().__getitem__(key)
|
|
1171
|
+
|
|
1172
|
+
def get(self, key: str, default = None) -> Any:
|
|
1173
|
+
MutatingAdmissionPolicy.__key_warning(key)
|
|
1174
|
+
return super().get(key, default)
|
|
1175
|
+
|
|
1176
|
+
def __init__(__self__, *,
|
|
1177
|
+
api_version: Optional[str] = None,
|
|
1178
|
+
kind: Optional[str] = None,
|
|
1179
|
+
metadata: Optional['_meta.v1.outputs.ObjectMeta'] = None,
|
|
1180
|
+
spec: Optional['outputs.MutatingAdmissionPolicySpec'] = None):
|
|
1181
|
+
"""
|
|
1182
|
+
MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
|
|
1183
|
+
:param 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
|
|
1184
|
+
:param 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
|
|
1185
|
+
:param '_meta.v1.ObjectMetaArgs' metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
|
1186
|
+
:param 'MutatingAdmissionPolicySpecArgs' spec: Specification of the desired behavior of the MutatingAdmissionPolicy.
|
|
1187
|
+
"""
|
|
1188
|
+
if api_version is not None:
|
|
1189
|
+
pulumi.set(__self__, "api_version", 'admissionregistration.k8s.io/v1alpha1')
|
|
1190
|
+
if kind is not None:
|
|
1191
|
+
pulumi.set(__self__, "kind", 'MutatingAdmissionPolicy')
|
|
1192
|
+
if metadata is not None:
|
|
1193
|
+
pulumi.set(__self__, "metadata", metadata)
|
|
1194
|
+
if spec is not None:
|
|
1195
|
+
pulumi.set(__self__, "spec", spec)
|
|
1196
|
+
|
|
1197
|
+
@property
|
|
1198
|
+
@pulumi.getter(name="apiVersion")
|
|
1199
|
+
def api_version(self) -> Optional[str]:
|
|
1200
|
+
"""
|
|
1201
|
+
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
|
|
1202
|
+
"""
|
|
1203
|
+
return pulumi.get(self, "api_version")
|
|
1204
|
+
|
|
1205
|
+
@property
|
|
1206
|
+
@pulumi.getter
|
|
1207
|
+
def kind(self) -> Optional[str]:
|
|
1208
|
+
"""
|
|
1209
|
+
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
|
|
1210
|
+
"""
|
|
1211
|
+
return pulumi.get(self, "kind")
|
|
1212
|
+
|
|
1213
|
+
@property
|
|
1214
|
+
@pulumi.getter
|
|
1215
|
+
def metadata(self) -> Optional['_meta.v1.outputs.ObjectMeta']:
|
|
1216
|
+
"""
|
|
1217
|
+
Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
|
1218
|
+
"""
|
|
1219
|
+
return pulumi.get(self, "metadata")
|
|
1220
|
+
|
|
1221
|
+
@property
|
|
1222
|
+
@pulumi.getter
|
|
1223
|
+
def spec(self) -> Optional['outputs.MutatingAdmissionPolicySpec']:
|
|
1224
|
+
"""
|
|
1225
|
+
Specification of the desired behavior of the MutatingAdmissionPolicy.
|
|
1226
|
+
"""
|
|
1227
|
+
return pulumi.get(self, "spec")
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
@pulumi.output_type
|
|
1231
|
+
class MutatingAdmissionPolicyBinding(dict):
|
|
1232
|
+
"""
|
|
1233
|
+
MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.
|
|
1234
|
+
|
|
1235
|
+
For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
|
|
1236
|
+
|
|
1237
|
+
Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
|
|
1238
|
+
"""
|
|
1239
|
+
@staticmethod
|
|
1240
|
+
def __key_warning(key: str):
|
|
1241
|
+
suggest = None
|
|
1242
|
+
if key == "apiVersion":
|
|
1243
|
+
suggest = "api_version"
|
|
1244
|
+
|
|
1245
|
+
if suggest:
|
|
1246
|
+
pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicyBinding. Access the value via the '{suggest}' property getter instead.")
|
|
1247
|
+
|
|
1248
|
+
def __getitem__(self, key: str) -> Any:
|
|
1249
|
+
MutatingAdmissionPolicyBinding.__key_warning(key)
|
|
1250
|
+
return super().__getitem__(key)
|
|
1251
|
+
|
|
1252
|
+
def get(self, key: str, default = None) -> Any:
|
|
1253
|
+
MutatingAdmissionPolicyBinding.__key_warning(key)
|
|
1254
|
+
return super().get(key, default)
|
|
1255
|
+
|
|
1256
|
+
def __init__(__self__, *,
|
|
1257
|
+
api_version: Optional[str] = None,
|
|
1258
|
+
kind: Optional[str] = None,
|
|
1259
|
+
metadata: Optional['_meta.v1.outputs.ObjectMeta'] = None,
|
|
1260
|
+
spec: Optional['outputs.MutatingAdmissionPolicyBindingSpec'] = None):
|
|
1261
|
+
"""
|
|
1262
|
+
MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.
|
|
1263
|
+
|
|
1264
|
+
For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
|
|
1265
|
+
|
|
1266
|
+
Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
|
|
1267
|
+
:param 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
|
|
1268
|
+
:param 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
|
|
1269
|
+
:param '_meta.v1.ObjectMetaArgs' metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
|
1270
|
+
:param 'MutatingAdmissionPolicyBindingSpecArgs' spec: Specification of the desired behavior of the MutatingAdmissionPolicyBinding.
|
|
1271
|
+
"""
|
|
1272
|
+
if api_version is not None:
|
|
1273
|
+
pulumi.set(__self__, "api_version", 'admissionregistration.k8s.io/v1alpha1')
|
|
1274
|
+
if kind is not None:
|
|
1275
|
+
pulumi.set(__self__, "kind", 'MutatingAdmissionPolicyBinding')
|
|
1276
|
+
if metadata is not None:
|
|
1277
|
+
pulumi.set(__self__, "metadata", metadata)
|
|
1278
|
+
if spec is not None:
|
|
1279
|
+
pulumi.set(__self__, "spec", spec)
|
|
1280
|
+
|
|
1281
|
+
@property
|
|
1282
|
+
@pulumi.getter(name="apiVersion")
|
|
1283
|
+
def api_version(self) -> Optional[str]:
|
|
1284
|
+
"""
|
|
1285
|
+
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
|
|
1286
|
+
"""
|
|
1287
|
+
return pulumi.get(self, "api_version")
|
|
1288
|
+
|
|
1289
|
+
@property
|
|
1290
|
+
@pulumi.getter
|
|
1291
|
+
def kind(self) -> Optional[str]:
|
|
1292
|
+
"""
|
|
1293
|
+
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
|
|
1294
|
+
"""
|
|
1295
|
+
return pulumi.get(self, "kind")
|
|
1296
|
+
|
|
1297
|
+
@property
|
|
1298
|
+
@pulumi.getter
|
|
1299
|
+
def metadata(self) -> Optional['_meta.v1.outputs.ObjectMeta']:
|
|
1300
|
+
"""
|
|
1301
|
+
Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
|
1302
|
+
"""
|
|
1303
|
+
return pulumi.get(self, "metadata")
|
|
1304
|
+
|
|
1305
|
+
@property
|
|
1306
|
+
@pulumi.getter
|
|
1307
|
+
def spec(self) -> Optional['outputs.MutatingAdmissionPolicyBindingSpec']:
|
|
1308
|
+
"""
|
|
1309
|
+
Specification of the desired behavior of the MutatingAdmissionPolicyBinding.
|
|
1310
|
+
"""
|
|
1311
|
+
return pulumi.get(self, "spec")
|
|
1312
|
+
|
|
1313
|
+
|
|
1314
|
+
@pulumi.output_type
|
|
1315
|
+
class MutatingAdmissionPolicyBindingSpec(dict):
|
|
1316
|
+
"""
|
|
1317
|
+
MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
|
|
1318
|
+
"""
|
|
1319
|
+
@staticmethod
|
|
1320
|
+
def __key_warning(key: str):
|
|
1321
|
+
suggest = None
|
|
1322
|
+
if key == "matchResources":
|
|
1323
|
+
suggest = "match_resources"
|
|
1324
|
+
elif key == "paramRef":
|
|
1325
|
+
suggest = "param_ref"
|
|
1326
|
+
elif key == "policyName":
|
|
1327
|
+
suggest = "policy_name"
|
|
1328
|
+
|
|
1329
|
+
if suggest:
|
|
1330
|
+
pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicyBindingSpec. Access the value via the '{suggest}' property getter instead.")
|
|
1331
|
+
|
|
1332
|
+
def __getitem__(self, key: str) -> Any:
|
|
1333
|
+
MutatingAdmissionPolicyBindingSpec.__key_warning(key)
|
|
1334
|
+
return super().__getitem__(key)
|
|
1335
|
+
|
|
1336
|
+
def get(self, key: str, default = None) -> Any:
|
|
1337
|
+
MutatingAdmissionPolicyBindingSpec.__key_warning(key)
|
|
1338
|
+
return super().get(key, default)
|
|
1339
|
+
|
|
1340
|
+
def __init__(__self__, *,
|
|
1341
|
+
match_resources: Optional['outputs.MatchResources'] = None,
|
|
1342
|
+
param_ref: Optional['outputs.ParamRef'] = None,
|
|
1343
|
+
policy_name: Optional[str] = None):
|
|
1344
|
+
"""
|
|
1345
|
+
MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
|
|
1346
|
+
:param 'MatchResourcesArgs' match_resources: matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
|
|
1347
|
+
:param 'ParamRefArgs' param_ref: paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
|
|
1348
|
+
:param str policy_name: policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
|
|
1349
|
+
"""
|
|
1350
|
+
if match_resources is not None:
|
|
1351
|
+
pulumi.set(__self__, "match_resources", match_resources)
|
|
1352
|
+
if param_ref is not None:
|
|
1353
|
+
pulumi.set(__self__, "param_ref", param_ref)
|
|
1354
|
+
if policy_name is not None:
|
|
1355
|
+
pulumi.set(__self__, "policy_name", policy_name)
|
|
1356
|
+
|
|
1357
|
+
@property
|
|
1358
|
+
@pulumi.getter(name="matchResources")
|
|
1359
|
+
def match_resources(self) -> Optional['outputs.MatchResources']:
|
|
1360
|
+
"""
|
|
1361
|
+
matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
|
|
1362
|
+
"""
|
|
1363
|
+
return pulumi.get(self, "match_resources")
|
|
1364
|
+
|
|
1365
|
+
@property
|
|
1366
|
+
@pulumi.getter(name="paramRef")
|
|
1367
|
+
def param_ref(self) -> Optional['outputs.ParamRef']:
|
|
1368
|
+
"""
|
|
1369
|
+
paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
|
|
1370
|
+
"""
|
|
1371
|
+
return pulumi.get(self, "param_ref")
|
|
1372
|
+
|
|
1373
|
+
@property
|
|
1374
|
+
@pulumi.getter(name="policyName")
|
|
1375
|
+
def policy_name(self) -> Optional[str]:
|
|
1376
|
+
"""
|
|
1377
|
+
policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
|
|
1378
|
+
"""
|
|
1379
|
+
return pulumi.get(self, "policy_name")
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
@pulumi.output_type
|
|
1383
|
+
class MutatingAdmissionPolicyBindingSpecPatch(dict):
|
|
1384
|
+
"""
|
|
1385
|
+
MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
|
|
1386
|
+
"""
|
|
1387
|
+
@staticmethod
|
|
1388
|
+
def __key_warning(key: str):
|
|
1389
|
+
suggest = None
|
|
1390
|
+
if key == "matchResources":
|
|
1391
|
+
suggest = "match_resources"
|
|
1392
|
+
elif key == "paramRef":
|
|
1393
|
+
suggest = "param_ref"
|
|
1394
|
+
elif key == "policyName":
|
|
1395
|
+
suggest = "policy_name"
|
|
1396
|
+
|
|
1397
|
+
if suggest:
|
|
1398
|
+
pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicyBindingSpecPatch. Access the value via the '{suggest}' property getter instead.")
|
|
1399
|
+
|
|
1400
|
+
def __getitem__(self, key: str) -> Any:
|
|
1401
|
+
MutatingAdmissionPolicyBindingSpecPatch.__key_warning(key)
|
|
1402
|
+
return super().__getitem__(key)
|
|
1403
|
+
|
|
1404
|
+
def get(self, key: str, default = None) -> Any:
|
|
1405
|
+
MutatingAdmissionPolicyBindingSpecPatch.__key_warning(key)
|
|
1406
|
+
return super().get(key, default)
|
|
1407
|
+
|
|
1408
|
+
def __init__(__self__, *,
|
|
1409
|
+
match_resources: Optional['outputs.MatchResourcesPatch'] = None,
|
|
1410
|
+
param_ref: Optional['outputs.ParamRefPatch'] = None,
|
|
1411
|
+
policy_name: Optional[str] = None):
|
|
1412
|
+
"""
|
|
1413
|
+
MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
|
|
1414
|
+
:param 'MatchResourcesPatchArgs' match_resources: matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
|
|
1415
|
+
:param 'ParamRefPatchArgs' param_ref: paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
|
|
1416
|
+
:param str policy_name: policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
|
|
1417
|
+
"""
|
|
1418
|
+
if match_resources is not None:
|
|
1419
|
+
pulumi.set(__self__, "match_resources", match_resources)
|
|
1420
|
+
if param_ref is not None:
|
|
1421
|
+
pulumi.set(__self__, "param_ref", param_ref)
|
|
1422
|
+
if policy_name is not None:
|
|
1423
|
+
pulumi.set(__self__, "policy_name", policy_name)
|
|
1424
|
+
|
|
1425
|
+
@property
|
|
1426
|
+
@pulumi.getter(name="matchResources")
|
|
1427
|
+
def match_resources(self) -> Optional['outputs.MatchResourcesPatch']:
|
|
1428
|
+
"""
|
|
1429
|
+
matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
|
|
1430
|
+
"""
|
|
1431
|
+
return pulumi.get(self, "match_resources")
|
|
1432
|
+
|
|
1433
|
+
@property
|
|
1434
|
+
@pulumi.getter(name="paramRef")
|
|
1435
|
+
def param_ref(self) -> Optional['outputs.ParamRefPatch']:
|
|
1436
|
+
"""
|
|
1437
|
+
paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
|
|
1438
|
+
"""
|
|
1439
|
+
return pulumi.get(self, "param_ref")
|
|
1440
|
+
|
|
1441
|
+
@property
|
|
1442
|
+
@pulumi.getter(name="policyName")
|
|
1443
|
+
def policy_name(self) -> Optional[str]:
|
|
1444
|
+
"""
|
|
1445
|
+
policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
|
|
1446
|
+
"""
|
|
1447
|
+
return pulumi.get(self, "policy_name")
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
@pulumi.output_type
|
|
1451
|
+
class MutatingAdmissionPolicySpec(dict):
|
|
1452
|
+
"""
|
|
1453
|
+
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
|
|
1454
|
+
"""
|
|
1455
|
+
@staticmethod
|
|
1456
|
+
def __key_warning(key: str):
|
|
1457
|
+
suggest = None
|
|
1458
|
+
if key == "failurePolicy":
|
|
1459
|
+
suggest = "failure_policy"
|
|
1460
|
+
elif key == "matchConditions":
|
|
1461
|
+
suggest = "match_conditions"
|
|
1462
|
+
elif key == "matchConstraints":
|
|
1463
|
+
suggest = "match_constraints"
|
|
1464
|
+
elif key == "paramKind":
|
|
1465
|
+
suggest = "param_kind"
|
|
1466
|
+
elif key == "reinvocationPolicy":
|
|
1467
|
+
suggest = "reinvocation_policy"
|
|
1468
|
+
|
|
1469
|
+
if suggest:
|
|
1470
|
+
pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicySpec. Access the value via the '{suggest}' property getter instead.")
|
|
1471
|
+
|
|
1472
|
+
def __getitem__(self, key: str) -> Any:
|
|
1473
|
+
MutatingAdmissionPolicySpec.__key_warning(key)
|
|
1474
|
+
return super().__getitem__(key)
|
|
1475
|
+
|
|
1476
|
+
def get(self, key: str, default = None) -> Any:
|
|
1477
|
+
MutatingAdmissionPolicySpec.__key_warning(key)
|
|
1478
|
+
return super().get(key, default)
|
|
1479
|
+
|
|
1480
|
+
def __init__(__self__, *,
|
|
1481
|
+
failure_policy: Optional[str] = None,
|
|
1482
|
+
match_conditions: Optional[Sequence['outputs.MatchCondition']] = None,
|
|
1483
|
+
match_constraints: Optional['outputs.MatchResources'] = None,
|
|
1484
|
+
mutations: Optional[Sequence['outputs.Mutation']] = None,
|
|
1485
|
+
param_kind: Optional['outputs.ParamKind'] = None,
|
|
1486
|
+
reinvocation_policy: Optional[str] = None,
|
|
1487
|
+
variables: Optional[Sequence['outputs.Variable']] = None):
|
|
1488
|
+
"""
|
|
1489
|
+
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
|
|
1490
|
+
:param str failure_policy: failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
|
|
1491
|
+
|
|
1492
|
+
A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
|
|
1493
|
+
|
|
1494
|
+
failurePolicy does not define how validations that evaluate to false are handled.
|
|
1495
|
+
|
|
1496
|
+
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
1497
|
+
:param Sequence['MatchConditionArgs'] match_conditions: matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
|
|
1498
|
+
|
|
1499
|
+
If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
|
|
1500
|
+
|
|
1501
|
+
The exact matching logic is (in order):
|
|
1502
|
+
1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
|
|
1503
|
+
2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
|
|
1504
|
+
3. If any matchCondition evaluates to an error (but none are FALSE):
|
|
1505
|
+
- If failurePolicy=Fail, reject the request
|
|
1506
|
+
- If failurePolicy=Ignore, the policy is skipped
|
|
1507
|
+
:param 'MatchResourcesArgs' match_constraints: matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
|
|
1508
|
+
:param Sequence['MutationArgs'] mutations: mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
|
|
1509
|
+
:param 'ParamKindArgs' param_kind: paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
|
|
1510
|
+
:param str reinvocation_policy: reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
|
|
1511
|
+
|
|
1512
|
+
Never: These mutations will not be called more than once per binding in a single admission evaluation.
|
|
1513
|
+
|
|
1514
|
+
IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
|
|
1515
|
+
:param Sequence['VariableArgs'] variables: variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
|
|
1516
|
+
|
|
1517
|
+
The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
|
|
1518
|
+
"""
|
|
1519
|
+
if failure_policy is not None:
|
|
1520
|
+
pulumi.set(__self__, "failure_policy", failure_policy)
|
|
1521
|
+
if match_conditions is not None:
|
|
1522
|
+
pulumi.set(__self__, "match_conditions", match_conditions)
|
|
1523
|
+
if match_constraints is not None:
|
|
1524
|
+
pulumi.set(__self__, "match_constraints", match_constraints)
|
|
1525
|
+
if mutations is not None:
|
|
1526
|
+
pulumi.set(__self__, "mutations", mutations)
|
|
1527
|
+
if param_kind is not None:
|
|
1528
|
+
pulumi.set(__self__, "param_kind", param_kind)
|
|
1529
|
+
if reinvocation_policy is not None:
|
|
1530
|
+
pulumi.set(__self__, "reinvocation_policy", reinvocation_policy)
|
|
1531
|
+
if variables is not None:
|
|
1532
|
+
pulumi.set(__self__, "variables", variables)
|
|
1533
|
+
|
|
1534
|
+
@property
|
|
1535
|
+
@pulumi.getter(name="failurePolicy")
|
|
1536
|
+
def failure_policy(self) -> Optional[str]:
|
|
1537
|
+
"""
|
|
1538
|
+
failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
|
|
1539
|
+
|
|
1540
|
+
A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
|
|
1541
|
+
|
|
1542
|
+
failurePolicy does not define how validations that evaluate to false are handled.
|
|
1543
|
+
|
|
1544
|
+
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
1545
|
+
"""
|
|
1546
|
+
return pulumi.get(self, "failure_policy")
|
|
1547
|
+
|
|
1548
|
+
@property
|
|
1549
|
+
@pulumi.getter(name="matchConditions")
|
|
1550
|
+
def match_conditions(self) -> Optional[Sequence['outputs.MatchCondition']]:
|
|
1551
|
+
"""
|
|
1552
|
+
matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
|
|
1553
|
+
|
|
1554
|
+
If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
|
|
1555
|
+
|
|
1556
|
+
The exact matching logic is (in order):
|
|
1557
|
+
1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
|
|
1558
|
+
2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
|
|
1559
|
+
3. If any matchCondition evaluates to an error (but none are FALSE):
|
|
1560
|
+
- If failurePolicy=Fail, reject the request
|
|
1561
|
+
- If failurePolicy=Ignore, the policy is skipped
|
|
1562
|
+
"""
|
|
1563
|
+
return pulumi.get(self, "match_conditions")
|
|
1564
|
+
|
|
1565
|
+
@property
|
|
1566
|
+
@pulumi.getter(name="matchConstraints")
|
|
1567
|
+
def match_constraints(self) -> Optional['outputs.MatchResources']:
|
|
1568
|
+
"""
|
|
1569
|
+
matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
|
|
1570
|
+
"""
|
|
1571
|
+
return pulumi.get(self, "match_constraints")
|
|
1572
|
+
|
|
1573
|
+
@property
|
|
1574
|
+
@pulumi.getter
|
|
1575
|
+
def mutations(self) -> Optional[Sequence['outputs.Mutation']]:
|
|
1576
|
+
"""
|
|
1577
|
+
mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
|
|
1578
|
+
"""
|
|
1579
|
+
return pulumi.get(self, "mutations")
|
|
1580
|
+
|
|
1581
|
+
@property
|
|
1582
|
+
@pulumi.getter(name="paramKind")
|
|
1583
|
+
def param_kind(self) -> Optional['outputs.ParamKind']:
|
|
1584
|
+
"""
|
|
1585
|
+
paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
|
|
1586
|
+
"""
|
|
1587
|
+
return pulumi.get(self, "param_kind")
|
|
1588
|
+
|
|
1589
|
+
@property
|
|
1590
|
+
@pulumi.getter(name="reinvocationPolicy")
|
|
1591
|
+
def reinvocation_policy(self) -> Optional[str]:
|
|
1592
|
+
"""
|
|
1593
|
+
reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
|
|
1594
|
+
|
|
1595
|
+
Never: These mutations will not be called more than once per binding in a single admission evaluation.
|
|
1596
|
+
|
|
1597
|
+
IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
|
|
1598
|
+
"""
|
|
1599
|
+
return pulumi.get(self, "reinvocation_policy")
|
|
1600
|
+
|
|
1601
|
+
@property
|
|
1602
|
+
@pulumi.getter
|
|
1603
|
+
def variables(self) -> Optional[Sequence['outputs.Variable']]:
|
|
1604
|
+
"""
|
|
1605
|
+
variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
|
|
1606
|
+
|
|
1607
|
+
The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
|
|
1608
|
+
"""
|
|
1609
|
+
return pulumi.get(self, "variables")
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
@pulumi.output_type
|
|
1613
|
+
class MutatingAdmissionPolicySpecPatch(dict):
|
|
1614
|
+
"""
|
|
1615
|
+
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
|
|
1616
|
+
"""
|
|
1617
|
+
@staticmethod
|
|
1618
|
+
def __key_warning(key: str):
|
|
1619
|
+
suggest = None
|
|
1620
|
+
if key == "failurePolicy":
|
|
1621
|
+
suggest = "failure_policy"
|
|
1622
|
+
elif key == "matchConditions":
|
|
1623
|
+
suggest = "match_conditions"
|
|
1624
|
+
elif key == "matchConstraints":
|
|
1625
|
+
suggest = "match_constraints"
|
|
1626
|
+
elif key == "paramKind":
|
|
1627
|
+
suggest = "param_kind"
|
|
1628
|
+
elif key == "reinvocationPolicy":
|
|
1629
|
+
suggest = "reinvocation_policy"
|
|
1630
|
+
|
|
1631
|
+
if suggest:
|
|
1632
|
+
pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicySpecPatch. Access the value via the '{suggest}' property getter instead.")
|
|
1633
|
+
|
|
1634
|
+
def __getitem__(self, key: str) -> Any:
|
|
1635
|
+
MutatingAdmissionPolicySpecPatch.__key_warning(key)
|
|
1636
|
+
return super().__getitem__(key)
|
|
1637
|
+
|
|
1638
|
+
def get(self, key: str, default = None) -> Any:
|
|
1639
|
+
MutatingAdmissionPolicySpecPatch.__key_warning(key)
|
|
1640
|
+
return super().get(key, default)
|
|
1641
|
+
|
|
1642
|
+
def __init__(__self__, *,
|
|
1643
|
+
failure_policy: Optional[str] = None,
|
|
1644
|
+
match_conditions: Optional[Sequence['outputs.MatchConditionPatch']] = None,
|
|
1645
|
+
match_constraints: Optional['outputs.MatchResourcesPatch'] = None,
|
|
1646
|
+
mutations: Optional[Sequence['outputs.MutationPatch']] = None,
|
|
1647
|
+
param_kind: Optional['outputs.ParamKindPatch'] = None,
|
|
1648
|
+
reinvocation_policy: Optional[str] = None,
|
|
1649
|
+
variables: Optional[Sequence['outputs.VariablePatch']] = None):
|
|
1650
|
+
"""
|
|
1651
|
+
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
|
|
1652
|
+
:param str failure_policy: failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
|
|
1653
|
+
|
|
1654
|
+
A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
|
|
1655
|
+
|
|
1656
|
+
failurePolicy does not define how validations that evaluate to false are handled.
|
|
1657
|
+
|
|
1658
|
+
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
1659
|
+
:param Sequence['MatchConditionPatchArgs'] match_conditions: matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
|
|
1660
|
+
|
|
1661
|
+
If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
|
|
1662
|
+
|
|
1663
|
+
The exact matching logic is (in order):
|
|
1664
|
+
1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
|
|
1665
|
+
2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
|
|
1666
|
+
3. If any matchCondition evaluates to an error (but none are FALSE):
|
|
1667
|
+
- If failurePolicy=Fail, reject the request
|
|
1668
|
+
- If failurePolicy=Ignore, the policy is skipped
|
|
1669
|
+
:param 'MatchResourcesPatchArgs' match_constraints: matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
|
|
1670
|
+
:param Sequence['MutationPatchArgs'] mutations: mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
|
|
1671
|
+
:param 'ParamKindPatchArgs' param_kind: paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
|
|
1672
|
+
:param str reinvocation_policy: reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
|
|
1673
|
+
|
|
1674
|
+
Never: These mutations will not be called more than once per binding in a single admission evaluation.
|
|
1675
|
+
|
|
1676
|
+
IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
|
|
1677
|
+
:param Sequence['VariablePatchArgs'] variables: variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
|
|
1678
|
+
|
|
1679
|
+
The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
|
|
1680
|
+
"""
|
|
1681
|
+
if failure_policy is not None:
|
|
1682
|
+
pulumi.set(__self__, "failure_policy", failure_policy)
|
|
1683
|
+
if match_conditions is not None:
|
|
1684
|
+
pulumi.set(__self__, "match_conditions", match_conditions)
|
|
1685
|
+
if match_constraints is not None:
|
|
1686
|
+
pulumi.set(__self__, "match_constraints", match_constraints)
|
|
1687
|
+
if mutations is not None:
|
|
1688
|
+
pulumi.set(__self__, "mutations", mutations)
|
|
1689
|
+
if param_kind is not None:
|
|
1690
|
+
pulumi.set(__self__, "param_kind", param_kind)
|
|
1691
|
+
if reinvocation_policy is not None:
|
|
1692
|
+
pulumi.set(__self__, "reinvocation_policy", reinvocation_policy)
|
|
1693
|
+
if variables is not None:
|
|
1694
|
+
pulumi.set(__self__, "variables", variables)
|
|
1695
|
+
|
|
1696
|
+
@property
|
|
1697
|
+
@pulumi.getter(name="failurePolicy")
|
|
1698
|
+
def failure_policy(self) -> Optional[str]:
|
|
1699
|
+
"""
|
|
1700
|
+
failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
|
|
1701
|
+
|
|
1702
|
+
A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
|
|
1703
|
+
|
|
1704
|
+
failurePolicy does not define how validations that evaluate to false are handled.
|
|
1705
|
+
|
|
1706
|
+
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
1707
|
+
"""
|
|
1708
|
+
return pulumi.get(self, "failure_policy")
|
|
1709
|
+
|
|
1710
|
+
@property
|
|
1711
|
+
@pulumi.getter(name="matchConditions")
|
|
1712
|
+
def match_conditions(self) -> Optional[Sequence['outputs.MatchConditionPatch']]:
|
|
1713
|
+
"""
|
|
1714
|
+
matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
|
|
1715
|
+
|
|
1716
|
+
If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
|
|
1717
|
+
|
|
1718
|
+
The exact matching logic is (in order):
|
|
1719
|
+
1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
|
|
1720
|
+
2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
|
|
1721
|
+
3. If any matchCondition evaluates to an error (but none are FALSE):
|
|
1722
|
+
- If failurePolicy=Fail, reject the request
|
|
1723
|
+
- If failurePolicy=Ignore, the policy is skipped
|
|
1724
|
+
"""
|
|
1725
|
+
return pulumi.get(self, "match_conditions")
|
|
1726
|
+
|
|
1727
|
+
@property
|
|
1728
|
+
@pulumi.getter(name="matchConstraints")
|
|
1729
|
+
def match_constraints(self) -> Optional['outputs.MatchResourcesPatch']:
|
|
1730
|
+
"""
|
|
1731
|
+
matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
|
|
1732
|
+
"""
|
|
1733
|
+
return pulumi.get(self, "match_constraints")
|
|
506
1734
|
|
|
507
1735
|
@property
|
|
508
|
-
@pulumi.getter
|
|
509
|
-
def
|
|
1736
|
+
@pulumi.getter
|
|
1737
|
+
def mutations(self) -> Optional[Sequence['outputs.MutationPatch']]:
|
|
510
1738
|
"""
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
"matchExpressions": [
|
|
515
|
-
{
|
|
516
|
-
"key": "runlevel",
|
|
517
|
-
"operator": "NotIn",
|
|
518
|
-
"values": [
|
|
519
|
-
"0",
|
|
520
|
-
"1"
|
|
521
|
-
]
|
|
522
|
-
}
|
|
523
|
-
]
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
|
|
527
|
-
"matchExpressions": [
|
|
528
|
-
{
|
|
529
|
-
"key": "environment",
|
|
530
|
-
"operator": "In",
|
|
531
|
-
"values": [
|
|
532
|
-
"prod",
|
|
533
|
-
"staging"
|
|
534
|
-
]
|
|
535
|
-
}
|
|
536
|
-
]
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
|
|
1739
|
+
mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
|
|
1740
|
+
"""
|
|
1741
|
+
return pulumi.get(self, "mutations")
|
|
540
1742
|
|
|
541
|
-
|
|
1743
|
+
@property
|
|
1744
|
+
@pulumi.getter(name="paramKind")
|
|
1745
|
+
def param_kind(self) -> Optional['outputs.ParamKindPatch']:
|
|
542
1746
|
"""
|
|
543
|
-
|
|
1747
|
+
paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
|
|
1748
|
+
"""
|
|
1749
|
+
return pulumi.get(self, "param_kind")
|
|
544
1750
|
|
|
545
1751
|
@property
|
|
546
|
-
@pulumi.getter(name="
|
|
547
|
-
def
|
|
1752
|
+
@pulumi.getter(name="reinvocationPolicy")
|
|
1753
|
+
def reinvocation_policy(self) -> Optional[str]:
|
|
548
1754
|
"""
|
|
549
|
-
|
|
1755
|
+
reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
|
|
1756
|
+
|
|
1757
|
+
Never: These mutations will not be called more than once per binding in a single admission evaluation.
|
|
1758
|
+
|
|
1759
|
+
IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
|
|
550
1760
|
"""
|
|
551
|
-
return pulumi.get(self, "
|
|
1761
|
+
return pulumi.get(self, "reinvocation_policy")
|
|
552
1762
|
|
|
553
1763
|
@property
|
|
554
|
-
@pulumi.getter
|
|
555
|
-
def
|
|
1764
|
+
@pulumi.getter
|
|
1765
|
+
def variables(self) -> Optional[Sequence['outputs.VariablePatch']]:
|
|
556
1766
|
"""
|
|
557
|
-
|
|
1767
|
+
variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
|
|
1768
|
+
|
|
1769
|
+
The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
|
|
558
1770
|
"""
|
|
559
|
-
return pulumi.get(self, "
|
|
1771
|
+
return pulumi.get(self, "variables")
|
|
560
1772
|
|
|
561
1773
|
|
|
562
1774
|
@pulumi.output_type
|
|
563
|
-
class
|
|
1775
|
+
class Mutation(dict):
|
|
564
1776
|
"""
|
|
565
|
-
|
|
1777
|
+
Mutation specifies the CEL expression which is used to apply the Mutation.
|
|
566
1778
|
"""
|
|
567
1779
|
@staticmethod
|
|
568
1780
|
def __key_warning(key: str):
|
|
569
1781
|
suggest = None
|
|
570
|
-
if key == "
|
|
571
|
-
suggest = "
|
|
572
|
-
elif key == "
|
|
573
|
-
suggest = "
|
|
574
|
-
elif key == "
|
|
575
|
-
suggest = "
|
|
576
|
-
elif key == "objectSelector":
|
|
577
|
-
suggest = "object_selector"
|
|
578
|
-
elif key == "resourceRules":
|
|
579
|
-
suggest = "resource_rules"
|
|
1782
|
+
if key == "patchType":
|
|
1783
|
+
suggest = "patch_type"
|
|
1784
|
+
elif key == "applyConfiguration":
|
|
1785
|
+
suggest = "apply_configuration"
|
|
1786
|
+
elif key == "jsonPatch":
|
|
1787
|
+
suggest = "json_patch"
|
|
580
1788
|
|
|
581
1789
|
if suggest:
|
|
582
|
-
pulumi.log.warn(f"Key '{key}' not found in
|
|
1790
|
+
pulumi.log.warn(f"Key '{key}' not found in Mutation. Access the value via the '{suggest}' property getter instead.")
|
|
583
1791
|
|
|
584
1792
|
def __getitem__(self, key: str) -> Any:
|
|
585
|
-
|
|
1793
|
+
Mutation.__key_warning(key)
|
|
586
1794
|
return super().__getitem__(key)
|
|
587
1795
|
|
|
588
1796
|
def get(self, key: str, default = None) -> Any:
|
|
589
|
-
|
|
1797
|
+
Mutation.__key_warning(key)
|
|
590
1798
|
return super().get(key, default)
|
|
591
1799
|
|
|
592
1800
|
def __init__(__self__, *,
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
object_selector: Optional['_meta.v1.outputs.LabelSelectorPatch'] = None,
|
|
597
|
-
resource_rules: Optional[Sequence['outputs.NamedRuleWithOperationsPatch']] = None):
|
|
1801
|
+
patch_type: str,
|
|
1802
|
+
apply_configuration: Optional['outputs.ApplyConfiguration'] = None,
|
|
1803
|
+
json_patch: Optional['outputs.JSONPatch'] = None):
|
|
598
1804
|
"""
|
|
599
|
-
|
|
600
|
-
:param
|
|
601
|
-
:param
|
|
602
|
-
|
|
603
|
-
- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
|
|
604
|
-
|
|
605
|
-
- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
|
|
606
|
-
|
|
607
|
-
Defaults to "Equivalent"
|
|
608
|
-
:param '_meta.v1.LabelSelectorPatchArgs' namespace_selector: NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
|
|
609
|
-
|
|
610
|
-
For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
|
|
611
|
-
"matchExpressions": [
|
|
612
|
-
{
|
|
613
|
-
"key": "runlevel",
|
|
614
|
-
"operator": "NotIn",
|
|
615
|
-
"values": [
|
|
616
|
-
"0",
|
|
617
|
-
"1"
|
|
618
|
-
]
|
|
619
|
-
}
|
|
620
|
-
]
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
|
|
624
|
-
"matchExpressions": [
|
|
625
|
-
{
|
|
626
|
-
"key": "environment",
|
|
627
|
-
"operator": "In",
|
|
628
|
-
"values": [
|
|
629
|
-
"prod",
|
|
630
|
-
"staging"
|
|
631
|
-
]
|
|
632
|
-
}
|
|
633
|
-
]
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
|
|
637
|
-
|
|
638
|
-
Default to the empty LabelSelector, which matches everything.
|
|
639
|
-
:param '_meta.v1.LabelSelectorPatchArgs' object_selector: ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
|
|
640
|
-
:param Sequence['NamedRuleWithOperationsPatchArgs'] resource_rules: ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
|
|
1805
|
+
Mutation specifies the CEL expression which is used to apply the Mutation.
|
|
1806
|
+
:param str patch_type: patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
|
|
1807
|
+
:param 'ApplyConfigurationArgs' apply_configuration: applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
|
|
1808
|
+
:param 'JSONPatchArgs' json_patch: jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
|
|
641
1809
|
"""
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
pulumi.set(__self__, "namespace_selector", namespace_selector)
|
|
648
|
-
if object_selector is not None:
|
|
649
|
-
pulumi.set(__self__, "object_selector", object_selector)
|
|
650
|
-
if resource_rules is not None:
|
|
651
|
-
pulumi.set(__self__, "resource_rules", resource_rules)
|
|
1810
|
+
pulumi.set(__self__, "patch_type", patch_type)
|
|
1811
|
+
if apply_configuration is not None:
|
|
1812
|
+
pulumi.set(__self__, "apply_configuration", apply_configuration)
|
|
1813
|
+
if json_patch is not None:
|
|
1814
|
+
pulumi.set(__self__, "json_patch", json_patch)
|
|
652
1815
|
|
|
653
1816
|
@property
|
|
654
|
-
@pulumi.getter(name="
|
|
655
|
-
def
|
|
1817
|
+
@pulumi.getter(name="patchType")
|
|
1818
|
+
def patch_type(self) -> str:
|
|
656
1819
|
"""
|
|
657
|
-
|
|
1820
|
+
patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
|
|
658
1821
|
"""
|
|
659
|
-
return pulumi.get(self, "
|
|
1822
|
+
return pulumi.get(self, "patch_type")
|
|
660
1823
|
|
|
661
1824
|
@property
|
|
662
|
-
@pulumi.getter(name="
|
|
663
|
-
def
|
|
1825
|
+
@pulumi.getter(name="applyConfiguration")
|
|
1826
|
+
def apply_configuration(self) -> Optional['outputs.ApplyConfiguration']:
|
|
664
1827
|
"""
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
|
|
668
|
-
|
|
669
|
-
- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
|
|
670
|
-
|
|
671
|
-
Defaults to "Equivalent"
|
|
1828
|
+
applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
|
|
672
1829
|
"""
|
|
673
|
-
return pulumi.get(self, "
|
|
1830
|
+
return pulumi.get(self, "apply_configuration")
|
|
674
1831
|
|
|
675
1832
|
@property
|
|
676
|
-
@pulumi.getter(name="
|
|
677
|
-
def
|
|
1833
|
+
@pulumi.getter(name="jsonPatch")
|
|
1834
|
+
def json_patch(self) -> Optional['outputs.JSONPatch']:
|
|
678
1835
|
"""
|
|
679
|
-
|
|
1836
|
+
jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
|
|
1837
|
+
"""
|
|
1838
|
+
return pulumi.get(self, "json_patch")
|
|
680
1839
|
|
|
681
|
-
For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
|
|
682
|
-
"matchExpressions": [
|
|
683
|
-
{
|
|
684
|
-
"key": "runlevel",
|
|
685
|
-
"operator": "NotIn",
|
|
686
|
-
"values": [
|
|
687
|
-
"0",
|
|
688
|
-
"1"
|
|
689
|
-
]
|
|
690
|
-
}
|
|
691
|
-
]
|
|
692
|
-
}
|
|
693
1840
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
1841
|
+
@pulumi.output_type
|
|
1842
|
+
class MutationPatch(dict):
|
|
1843
|
+
"""
|
|
1844
|
+
Mutation specifies the CEL expression which is used to apply the Mutation.
|
|
1845
|
+
"""
|
|
1846
|
+
@staticmethod
|
|
1847
|
+
def __key_warning(key: str):
|
|
1848
|
+
suggest = None
|
|
1849
|
+
if key == "applyConfiguration":
|
|
1850
|
+
suggest = "apply_configuration"
|
|
1851
|
+
elif key == "jsonPatch":
|
|
1852
|
+
suggest = "json_patch"
|
|
1853
|
+
elif key == "patchType":
|
|
1854
|
+
suggest = "patch_type"
|
|
706
1855
|
|
|
707
|
-
|
|
1856
|
+
if suggest:
|
|
1857
|
+
pulumi.log.warn(f"Key '{key}' not found in MutationPatch. Access the value via the '{suggest}' property getter instead.")
|
|
708
1858
|
|
|
709
|
-
|
|
1859
|
+
def __getitem__(self, key: str) -> Any:
|
|
1860
|
+
MutationPatch.__key_warning(key)
|
|
1861
|
+
return super().__getitem__(key)
|
|
1862
|
+
|
|
1863
|
+
def get(self, key: str, default = None) -> Any:
|
|
1864
|
+
MutationPatch.__key_warning(key)
|
|
1865
|
+
return super().get(key, default)
|
|
1866
|
+
|
|
1867
|
+
def __init__(__self__, *,
|
|
1868
|
+
apply_configuration: Optional['outputs.ApplyConfigurationPatch'] = None,
|
|
1869
|
+
json_patch: Optional['outputs.JSONPatchPatch'] = None,
|
|
1870
|
+
patch_type: Optional[str] = None):
|
|
710
1871
|
"""
|
|
711
|
-
|
|
1872
|
+
Mutation specifies the CEL expression which is used to apply the Mutation.
|
|
1873
|
+
:param 'ApplyConfigurationPatchArgs' apply_configuration: applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
|
|
1874
|
+
:param 'JSONPatchPatchArgs' json_patch: jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
|
|
1875
|
+
:param str patch_type: patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
|
|
1876
|
+
"""
|
|
1877
|
+
if apply_configuration is not None:
|
|
1878
|
+
pulumi.set(__self__, "apply_configuration", apply_configuration)
|
|
1879
|
+
if json_patch is not None:
|
|
1880
|
+
pulumi.set(__self__, "json_patch", json_patch)
|
|
1881
|
+
if patch_type is not None:
|
|
1882
|
+
pulumi.set(__self__, "patch_type", patch_type)
|
|
712
1883
|
|
|
713
1884
|
@property
|
|
714
|
-
@pulumi.getter(name="
|
|
715
|
-
def
|
|
1885
|
+
@pulumi.getter(name="applyConfiguration")
|
|
1886
|
+
def apply_configuration(self) -> Optional['outputs.ApplyConfigurationPatch']:
|
|
716
1887
|
"""
|
|
717
|
-
|
|
1888
|
+
applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
|
|
718
1889
|
"""
|
|
719
|
-
return pulumi.get(self, "
|
|
1890
|
+
return pulumi.get(self, "apply_configuration")
|
|
720
1891
|
|
|
721
1892
|
@property
|
|
722
|
-
@pulumi.getter(name="
|
|
723
|
-
def
|
|
1893
|
+
@pulumi.getter(name="jsonPatch")
|
|
1894
|
+
def json_patch(self) -> Optional['outputs.JSONPatchPatch']:
|
|
724
1895
|
"""
|
|
725
|
-
|
|
1896
|
+
jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
|
|
726
1897
|
"""
|
|
727
|
-
return pulumi.get(self, "
|
|
1898
|
+
return pulumi.get(self, "json_patch")
|
|
1899
|
+
|
|
1900
|
+
@property
|
|
1901
|
+
@pulumi.getter(name="patchType")
|
|
1902
|
+
def patch_type(self) -> Optional[str]:
|
|
1903
|
+
"""
|
|
1904
|
+
patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
|
|
1905
|
+
"""
|
|
1906
|
+
return pulumi.get(self, "patch_type")
|
|
728
1907
|
|
|
729
1908
|
|
|
730
1909
|
@pulumi.output_type
|
|
@@ -1443,10 +2622,6 @@ class ValidatingAdmissionPolicy(dict):
|
|
|
1443
2622
|
class ValidatingAdmissionPolicyBinding(dict):
|
|
1444
2623
|
"""
|
|
1445
2624
|
ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
|
|
1446
|
-
|
|
1447
|
-
For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding.
|
|
1448
|
-
|
|
1449
|
-
The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
|
|
1450
2625
|
"""
|
|
1451
2626
|
@staticmethod
|
|
1452
2627
|
def __key_warning(key: str):
|
|
@@ -1472,10 +2647,6 @@ class ValidatingAdmissionPolicyBinding(dict):
|
|
|
1472
2647
|
spec: Optional['outputs.ValidatingAdmissionPolicyBindingSpec'] = None):
|
|
1473
2648
|
"""
|
|
1474
2649
|
ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
|
|
1475
|
-
|
|
1476
|
-
For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding.
|
|
1477
|
-
|
|
1478
|
-
The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
|
|
1479
2650
|
:param 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
|
|
1480
2651
|
:param 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
|
|
1481
2652
|
:param '_meta.v1.ObjectMetaArgs' metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
|
|
@@ -1559,7 +2730,7 @@ class ValidatingAdmissionPolicyBindingSpec(dict):
|
|
|
1559
2730
|
"""
|
|
1560
2731
|
ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
|
|
1561
2732
|
:param 'MatchResourcesArgs' match_resources: MatchResources declares what resources match this binding and will be validated by it. Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this. If this is unset, all resources matched by the policy are validated by this binding When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated. Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
|
|
1562
|
-
:param 'ParamRefArgs' param_ref:
|
|
2733
|
+
:param 'ParamRefArgs' param_ref: ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
|
|
1563
2734
|
:param str policy_name: PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
|
|
1564
2735
|
:param Sequence[str] validation_actions: validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.
|
|
1565
2736
|
|
|
@@ -1602,7 +2773,7 @@ class ValidatingAdmissionPolicyBindingSpec(dict):
|
|
|
1602
2773
|
@pulumi.getter(name="paramRef")
|
|
1603
2774
|
def param_ref(self) -> Optional['outputs.ParamRef']:
|
|
1604
2775
|
"""
|
|
1605
|
-
|
|
2776
|
+
ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
|
|
1606
2777
|
"""
|
|
1607
2778
|
return pulumi.get(self, "param_ref")
|
|
1608
2779
|
|
|
@@ -1677,7 +2848,7 @@ class ValidatingAdmissionPolicyBindingSpecPatch(dict):
|
|
|
1677
2848
|
"""
|
|
1678
2849
|
ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
|
|
1679
2850
|
:param 'MatchResourcesPatchArgs' match_resources: MatchResources declares what resources match this binding and will be validated by it. Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this. If this is unset, all resources matched by the policy are validated by this binding When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated. Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
|
|
1680
|
-
:param 'ParamRefPatchArgs' param_ref:
|
|
2851
|
+
:param 'ParamRefPatchArgs' param_ref: ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
|
|
1681
2852
|
:param str policy_name: PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
|
|
1682
2853
|
:param Sequence[str] validation_actions: validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.
|
|
1683
2854
|
|
|
@@ -1720,7 +2891,7 @@ class ValidatingAdmissionPolicyBindingSpecPatch(dict):
|
|
|
1720
2891
|
@pulumi.getter(name="paramRef")
|
|
1721
2892
|
def param_ref(self) -> Optional['outputs.ParamRefPatch']:
|
|
1722
2893
|
"""
|
|
1723
|
-
|
|
2894
|
+
ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
|
|
1724
2895
|
"""
|
|
1725
2896
|
return pulumi.get(self, "param_ref")
|
|
1726
2897
|
|
|
@@ -1799,17 +2970,9 @@ class ValidatingAdmissionPolicySpec(dict):
|
|
|
1799
2970
|
variables: Optional[Sequence['outputs.Variable']] = None):
|
|
1800
2971
|
"""
|
|
1801
2972
|
ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
|
|
1802
|
-
:param Sequence['ValidationArgs'] validations: Validations contain CEL expressions which is used to apply the validation.
|
|
2973
|
+
:param Sequence['ValidationArgs'] validations: Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
|
|
1803
2974
|
:param Sequence['AuditAnnotationArgs'] audit_annotations: auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
|
|
1804
|
-
:param str failure_policy:
|
|
1805
|
-
|
|
1806
|
-
A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
|
|
1807
|
-
|
|
1808
|
-
failurePolicy does not define how validations that evaluate to false are handled.
|
|
1809
|
-
|
|
1810
|
-
When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
|
|
1811
|
-
|
|
1812
|
-
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
2975
|
+
:param str failure_policy: FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
|
|
1813
2976
|
:param Sequence['MatchConditionArgs'] match_conditions: MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
|
|
1814
2977
|
|
|
1815
2978
|
If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
|
|
@@ -1844,7 +3007,7 @@ class ValidatingAdmissionPolicySpec(dict):
|
|
|
1844
3007
|
@pulumi.getter
|
|
1845
3008
|
def validations(self) -> Sequence['outputs.Validation']:
|
|
1846
3009
|
"""
|
|
1847
|
-
Validations contain CEL expressions which is used to apply the validation.
|
|
3010
|
+
Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
|
|
1848
3011
|
"""
|
|
1849
3012
|
return pulumi.get(self, "validations")
|
|
1850
3013
|
|
|
@@ -1860,15 +3023,7 @@ class ValidatingAdmissionPolicySpec(dict):
|
|
|
1860
3023
|
@pulumi.getter(name="failurePolicy")
|
|
1861
3024
|
def failure_policy(self) -> Optional[str]:
|
|
1862
3025
|
"""
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
|
|
1866
|
-
|
|
1867
|
-
failurePolicy does not define how validations that evaluate to false are handled.
|
|
1868
|
-
|
|
1869
|
-
When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
|
|
1870
|
-
|
|
1871
|
-
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
3026
|
+
FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
|
|
1872
3027
|
"""
|
|
1873
3028
|
return pulumi.get(self, "failure_policy")
|
|
1874
3029
|
|
|
@@ -1957,15 +3112,7 @@ class ValidatingAdmissionPolicySpecPatch(dict):
|
|
|
1957
3112
|
"""
|
|
1958
3113
|
ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
|
|
1959
3114
|
:param Sequence['AuditAnnotationPatchArgs'] audit_annotations: auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
|
|
1960
|
-
:param str failure_policy:
|
|
1961
|
-
|
|
1962
|
-
A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
|
|
1963
|
-
|
|
1964
|
-
failurePolicy does not define how validations that evaluate to false are handled.
|
|
1965
|
-
|
|
1966
|
-
When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
|
|
1967
|
-
|
|
1968
|
-
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
3115
|
+
:param str failure_policy: FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
|
|
1969
3116
|
:param Sequence['MatchConditionPatchArgs'] match_conditions: MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
|
|
1970
3117
|
|
|
1971
3118
|
If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
|
|
@@ -1978,7 +3125,7 @@ class ValidatingAdmissionPolicySpecPatch(dict):
|
|
|
1978
3125
|
- If failurePolicy=Ignore, the policy is skipped
|
|
1979
3126
|
:param 'MatchResourcesPatchArgs' match_constraints: MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required.
|
|
1980
3127
|
:param 'ParamKindPatchArgs' param_kind: ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
|
|
1981
|
-
:param Sequence['ValidationPatchArgs'] validations: Validations contain CEL expressions which is used to apply the validation.
|
|
3128
|
+
:param Sequence['ValidationPatchArgs'] validations: Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
|
|
1982
3129
|
:param Sequence['VariablePatchArgs'] variables: Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
|
|
1983
3130
|
|
|
1984
3131
|
The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
|
|
@@ -2010,15 +3157,7 @@ class ValidatingAdmissionPolicySpecPatch(dict):
|
|
|
2010
3157
|
@pulumi.getter(name="failurePolicy")
|
|
2011
3158
|
def failure_policy(self) -> Optional[str]:
|
|
2012
3159
|
"""
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
|
|
2016
|
-
|
|
2017
|
-
failurePolicy does not define how validations that evaluate to false are handled.
|
|
2018
|
-
|
|
2019
|
-
When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
|
|
2020
|
-
|
|
2021
|
-
Allowed values are Ignore or Fail. Defaults to Fail.
|
|
3160
|
+
FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
|
|
2022
3161
|
"""
|
|
2023
3162
|
return pulumi.get(self, "failure_policy")
|
|
2024
3163
|
|
|
@@ -2059,7 +3198,7 @@ class ValidatingAdmissionPolicySpecPatch(dict):
|
|
|
2059
3198
|
@pulumi.getter
|
|
2060
3199
|
def validations(self) -> Optional[Sequence['outputs.ValidationPatch']]:
|
|
2061
3200
|
"""
|
|
2062
|
-
Validations contain CEL expressions which is used to apply the validation.
|
|
3201
|
+
Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
|
|
2063
3202
|
"""
|
|
2064
3203
|
return pulumi.get(self, "validations")
|
|
2065
3204
|
|
|
@@ -2235,14 +3374,9 @@ class Validation(dict):
|
|
|
2235
3374
|
reason: Optional[str] = None):
|
|
2236
3375
|
"""
|
|
2237
3376
|
Validation specifies the CEL expression which is used to apply the validation.
|
|
2238
|
-
:param str expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the
|
|
3377
|
+
:param str expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
|
|
2239
3378
|
|
|
2240
|
-
|
|
2241
|
-
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
2242
|
-
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
2243
|
-
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
2244
|
-
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
2245
|
-
request resource.
|
|
3379
|
+
'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
|
|
2246
3380
|
|
|
2247
3381
|
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
2248
3382
|
|
|
@@ -2277,14 +3411,9 @@ class Validation(dict):
|
|
|
2277
3411
|
@pulumi.getter
|
|
2278
3412
|
def expression(self) -> str:
|
|
2279
3413
|
"""
|
|
2280
|
-
Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the
|
|
3414
|
+
Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
|
|
2281
3415
|
|
|
2282
|
-
|
|
2283
|
-
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
2284
|
-
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
2285
|
-
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
2286
|
-
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
2287
|
-
request resource.
|
|
3416
|
+
'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
|
|
2288
3417
|
|
|
2289
3418
|
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
2290
3419
|
|
|
@@ -2360,14 +3489,9 @@ class ValidationPatch(dict):
|
|
|
2360
3489
|
reason: Optional[str] = None):
|
|
2361
3490
|
"""
|
|
2362
3491
|
Validation specifies the CEL expression which is used to apply the validation.
|
|
2363
|
-
:param str expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the
|
|
3492
|
+
:param str expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
|
|
2364
3493
|
|
|
2365
|
-
|
|
2366
|
-
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
2367
|
-
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
2368
|
-
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
2369
|
-
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
2370
|
-
request resource.
|
|
3494
|
+
'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
|
|
2371
3495
|
|
|
2372
3496
|
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
2373
3497
|
|
|
@@ -2403,14 +3527,9 @@ class ValidationPatch(dict):
|
|
|
2403
3527
|
@pulumi.getter
|
|
2404
3528
|
def expression(self) -> Optional[str]:
|
|
2405
3529
|
"""
|
|
2406
|
-
Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the
|
|
3530
|
+
Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
|
|
2407
3531
|
|
|
2408
|
-
|
|
2409
|
-
For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
|
2410
|
-
- 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
|
2411
|
-
See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
|
2412
|
-
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
|
2413
|
-
request resource.
|
|
3532
|
+
'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
|
|
2414
3533
|
|
|
2415
3534
|
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
|
|
2416
3535
|
|