cdk8s-plus-31 2.0.0
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.
- package/.backportrc.json +17 -0
- package/.jsii +90235 -0
- package/CODE_OF_CONDUCT.md +3 -0
- package/CONTRIBUTING.md +185 -0
- package/DCO +34 -0
- package/LICENSE +202 -0
- package/NOTICE +1 -0
- package/OWNERS.md +5 -0
- package/README.md +32 -0
- package/SECURITY.md +5 -0
- package/cdk8s.yaml +8 -0
- package/docs/java.md +23855 -0
- package/docs/plus/config-map.md +98 -0
- package/docs/plus/container.md +133 -0
- package/docs/plus/cronjob.md +67 -0
- package/docs/plus/deployment.md +232 -0
- package/docs/plus/horizontal-pod-autoscaler.md +226 -0
- package/docs/plus/ingress.md +68 -0
- package/docs/plus/job.md +48 -0
- package/docs/plus/namespace.md +58 -0
- package/docs/plus/network-policy.md +341 -0
- package/docs/plus/pod.md +455 -0
- package/docs/plus/pv.md +82 -0
- package/docs/plus/pvc.md +77 -0
- package/docs/plus/rbac.md +104 -0
- package/docs/plus/secret.md +32 -0
- package/docs/plus/service-account.md +35 -0
- package/docs/plus/service.md +41 -0
- package/docs/plus/volume.md +38 -0
- package/docs/python.md +26079 -0
- package/docs/typescript.md +19565 -0
- package/git-hooks/README.md +9 -0
- package/git-hooks/prepare-commit-msg +18 -0
- package/git-hooks/setup.sh +10 -0
- package/lib/_action.d.ts +21 -0
- package/lib/_action.js +32 -0
- package/lib/api-resource.d.ts +298 -0
- package/lib/api-resource.js +430 -0
- package/lib/base.d.ts +79 -0
- package/lib/base.js +92 -0
- package/lib/config-map.d.ts +126 -0
- package/lib/config-map.js +159 -0
- package/lib/container.d.ts +1057 -0
- package/lib/container.js +845 -0
- package/lib/cron-job.d.ts +138 -0
- package/lib/cron-job.js +103 -0
- package/lib/daemon-set.d.ts +45 -0
- package/lib/daemon-set.js +55 -0
- package/lib/deployment.d.ts +223 -0
- package/lib/deployment.js +214 -0
- package/lib/handler.d.ts +62 -0
- package/lib/handler.js +54 -0
- package/lib/horizontal-pod-autoscaler.d.ts +500 -0
- package/lib/horizontal-pod-autoscaler.js +569 -0
- package/lib/imports/k8s.d.ts +21534 -0
- package/lib/imports/k8s.js +16496 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.js +39 -0
- package/lib/ingress.d.ts +230 -0
- package/lib/ingress.js +246 -0
- package/lib/job.d.ts +64 -0
- package/lib/job.js +54 -0
- package/lib/namespace.d.ts +128 -0
- package/lib/namespace.js +109 -0
- package/lib/network-policy.d.ts +311 -0
- package/lib/network-policy.js +344 -0
- package/lib/pod.d.ts +1080 -0
- package/lib/pod.js +1139 -0
- package/lib/probe.d.ts +141 -0
- package/lib/probe.js +77 -0
- package/lib/pv.d.ts +375 -0
- package/lib/pv.js +273 -0
- package/lib/pvc.d.ts +163 -0
- package/lib/pvc.js +152 -0
- package/lib/role-binding.d.ts +138 -0
- package/lib/role-binding.js +165 -0
- package/lib/role.d.ts +268 -0
- package/lib/role.js +401 -0
- package/lib/secret.d.ts +195 -0
- package/lib/secret.js +185 -0
- package/lib/service-account.d.ts +83 -0
- package/lib/service-account.js +105 -0
- package/lib/service.d.ts +289 -0
- package/lib/service.js +182 -0
- package/lib/stateful-set.d.ts +169 -0
- package/lib/stateful-set.js +174 -0
- package/lib/utils.d.ts +4 -0
- package/lib/utils.js +34 -0
- package/lib/volume.d.ts +573 -0
- package/lib/volume.js +371 -0
- package/lib/workload.d.ts +121 -0
- package/lib/workload.js +122 -0
- package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +97 -0
- package/node_modules/balanced-match/index.js +62 -0
- package/node_modules/balanced-match/package.json +48 -0
- package/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/concat-map/index.js +13 -0
- package/node_modules/concat-map/package.json +43 -0
- package/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/minimatch/README.md +230 -0
- package/node_modules/minimatch/minimatch.js +947 -0
- package/node_modules/minimatch/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/minimatch/node_modules/brace-expansion/README.md +129 -0
- package/node_modules/minimatch/node_modules/brace-expansion/index.js +201 -0
- package/node_modules/minimatch/node_modules/brace-expansion/package.json +47 -0
- package/node_modules/minimatch/package.json +33 -0
- package/package.json +186 -0
- package/rotate.md +84 -0
package/lib/role.d.ts
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { ApiObject } from 'cdk8s';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import { IApiResource, IApiEndpoint } from './api-resource';
|
|
4
|
+
import * as base from './base';
|
|
5
|
+
import * as rb from './role-binding';
|
|
6
|
+
/**
|
|
7
|
+
* A reference to any Role or ClusterRole.
|
|
8
|
+
*/
|
|
9
|
+
export interface IRole extends base.IResource {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Properties for `Role`.
|
|
13
|
+
*/
|
|
14
|
+
export interface RoleProps extends base.ResourceProps {
|
|
15
|
+
/**
|
|
16
|
+
* A list of rules the role should allow.
|
|
17
|
+
*
|
|
18
|
+
* @default []
|
|
19
|
+
*/
|
|
20
|
+
readonly rules?: RolePolicyRule[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Policy rule of a `Role.
|
|
24
|
+
*/
|
|
25
|
+
export interface RolePolicyRule {
|
|
26
|
+
/**
|
|
27
|
+
* Verbs to allow. (e.g ['get', 'watch'])
|
|
28
|
+
*/
|
|
29
|
+
readonly verbs: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Resources this rule applies to.
|
|
32
|
+
*/
|
|
33
|
+
readonly resources: IApiResource[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Role is a namespaced, logical grouping of PolicyRules that can be referenced
|
|
37
|
+
* as a unit by a RoleBinding.
|
|
38
|
+
*/
|
|
39
|
+
export declare class Role extends base.Resource implements IRole {
|
|
40
|
+
/**
|
|
41
|
+
* Imports a role from the cluster as a reference.
|
|
42
|
+
*/
|
|
43
|
+
static fromRoleName(scope: Construct, id: string, name: string): IRole;
|
|
44
|
+
/**
|
|
45
|
+
* @see base.Resource.apiObject
|
|
46
|
+
*/
|
|
47
|
+
protected readonly apiObject: ApiObject;
|
|
48
|
+
readonly resourceType = "roles";
|
|
49
|
+
private readonly _rules;
|
|
50
|
+
constructor(scope: Construct, id: string, props?: RoleProps);
|
|
51
|
+
/**
|
|
52
|
+
* Rules associaated with this Role.
|
|
53
|
+
* Returns a copy, use `allow` to add rules.
|
|
54
|
+
*/
|
|
55
|
+
get rules(): RolePolicyRule[];
|
|
56
|
+
/**
|
|
57
|
+
* Add permission to perform a list of HTTP verbs on a collection of
|
|
58
|
+
* resources.
|
|
59
|
+
*
|
|
60
|
+
* @param resources The resource(s) to apply to
|
|
61
|
+
* @see https://kubernetes.io/docs/reference/access-authn-authz/authorization/#determine-the-request-verb
|
|
62
|
+
*/
|
|
63
|
+
allow(verbs: string[], ...resources: IApiResource[]): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add "create" permission for the resources.
|
|
66
|
+
* @param resources The resource(s) to apply to
|
|
67
|
+
*/
|
|
68
|
+
allowCreate(...resources: IApiResource[]): void;
|
|
69
|
+
/**
|
|
70
|
+
* Add "get" permission for the resources.
|
|
71
|
+
* @param resources The resource(s) to apply to
|
|
72
|
+
*/
|
|
73
|
+
allowGet(...resources: IApiResource[]): void;
|
|
74
|
+
/**
|
|
75
|
+
* Add "list" permission for the resources.
|
|
76
|
+
* @param resources The resource(s) to apply to
|
|
77
|
+
*/
|
|
78
|
+
allowList(...resources: IApiResource[]): void;
|
|
79
|
+
/**
|
|
80
|
+
* Add "watch" permission for the resources.
|
|
81
|
+
* @param resources The resource(s) to apply to
|
|
82
|
+
*/
|
|
83
|
+
allowWatch(...resources: IApiResource[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* Add "update" permission for the resources.
|
|
86
|
+
* @param resources The resource(s) to apply to
|
|
87
|
+
*/
|
|
88
|
+
allowUpdate(...resources: IApiResource[]): void;
|
|
89
|
+
/**
|
|
90
|
+
* Add "patch" permission for the resources.
|
|
91
|
+
* @param resources The resource(s) to apply to
|
|
92
|
+
*/
|
|
93
|
+
allowPatch(...resources: IApiResource[]): void;
|
|
94
|
+
/**
|
|
95
|
+
* Add "delete" permission for the resources.
|
|
96
|
+
* @param resources The resource(s) to apply to
|
|
97
|
+
*/
|
|
98
|
+
allowDelete(...resources: IApiResource[]): void;
|
|
99
|
+
/**
|
|
100
|
+
* Add "deletecollection" permission for the resources.
|
|
101
|
+
* @param resources The resource(s) to apply to
|
|
102
|
+
*/
|
|
103
|
+
allowDeleteCollection(...resources: IApiResource[]): void;
|
|
104
|
+
/**
|
|
105
|
+
* Add "get", "list", and "watch" permissions for the resources.
|
|
106
|
+
* @param resources The resource(s) to apply to
|
|
107
|
+
*/
|
|
108
|
+
allowRead(...resources: IApiResource[]): void;
|
|
109
|
+
/**
|
|
110
|
+
* Add "get", "list", "watch", "create", "update", "patch", "delete", and
|
|
111
|
+
* "deletecollection" permissions for the resources.
|
|
112
|
+
*
|
|
113
|
+
* @param resources The resource(s) to apply to
|
|
114
|
+
*/
|
|
115
|
+
allowReadWrite(...resources: IApiResource[]): void;
|
|
116
|
+
/**
|
|
117
|
+
* Create a RoleBinding that binds the permissions in this Role
|
|
118
|
+
* to a list of subjects, that will only apply this role's namespace.
|
|
119
|
+
* @param subjects a list of subjects to bind to
|
|
120
|
+
*/
|
|
121
|
+
bind(...subjects: rb.ISubject[]): rb.RoleBinding;
|
|
122
|
+
private synthesizeRules;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Represents a cluster-level role.
|
|
126
|
+
*/
|
|
127
|
+
export interface IClusterRole extends base.IResource {
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Properties for `ClusterRole`.
|
|
131
|
+
*/
|
|
132
|
+
export interface ClusterRoleProps extends base.ResourceProps {
|
|
133
|
+
/**
|
|
134
|
+
* A list of rules the role should allow.
|
|
135
|
+
*
|
|
136
|
+
* @default []
|
|
137
|
+
*/
|
|
138
|
+
readonly rules?: ClusterRolePolicyRule[];
|
|
139
|
+
/**
|
|
140
|
+
* Specify labels that should be used to locate ClusterRoles, whose rules
|
|
141
|
+
* will be automatically filled into this ClusterRole's rules.
|
|
142
|
+
*/
|
|
143
|
+
readonly aggregationLabels?: {
|
|
144
|
+
[key: string]: string;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Policy rule of a `ClusterRole.
|
|
149
|
+
*/
|
|
150
|
+
export interface ClusterRolePolicyRule {
|
|
151
|
+
/**
|
|
152
|
+
* Verbs to allow. (e.g ['get', 'watch'])
|
|
153
|
+
*/
|
|
154
|
+
readonly verbs: string[];
|
|
155
|
+
/**
|
|
156
|
+
* Endpoints this rule applies to. Can be either api resources
|
|
157
|
+
* or non api resources.
|
|
158
|
+
*/
|
|
159
|
+
readonly endpoints: IApiEndpoint[];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* ClusterRole is a cluster level, logical grouping of PolicyRules that can be
|
|
163
|
+
* referenced as a unit by a RoleBinding or ClusterRoleBinding.
|
|
164
|
+
*/
|
|
165
|
+
export declare class ClusterRole extends base.Resource implements IClusterRole, IRole {
|
|
166
|
+
/**
|
|
167
|
+
* Imports a role from the cluster as a reference.
|
|
168
|
+
*/
|
|
169
|
+
static fromClusterRoleName(scope: Construct, id: string, name: string): IClusterRole;
|
|
170
|
+
/**
|
|
171
|
+
* @see base.Resource.apiObject
|
|
172
|
+
*/
|
|
173
|
+
protected readonly apiObject: ApiObject;
|
|
174
|
+
readonly resourceType = "clusterroles";
|
|
175
|
+
private readonly _labelSelector;
|
|
176
|
+
private readonly _rules;
|
|
177
|
+
constructor(scope: Construct, id: string, props?: ClusterRoleProps);
|
|
178
|
+
/**
|
|
179
|
+
* Rules associaated with this Role.
|
|
180
|
+
* Returns a copy, use `allow` to add rules.
|
|
181
|
+
*/
|
|
182
|
+
get rules(): ClusterRolePolicyRule[];
|
|
183
|
+
/**
|
|
184
|
+
* Add permission to perform a list of HTTP verbs on a collection of
|
|
185
|
+
* resources.
|
|
186
|
+
*
|
|
187
|
+
* @param endpoints The endpoints(s) to apply to
|
|
188
|
+
* @see https://kubernetes.io/docs/reference/access-authn-authz/authorization/#determine-the-request-verb
|
|
189
|
+
*/
|
|
190
|
+
allow(verbs: string[], ...endpoints: IApiEndpoint[]): void;
|
|
191
|
+
/**
|
|
192
|
+
* Add "create" permission for the resources.
|
|
193
|
+
* @param endpoints The resource(s) to apply to
|
|
194
|
+
*/
|
|
195
|
+
allowCreate(...endpoints: IApiEndpoint[]): void;
|
|
196
|
+
/**
|
|
197
|
+
* Add "get" permission for the resources.
|
|
198
|
+
* @param endpoints The resource(s) to apply to
|
|
199
|
+
*/
|
|
200
|
+
allowGet(...endpoints: IApiEndpoint[]): void;
|
|
201
|
+
/**
|
|
202
|
+
* Add "list" permission for the resources.
|
|
203
|
+
* @param endpoints The resource(s) to apply to
|
|
204
|
+
*/
|
|
205
|
+
allowList(...endpoints: IApiEndpoint[]): void;
|
|
206
|
+
/**
|
|
207
|
+
* Add "watch" permission for the resources.
|
|
208
|
+
* @param endpoints The resource(s) to apply to
|
|
209
|
+
*/
|
|
210
|
+
allowWatch(...endpoints: IApiEndpoint[]): void;
|
|
211
|
+
/**
|
|
212
|
+
* Add "update" permission for the resources.
|
|
213
|
+
* @param endpoints The resource(s) to apply to
|
|
214
|
+
*/
|
|
215
|
+
allowUpdate(...endpoints: IApiEndpoint[]): void;
|
|
216
|
+
/**
|
|
217
|
+
* Add "patch" permission for the resources.
|
|
218
|
+
* @param endpoints The resource(s) to apply to
|
|
219
|
+
*/
|
|
220
|
+
allowPatch(...endpoints: IApiEndpoint[]): void;
|
|
221
|
+
/**
|
|
222
|
+
* Add "delete" permission for the resources.
|
|
223
|
+
* @param endpoints The resource(s) to apply to
|
|
224
|
+
*/
|
|
225
|
+
allowDelete(...endpoints: IApiEndpoint[]): void;
|
|
226
|
+
/**
|
|
227
|
+
* Add "deletecollection" permission for the resources.
|
|
228
|
+
* @param endpoints The resource(s) to apply to
|
|
229
|
+
*/
|
|
230
|
+
allowDeleteCollection(...endpoints: IApiEndpoint[]): void;
|
|
231
|
+
/**
|
|
232
|
+
* Add "get", "list", and "watch" permissions for the resources.
|
|
233
|
+
* @param endpoints The resource(s) to apply to
|
|
234
|
+
*/
|
|
235
|
+
allowRead(...endpoints: IApiEndpoint[]): void;
|
|
236
|
+
/**
|
|
237
|
+
* Add "get", "list", "watch", "create", "update", "patch", "delete", and
|
|
238
|
+
* "deletecollection" permissions for the resources.
|
|
239
|
+
*
|
|
240
|
+
* @param endpoints The resource(s) to apply to
|
|
241
|
+
*/
|
|
242
|
+
allowReadWrite(...endpoints: IApiEndpoint[]): void;
|
|
243
|
+
/**
|
|
244
|
+
* Aggregate rules from roles matching this label selector.
|
|
245
|
+
*/
|
|
246
|
+
aggregate(key: string, value: string): void;
|
|
247
|
+
/**
|
|
248
|
+
* Combines the rules of the argument ClusterRole into this ClusterRole
|
|
249
|
+
* using aggregation labels.
|
|
250
|
+
* @param rol
|
|
251
|
+
*/
|
|
252
|
+
combine(rol: ClusterRole): void;
|
|
253
|
+
/**
|
|
254
|
+
* Create a RoleBinding that binds the permissions in this ClusterRole
|
|
255
|
+
* to a list of subjects, that will only apply to the given namespace.
|
|
256
|
+
* @param namespace the namespace to limit permissions to.
|
|
257
|
+
* @param subjects a list of subjects to bind to
|
|
258
|
+
*/
|
|
259
|
+
bindInNamespace(namespace: string, ...subjects: rb.ISubject[]): rb.RoleBinding;
|
|
260
|
+
/**
|
|
261
|
+
* Create a ClusterRoleBinding that binds the permissions in this
|
|
262
|
+
* ClusterRole to a list of subjects, without namespace restrictions.
|
|
263
|
+
* @param subjects a list of subjects to bind to
|
|
264
|
+
*/
|
|
265
|
+
bind(...subjects: rb.ISubject[]): rb.ClusterRoleBinding;
|
|
266
|
+
private synthesizeRules;
|
|
267
|
+
private synthesizeAggregationRules;
|
|
268
|
+
}
|