timonel 2.6.1 → 2.7.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/CHANGELOG.md +12 -0
- package/dist/lib/resources/autoscaling/autoscalingResources.d.ts +230 -8
- package/dist/lib/resources/autoscaling/autoscalingResources.d.ts.map +1 -1
- package/dist/lib/resources/autoscaling/autoscalingResources.js +60 -14
- package/dist/lib/resources/autoscaling/autoscalingResources.js.map +1 -1
- package/dist/lib/resources/baseResourceProvider.d.ts +12 -0
- package/dist/lib/resources/baseResourceProvider.d.ts.map +1 -1
- package/dist/lib/resources/baseResourceProvider.js +25 -0
- package/dist/lib/resources/baseResourceProvider.js.map +1 -1
- package/dist/lib/resources/cloud/aws/awsResources.d.ts +26 -0
- package/dist/lib/resources/cloud/aws/awsResources.d.ts.map +1 -1
- package/dist/lib/resources/cloud/aws/awsResources.js +35 -6
- package/dist/lib/resources/cloud/aws/awsResources.js.map +1 -1
- package/dist/lib/resources/cloud/aws/karpenterResources.d.ts +186 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.d.ts.map +1 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.js +95 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.js.map +1 -0
- package/dist/lib/resources/cloud/azure/azureResources.js +4 -4
- package/dist/lib/resources/cloud/azure/azureResources.js.map +1 -1
- package/dist/lib/resources/cloud/gcp/gcpResources.d.ts +26 -0
- package/dist/lib/resources/cloud/gcp/gcpResources.d.ts.map +1 -1
- package/dist/lib/resources/cloud/gcp/gcpResources.js +33 -4
- package/dist/lib/resources/cloud/gcp/gcpResources.js.map +1 -1
- package/dist/lib/resources/core/storageResources.js +2 -2
- package/dist/lib/resources/core/storageResources.js.map +1 -1
- package/dist/lib/resources/network/networkResources.d.ts +156 -0
- package/dist/lib/resources/network/networkResources.d.ts.map +1 -0
- package/dist/lib/resources/network/networkResources.js +129 -0
- package/dist/lib/resources/network/networkResources.js.map +1 -0
- package/dist/lib/rutter.d.ts +294 -2
- package/dist/lib/rutter.d.ts.map +1 -1
- package/dist/lib/rutter.js +316 -0
- package/dist/lib/rutter.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Network resources for Kubernetes networking
|
|
3
|
+
* @since 2.7.0
|
|
4
|
+
*/
|
|
5
|
+
import type { ApiObject } from 'cdk8s';
|
|
6
|
+
import { BaseResourceProvider } from '../baseResourceProvider.js';
|
|
7
|
+
/**
|
|
8
|
+
* Network policy rule specification
|
|
9
|
+
* @since 2.7.0
|
|
10
|
+
*/
|
|
11
|
+
export interface NetworkPolicyRule {
|
|
12
|
+
/** Ports to allow */
|
|
13
|
+
ports?: Array<{
|
|
14
|
+
port?: number | string;
|
|
15
|
+
protocol?: 'TCP' | 'UDP' | 'SCTP';
|
|
16
|
+
}>;
|
|
17
|
+
/** Pod selector for allowed pods */
|
|
18
|
+
podSelector?: {
|
|
19
|
+
matchLabels?: Record<string, string>;
|
|
20
|
+
matchExpressions?: Array<{
|
|
21
|
+
key: string;
|
|
22
|
+
operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist';
|
|
23
|
+
values?: string[];
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
/** Namespace selector for allowed namespaces */
|
|
27
|
+
namespaceSelector?: {
|
|
28
|
+
matchLabels?: Record<string, string>;
|
|
29
|
+
matchExpressions?: Array<{
|
|
30
|
+
key: string;
|
|
31
|
+
operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist';
|
|
32
|
+
values?: string[];
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Network policy specification
|
|
38
|
+
* @since 2.7.0
|
|
39
|
+
*/
|
|
40
|
+
export interface NetworkPolicySpec {
|
|
41
|
+
/** Resource name */
|
|
42
|
+
name: string;
|
|
43
|
+
/** Pod selector to apply policy to */
|
|
44
|
+
podSelector: {
|
|
45
|
+
matchLabels?: Record<string, string>;
|
|
46
|
+
matchExpressions?: Array<{
|
|
47
|
+
key: string;
|
|
48
|
+
operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist';
|
|
49
|
+
values?: string[];
|
|
50
|
+
}>;
|
|
51
|
+
};
|
|
52
|
+
/** Policy types to apply */
|
|
53
|
+
policyTypes?: Array<'Ingress' | 'Egress'>;
|
|
54
|
+
/** Ingress rules */
|
|
55
|
+
ingress?: NetworkPolicyRule[];
|
|
56
|
+
/** Egress rules */
|
|
57
|
+
egress?: NetworkPolicyRule[];
|
|
58
|
+
/** Resource labels */
|
|
59
|
+
labels?: Record<string, string>;
|
|
60
|
+
/** Resource annotations */
|
|
61
|
+
annotations?: Record<string, string>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Ingress specification
|
|
65
|
+
* @since 2.7.0
|
|
66
|
+
*/
|
|
67
|
+
export interface IngressSpec {
|
|
68
|
+
/** Resource name */
|
|
69
|
+
name: string;
|
|
70
|
+
/** Ingress class name */
|
|
71
|
+
ingressClassName?: string;
|
|
72
|
+
/** TLS configuration */
|
|
73
|
+
tls?: Array<{
|
|
74
|
+
hosts?: string[];
|
|
75
|
+
secretName?: string;
|
|
76
|
+
}>;
|
|
77
|
+
/** Ingress rules */
|
|
78
|
+
rules?: Array<{
|
|
79
|
+
host?: string;
|
|
80
|
+
http?: {
|
|
81
|
+
paths: Array<{
|
|
82
|
+
path?: string;
|
|
83
|
+
pathType?: 'Exact' | 'Prefix' | 'ImplementationSpecific';
|
|
84
|
+
backend: {
|
|
85
|
+
service: {
|
|
86
|
+
name: string;
|
|
87
|
+
port: {
|
|
88
|
+
number?: number;
|
|
89
|
+
name?: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}>;
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
/** Resource labels */
|
|
97
|
+
labels?: Record<string, string>;
|
|
98
|
+
/** Resource annotations */
|
|
99
|
+
annotations?: Record<string, string>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Network resources provider for NetworkPolicy and Ingress
|
|
103
|
+
* @extends BaseResourceProvider
|
|
104
|
+
* @since 2.7.0
|
|
105
|
+
*/
|
|
106
|
+
export declare class NetworkResources extends BaseResourceProvider {
|
|
107
|
+
/**
|
|
108
|
+
* Creates a NetworkPolicy resource
|
|
109
|
+
* @param spec - NetworkPolicy specification
|
|
110
|
+
* @returns Created NetworkPolicy ApiObject
|
|
111
|
+
* @since 2.7.0
|
|
112
|
+
*/
|
|
113
|
+
addNetworkPolicy(spec: NetworkPolicySpec): ApiObject;
|
|
114
|
+
/**
|
|
115
|
+
* Creates a deny-all NetworkPolicy that blocks all ingress and egress traffic
|
|
116
|
+
* @param name - Policy name
|
|
117
|
+
* @param podSelector - Pod selector to apply policy to
|
|
118
|
+
* @param labels - Optional labels
|
|
119
|
+
* @param annotations - Optional annotations
|
|
120
|
+
* @returns Created NetworkPolicy ApiObject
|
|
121
|
+
* @since 2.7.0
|
|
122
|
+
*/
|
|
123
|
+
addDenyAllNetworkPolicy(name: string, podSelector?: NetworkPolicySpec['podSelector'], labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
|
|
124
|
+
/**
|
|
125
|
+
* Creates a NetworkPolicy that allows traffic from specific pods
|
|
126
|
+
* @param name - Policy name
|
|
127
|
+
* @param podSelector - Pod selector to apply policy to
|
|
128
|
+
* @param fromPodSelector - Pod selector for allowed source pods
|
|
129
|
+
* @param ports - Optional ports to allow
|
|
130
|
+
* @param labels - Optional labels
|
|
131
|
+
* @param annotations - Optional annotations
|
|
132
|
+
* @returns Created NetworkPolicy ApiObject
|
|
133
|
+
* @since 2.7.0
|
|
134
|
+
*/
|
|
135
|
+
addAllowFromPodsNetworkPolicy(name: string, podSelector: NetworkPolicySpec['podSelector'], fromPodSelector: NetworkPolicyRule['podSelector'], ports?: NetworkPolicyRule['ports'], labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
|
|
136
|
+
/**
|
|
137
|
+
* Creates a NetworkPolicy that allows traffic from specific namespaces
|
|
138
|
+
* @param name - Policy name
|
|
139
|
+
* @param podSelector - Pod selector to apply policy to
|
|
140
|
+
* @param fromNamespaceSelector - Namespace selector for allowed source namespaces
|
|
141
|
+
* @param ports - Optional ports to allow
|
|
142
|
+
* @param labels - Optional labels
|
|
143
|
+
* @param annotations - Optional annotations
|
|
144
|
+
* @returns Created NetworkPolicy ApiObject
|
|
145
|
+
* @since 2.7.0
|
|
146
|
+
*/
|
|
147
|
+
addAllowFromNamespaceNetworkPolicy(name: string, podSelector: NetworkPolicySpec['podSelector'], fromNamespaceSelector: NetworkPolicyRule['namespaceSelector'], ports?: NetworkPolicyRule['ports'], labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
|
|
148
|
+
/**
|
|
149
|
+
* Creates an Ingress resource
|
|
150
|
+
* @param spec - Ingress specification
|
|
151
|
+
* @returns Created Ingress ApiObject
|
|
152
|
+
* @since 2.7.0
|
|
153
|
+
*/
|
|
154
|
+
addIngress(spec: IngressSpec): ApiObject;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=networkResources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkResources.d.ts","sourceRoot":"","sources":["../../../../src/lib/resources/network/networkResources.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;KACnC,CAAC,CAAC;IACH,oCAAoC;IACpC,WAAW,C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AE,MAAM,EACZ,WAAW,GAAE,iBAAiB,CAAC,aAAa,CAAM,EAClD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,SAAS;IAYZ;;;;;;;;;;OAUG;IACH,6BAA6B,CAC3B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAC7C,eAAe,EAAE,iBAAiB,CAAC,aAAa,CAAC,EACjD,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,SAAS;IAqBZ;;;;;;;;;;OAUG;IACH,kCAAkC,CAChC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAC7C,qBAAqB,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,EAC7D,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,SAAS;IAqBZ;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS;CAwBzC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Network resources for Kubernetes networking
|
|
3
|
+
* @since 2.7.0
|
|
4
|
+
*/
|
|
5
|
+
import { BaseResourceProvider } from '../baseResourceProvider.js';
|
|
6
|
+
/**
|
|
7
|
+
* Network resources provider for NetworkPolicy and Ingress
|
|
8
|
+
* @extends BaseResourceProvider
|
|
9
|
+
* @since 2.7.0
|
|
10
|
+
*/
|
|
11
|
+
export class NetworkResources extends BaseResourceProvider {
|
|
12
|
+
/**
|
|
13
|
+
* Creates a NetworkPolicy resource
|
|
14
|
+
* @param spec - NetworkPolicy specification
|
|
15
|
+
* @returns Created NetworkPolicy ApiObject
|
|
16
|
+
* @since 2.7.0
|
|
17
|
+
*/
|
|
18
|
+
addNetworkPolicy(spec) {
|
|
19
|
+
const policySpec = {
|
|
20
|
+
podSelector: spec.podSelector,
|
|
21
|
+
};
|
|
22
|
+
if (spec.policyTypes) {
|
|
23
|
+
policySpec['policyTypes'] = spec.policyTypes;
|
|
24
|
+
}
|
|
25
|
+
if (spec.ingress) {
|
|
26
|
+
policySpec['ingress'] = spec.ingress;
|
|
27
|
+
}
|
|
28
|
+
if (spec.egress) {
|
|
29
|
+
policySpec['egress'] = spec.egress;
|
|
30
|
+
}
|
|
31
|
+
return this.createApiObject(spec.name, 'networking.k8s.io/v1', 'NetworkPolicy', policySpec, spec.labels, spec.annotations);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a deny-all NetworkPolicy that blocks all ingress and egress traffic
|
|
35
|
+
* @param name - Policy name
|
|
36
|
+
* @param podSelector - Pod selector to apply policy to
|
|
37
|
+
* @param labels - Optional labels
|
|
38
|
+
* @param annotations - Optional annotations
|
|
39
|
+
* @returns Created NetworkPolicy ApiObject
|
|
40
|
+
* @since 2.7.0
|
|
41
|
+
*/
|
|
42
|
+
addDenyAllNetworkPolicy(name, podSelector = {}, labels, annotations) {
|
|
43
|
+
return this.addNetworkPolicy({
|
|
44
|
+
name,
|
|
45
|
+
podSelector,
|
|
46
|
+
policyTypes: ['Ingress', 'Egress'],
|
|
47
|
+
ingress: [],
|
|
48
|
+
egress: [],
|
|
49
|
+
...(labels && { labels }),
|
|
50
|
+
...(annotations && { annotations }),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates a NetworkPolicy that allows traffic from specific pods
|
|
55
|
+
* @param name - Policy name
|
|
56
|
+
* @param podSelector - Pod selector to apply policy to
|
|
57
|
+
* @param fromPodSelector - Pod selector for allowed source pods
|
|
58
|
+
* @param ports - Optional ports to allow
|
|
59
|
+
* @param labels - Optional labels
|
|
60
|
+
* @param annotations - Optional annotations
|
|
61
|
+
* @returns Created NetworkPolicy ApiObject
|
|
62
|
+
* @since 2.7.0
|
|
63
|
+
*/
|
|
64
|
+
addAllowFromPodsNetworkPolicy(name, podSelector, fromPodSelector, ports, labels, annotations) {
|
|
65
|
+
const ingressRule = {};
|
|
66
|
+
if (fromPodSelector) {
|
|
67
|
+
ingressRule.podSelector = fromPodSelector;
|
|
68
|
+
}
|
|
69
|
+
if (ports) {
|
|
70
|
+
ingressRule.ports = ports;
|
|
71
|
+
}
|
|
72
|
+
return this.addNetworkPolicy({
|
|
73
|
+
name,
|
|
74
|
+
podSelector,
|
|
75
|
+
policyTypes: ['Ingress'],
|
|
76
|
+
ingress: [ingressRule],
|
|
77
|
+
...(labels && { labels }),
|
|
78
|
+
...(annotations && { annotations }),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Creates a NetworkPolicy that allows traffic from specific namespaces
|
|
83
|
+
* @param name - Policy name
|
|
84
|
+
* @param podSelector - Pod selector to apply policy to
|
|
85
|
+
* @param fromNamespaceSelector - Namespace selector for allowed source namespaces
|
|
86
|
+
* @param ports - Optional ports to allow
|
|
87
|
+
* @param labels - Optional labels
|
|
88
|
+
* @param annotations - Optional annotations
|
|
89
|
+
* @returns Created NetworkPolicy ApiObject
|
|
90
|
+
* @since 2.7.0
|
|
91
|
+
*/
|
|
92
|
+
addAllowFromNamespaceNetworkPolicy(name, podSelector, fromNamespaceSelector, ports, labels, annotations) {
|
|
93
|
+
const ingressRule = {};
|
|
94
|
+
if (fromNamespaceSelector) {
|
|
95
|
+
ingressRule.namespaceSelector = fromNamespaceSelector;
|
|
96
|
+
}
|
|
97
|
+
if (ports) {
|
|
98
|
+
ingressRule.ports = ports;
|
|
99
|
+
}
|
|
100
|
+
return this.addNetworkPolicy({
|
|
101
|
+
name,
|
|
102
|
+
podSelector,
|
|
103
|
+
policyTypes: ['Ingress'],
|
|
104
|
+
ingress: [ingressRule],
|
|
105
|
+
...(labels && { labels }),
|
|
106
|
+
...(annotations && { annotations }),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates an Ingress resource
|
|
111
|
+
* @param spec - Ingress specification
|
|
112
|
+
* @returns Created Ingress ApiObject
|
|
113
|
+
* @since 2.7.0
|
|
114
|
+
*/
|
|
115
|
+
addIngress(spec) {
|
|
116
|
+
const ingressSpec = {};
|
|
117
|
+
if (spec.ingressClassName) {
|
|
118
|
+
ingressSpec['ingressClassName'] = spec.ingressClassName;
|
|
119
|
+
}
|
|
120
|
+
if (spec.tls) {
|
|
121
|
+
ingressSpec['tls'] = spec.tls;
|
|
122
|
+
}
|
|
123
|
+
if (spec.rules) {
|
|
124
|
+
ingressSpec['rules'] = spec.rules;
|
|
125
|
+
}
|
|
126
|
+
return this.createApiObject(spec.name, 'networking.k8s.io/v1', 'Ingress', ingressSpec, spec.labels, spec.annotations);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=networkResources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkResources.js","sourceRoot":"","sources":["../../../../src/lib/resources/network/networkResources.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAmGlE;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,oBAAoB;IACxD;;;;;OAKG;IACH,gBAAgB,CAAC,IAAuB;QACtC,MAAM,UAAU,GAA4B;YAC1C,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;QAEF,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,UAAU,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,WAAW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AC,IAAI,EACT,sBAAsB,EACtB,SAAS,EACT,WAAW,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,WAAW,CACjB,CAAC;IACJ,CAAC;CACF"}
|
package/dist/lib/rutter.d.ts
CHANGED
|
@@ -3,9 +3,12 @@ import type { Construct } from 'constructs';
|
|
|
3
3
|
import type { ApiObject } from 'cdk8s';
|
|
4
4
|
import type { DeploymentSpec, DaemonSetSpec, StatefulSetSpec, RoleSpec, ClusterRoleSpec, RoleBindingSpec, ClusterRoleBindingSpec, JobSpec, ServiceSpec, ConfigMapSpec, SecretSpec, ServiceAccountSpec } from './resources/core/coreResources.js';
|
|
5
5
|
import type { PersistentVolumeSpec, PersistentVolumeClaimSpec, StorageClassSpec } from './resources/core/storageResources.js';
|
|
6
|
-
import type { AWSEBSStorageClassSpec, AWSEFSStorageClassSpec, AWSIRSAServiceAccountSpec, AWSALBIngressSpec } from './resources/cloud/aws/awsResources.js';
|
|
6
|
+
import type { AWSEBSStorageClassSpec, AWSEFSStorageClassSpec, AWSIRSAServiceAccountSpec, AWSECRServiceAccountSpec, AWSALBIngressSpec } from './resources/cloud/aws/awsResources.js';
|
|
7
7
|
import type { AzureDiskStorageClassSpec, AzureFileStorageClassSpec, AzureAGICIngressSpec, AzureKeyVaultSecretProviderClassSpec, AzureACRServiceAccountSpec } from './resources/cloud/azure/azureResources.js';
|
|
8
|
-
import type { GCPPersistentDiskStorageClassSpec, GCPFilestoreStorageClassSpec, GCPGCEIngressSpec, GCPWorkloadIdentityServiceAccountSpec } from './resources/cloud/gcp/gcpResources.js';
|
|
8
|
+
import type { GCPPersistentDiskStorageClassSpec, GCPFilestoreStorageClassSpec, GCPGCEIngressSpec, GCPWorkloadIdentityServiceAccountSpec, GCPArtifactRegistryServiceAccountSpec } from './resources/cloud/gcp/gcpResources.js';
|
|
9
|
+
import type { HorizontalPodAutoscalerSpec, VerticalPodAutoscalerSpec, CronJobSpec } from './resources/autoscaling/autoscalingResources.js';
|
|
10
|
+
import type { NetworkPolicySpec, IngressSpec } from './resources/network/networkResources.js';
|
|
11
|
+
import type { KarpenterNodePoolSpec, KarpenterNodeClaimSpec, KarpenterEC2NodeClassSpec } from './resources/cloud/aws/karpenterResources.js';
|
|
9
12
|
import type { HelperDefinition } from './utils/helmHelpers.js';
|
|
10
13
|
import type { NamingStrategy } from './utils/resourceNaming.js';
|
|
11
14
|
/**
|
|
@@ -24,6 +27,9 @@ export declare class Rutter {
|
|
|
24
27
|
private readonly awsResources;
|
|
25
28
|
private readonly azureResources;
|
|
26
29
|
private readonly gcpResources;
|
|
30
|
+
private readonly autoscalingResources;
|
|
31
|
+
private readonly networkResources;
|
|
32
|
+
private readonly karpenterResources;
|
|
27
33
|
private readonly meta;
|
|
28
34
|
private readonly defaultValues;
|
|
29
35
|
private readonly envValues;
|
|
@@ -475,6 +481,292 @@ export declare class Rutter {
|
|
|
475
481
|
* @since 2.4.0
|
|
476
482
|
*/
|
|
477
483
|
addGCPWorkloadIdentityServiceAccount(spec: GCPWorkloadIdentityServiceAccountSpec): ApiObject;
|
|
484
|
+
/**
|
|
485
|
+
* Creates a ServiceAccount with GCP Artifact Registry access
|
|
486
|
+
* @param spec - Artifact Registry ServiceAccount specification
|
|
487
|
+
* @returns Created ServiceAccount ApiObject
|
|
488
|
+
*
|
|
489
|
+
* @example
|
|
490
|
+
* ```typescript
|
|
491
|
+
* rutter.addGCPArtifactRegistryServiceAccount({
|
|
492
|
+
* name: 'artifact-registry-sa',
|
|
493
|
+
* googleServiceAccount: 'my-gsa@project.iam.gserviceaccount.com'
|
|
494
|
+
* });
|
|
495
|
+
* ```
|
|
496
|
+
*
|
|
497
|
+
* @since 2.7.0
|
|
498
|
+
*/
|
|
499
|
+
addGCPArtifactRegistryServiceAccount(spec: GCPArtifactRegistryServiceAccountSpec): ApiObject;
|
|
500
|
+
/**
|
|
501
|
+
* Creates a Karpenter NodePool resource
|
|
502
|
+
* @param spec - NodePool specification
|
|
503
|
+
* @returns Created NodePool ApiObject
|
|
504
|
+
*
|
|
505
|
+
* @example
|
|
506
|
+
* ```typescript
|
|
507
|
+
* rutter.addKarpenterNodePool({
|
|
508
|
+
* name: 'default-nodepool',
|
|
509
|
+
* template: {
|
|
510
|
+
* spec: {
|
|
511
|
+
* nodeClassRef: {
|
|
512
|
+
* apiVersion: 'karpenter.k8s.aws/v1beta1',
|
|
513
|
+
* kind: 'EC2NodeClass',
|
|
514
|
+
* name: 'default'
|
|
515
|
+
* }
|
|
516
|
+
* }
|
|
517
|
+
* }
|
|
518
|
+
* });
|
|
519
|
+
* ```
|
|
520
|
+
*
|
|
521
|
+
* @since 2.7.0
|
|
522
|
+
*/
|
|
523
|
+
addKarpenterNodePool(spec: KarpenterNodePoolSpec): ApiObject;
|
|
524
|
+
/**
|
|
525
|
+
* Creates a Karpenter NodeClaim resource
|
|
526
|
+
* @param spec - NodeClaim specification
|
|
527
|
+
* @returns Created NodeClaim ApiObject
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```typescript
|
|
531
|
+
* rutter.addKarpenterNodeClaim({
|
|
532
|
+
* name: 'my-node-claim',
|
|
533
|
+
* nodeClassRef: {
|
|
534
|
+
* apiVersion: 'karpenter.k8s.aws/v1beta1',
|
|
535
|
+
* kind: 'EC2NodeClass',
|
|
536
|
+
* name: 'default'
|
|
537
|
+
* }
|
|
538
|
+
* });
|
|
539
|
+
* ```
|
|
540
|
+
*
|
|
541
|
+
* @since 2.7.0
|
|
542
|
+
*/
|
|
543
|
+
addKarpenterNodeClaim(spec: KarpenterNodeClaimSpec): ApiObject;
|
|
544
|
+
/**
|
|
545
|
+
* Creates a Karpenter EC2NodeClass resource
|
|
546
|
+
* @param spec - EC2NodeClass specification
|
|
547
|
+
* @returns Created EC2NodeClass ApiObject
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
* ```typescript
|
|
551
|
+
* rutter.addKarpenterEC2NodeClass({
|
|
552
|
+
* name: 'default',
|
|
553
|
+
* amiFamily: 'AL2',
|
|
554
|
+
* subnetSelectorTerms: [{ tags: { 'karpenter.sh/discovery': 'my-cluster' } }],
|
|
555
|
+
* securityGroupSelectorTerms: [{ tags: { 'karpenter.sh/discovery': 'my-cluster' } }]
|
|
556
|
+
* });
|
|
557
|
+
* ```
|
|
558
|
+
*
|
|
559
|
+
* @since 2.7.0
|
|
560
|
+
*/
|
|
561
|
+
addKarpenterEC2NodeClass(spec: KarpenterEC2NodeClassSpec): ApiObject;
|
|
562
|
+
/**
|
|
563
|
+
* Creates a NetworkPolicy resource
|
|
564
|
+
* @param spec - NetworkPolicy specification
|
|
565
|
+
* @returns Created NetworkPolicy ApiObject
|
|
566
|
+
*
|
|
567
|
+
* @example
|
|
568
|
+
* ```typescript
|
|
569
|
+
* rutter.addNetworkPolicy({
|
|
570
|
+
* name: 'deny-all',
|
|
571
|
+
* podSelector: {},
|
|
572
|
+
* policyTypes: ['Ingress', 'Egress']
|
|
573
|
+
* });
|
|
574
|
+
* ```
|
|
575
|
+
*
|
|
576
|
+
* @since 2.7.0
|
|
577
|
+
*/
|
|
578
|
+
addNetworkPolicy(spec: NetworkPolicySpec): ApiObject;
|
|
579
|
+
/**
|
|
580
|
+
* Creates a deny-all NetworkPolicy that blocks all traffic
|
|
581
|
+
* @param name - Policy name
|
|
582
|
+
* @param podSelector - Pod selector to apply policy to
|
|
583
|
+
* @param labels - Optional labels
|
|
584
|
+
* @param annotations - Optional annotations
|
|
585
|
+
* @returns Created NetworkPolicy ApiObject
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
* ```typescript
|
|
589
|
+
* rutter.addDenyAllNetworkPolicy('deny-all', { matchLabels: { app: 'web' } });
|
|
590
|
+
* ```
|
|
591
|
+
*
|
|
592
|
+
* @since 2.7.0
|
|
593
|
+
*/
|
|
594
|
+
addDenyAllNetworkPolicy(name: string, podSelector?: NetworkPolicySpec['podSelector'], labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
|
|
595
|
+
/**
|
|
596
|
+
* Creates a NetworkPolicy that allows traffic from specific pods
|
|
597
|
+
* @param name - Policy name
|
|
598
|
+
* @param podSelector - Pod selector to apply policy to
|
|
599
|
+
* @param fromPodSelector - Pod selector for allowed source pods
|
|
600
|
+
* @param ports - Optional ports to allow
|
|
601
|
+
* @param labels - Optional labels
|
|
602
|
+
* @param annotations - Optional annotations
|
|
603
|
+
* @returns Created NetworkPolicy ApiObject
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```typescript
|
|
607
|
+
* rutter.addAllowFromPodsNetworkPolicy(
|
|
608
|
+
* 'allow-from-frontend',
|
|
609
|
+
* { matchLabels: { app: 'backend' } },
|
|
610
|
+
* { matchLabels: { app: 'frontend' } },
|
|
611
|
+
* [{ port: 8080, protocol: 'TCP' }]
|
|
612
|
+
* );
|
|
613
|
+
* ```
|
|
614
|
+
*
|
|
615
|
+
* @since 2.7.0
|
|
616
|
+
*/
|
|
617
|
+
addAllowFromPodsNetworkPolicy(name: string, podSelector: NetworkPolicySpec['podSelector'], fromPodSelector: NetworkPolicySpec['podSelector'], ports?: Array<{
|
|
618
|
+
port?: number | string;
|
|
619
|
+
protocol?: 'TCP' | 'UDP' | 'SCTP';
|
|
620
|
+
}>, labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
|
|
621
|
+
/**
|
|
622
|
+
* Creates a NetworkPolicy that allows traffic from specific namespaces
|
|
623
|
+
* @param name - Policy name
|
|
624
|
+
* @param podSelector - Pod selector to apply policy to
|
|
625
|
+
* @param fromNamespaceSelector - Namespace selector for allowed source namespaces
|
|
626
|
+
* @param ports - Optional ports to allow
|
|
627
|
+
* @param labels - Optional labels
|
|
628
|
+
* @param annotations - Optional annotations
|
|
629
|
+
* @returns Created NetworkPolicy ApiObject
|
|
630
|
+
*
|
|
631
|
+
* @example
|
|
632
|
+
* ```typescript
|
|
633
|
+
* rutter.addAllowFromNamespaceNetworkPolicy(
|
|
634
|
+
* 'allow-from-monitoring',
|
|
635
|
+
* { matchLabels: { app: 'web' } },
|
|
636
|
+
* { matchLabels: { name: 'monitoring' } },
|
|
637
|
+
* [{ port: 9090, protocol: 'TCP' }]
|
|
638
|
+
* );
|
|
639
|
+
* ```
|
|
640
|
+
*
|
|
641
|
+
* @since 2.7.0
|
|
642
|
+
*/
|
|
643
|
+
addAllowFromNamespaceNetworkPolicy(name: string, podSelector: NetworkPolicySpec['podSelector'], fromNamespaceSelector: NetworkPolicySpec['podSelector'], ports?: Array<{
|
|
644
|
+
port?: number | string;
|
|
645
|
+
protocol?: 'TCP' | 'UDP' | 'SCTP';
|
|
646
|
+
}>, labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
|
|
647
|
+
/**
|
|
648
|
+
* Creates an Ingress resource
|
|
649
|
+
* @param spec - Ingress specification
|
|
650
|
+
* @returns Created Ingress ApiObject
|
|
651
|
+
*
|
|
652
|
+
* @example
|
|
653
|
+
* ```typescript
|
|
654
|
+
* rutter.addIngress({
|
|
655
|
+
* name: 'web-ingress',
|
|
656
|
+
* rules: [{
|
|
657
|
+
* host: 'example.com',
|
|
658
|
+
* http: {
|
|
659
|
+
* paths: [{
|
|
660
|
+
* path: '/',
|
|
661
|
+
* pathType: 'Prefix',
|
|
662
|
+
* backend: {
|
|
663
|
+
* service: { name: 'web-service', port: { number: 80 } }
|
|
664
|
+
* }
|
|
665
|
+
* }]
|
|
666
|
+
* }
|
|
667
|
+
* }]
|
|
668
|
+
* });
|
|
669
|
+
* ```
|
|
670
|
+
*
|
|
671
|
+
* @since 2.7.0
|
|
672
|
+
*/
|
|
673
|
+
addIngress(spec: IngressSpec): ApiObject;
|
|
674
|
+
/**
|
|
675
|
+
* Creates a ServiceAccount with ECR access annotations
|
|
676
|
+
* @param spec - ECR ServiceAccount specification
|
|
677
|
+
* @returns Created ServiceAccount ApiObject
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
* ```typescript
|
|
681
|
+
* rutter.addAWSECRServiceAccount({
|
|
682
|
+
* name: 'ecr-service-account',
|
|
683
|
+
* roleArn: 'arn:aws:iam::123456789012:role/ECRAccessRole'
|
|
684
|
+
* });
|
|
685
|
+
* ```
|
|
686
|
+
*
|
|
687
|
+
* @since 2.7.0
|
|
688
|
+
*/
|
|
689
|
+
addAWSECRServiceAccount(spec: AWSECRServiceAccountSpec): ApiObject;
|
|
690
|
+
/**
|
|
691
|
+
* Creates a Horizontal Pod Autoscaler (HPA) resource
|
|
692
|
+
* @param spec - HPA specification
|
|
693
|
+
* @returns Created HPA ApiObject
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* ```typescript
|
|
697
|
+
* rutter.addHorizontalPodAutoscaler({
|
|
698
|
+
* name: 'web-hpa',
|
|
699
|
+
* scaleTargetRef: {
|
|
700
|
+
* apiVersion: 'apps/v1',
|
|
701
|
+
* kind: 'Deployment',
|
|
702
|
+
* name: 'web-app'
|
|
703
|
+
* },
|
|
704
|
+
* minReplicas: 2,
|
|
705
|
+
* maxReplicas: 10,
|
|
706
|
+
* metrics: [{
|
|
707
|
+
* type: 'Resource',
|
|
708
|
+
* resource: {
|
|
709
|
+
* name: 'cpu',
|
|
710
|
+
* target: { type: 'Utilization', averageUtilization: 70 }
|
|
711
|
+
* }
|
|
712
|
+
* }]
|
|
713
|
+
* });
|
|
714
|
+
* ```
|
|
715
|
+
*
|
|
716
|
+
* @since 2.7.0
|
|
717
|
+
*/
|
|
718
|
+
addHorizontalPodAutoscaler(spec: HorizontalPodAutoscalerSpec): ApiObject;
|
|
719
|
+
/**
|
|
720
|
+
* Creates a Vertical Pod Autoscaler (VPA) resource
|
|
721
|
+
* @param spec - VPA specification
|
|
722
|
+
* @returns Created VPA ApiObject
|
|
723
|
+
*
|
|
724
|
+
* @example
|
|
725
|
+
* ```typescript
|
|
726
|
+
* rutter.addVerticalPodAutoscaler({
|
|
727
|
+
* name: 'web-vpa',
|
|
728
|
+
* targetRef: {
|
|
729
|
+
* apiVersion: 'apps/v1',
|
|
730
|
+
* kind: 'Deployment',
|
|
731
|
+
* name: 'web-app'
|
|
732
|
+
* },
|
|
733
|
+
* updatePolicy: { updateMode: 'Auto' }
|
|
734
|
+
* });
|
|
735
|
+
* ```
|
|
736
|
+
*
|
|
737
|
+
* @since 2.7.0
|
|
738
|
+
*/
|
|
739
|
+
addVerticalPodAutoscaler(spec: VerticalPodAutoscalerSpec): ApiObject;
|
|
740
|
+
/**
|
|
741
|
+
* Creates a CronJob resource
|
|
742
|
+
* @param spec - CronJob specification
|
|
743
|
+
* @returns Created CronJob ApiObject
|
|
744
|
+
*
|
|
745
|
+
* @example
|
|
746
|
+
* ```typescript
|
|
747
|
+
* rutter.addCronJob({
|
|
748
|
+
* name: 'backup-job',
|
|
749
|
+
* schedule: '0 2 * * *',
|
|
750
|
+
* jobTemplate: {
|
|
751
|
+
* spec: {
|
|
752
|
+
* template: {
|
|
753
|
+
* spec: {
|
|
754
|
+
* containers: [{
|
|
755
|
+
* name: 'backup',
|
|
756
|
+
* image: 'backup:latest',
|
|
757
|
+
* command: ['backup.sh']
|
|
758
|
+
* }],
|
|
759
|
+
* restartPolicy: 'OnFailure'
|
|
760
|
+
* }
|
|
761
|
+
* }
|
|
762
|
+
* }
|
|
763
|
+
* }
|
|
764
|
+
* });
|
|
765
|
+
* ```
|
|
766
|
+
*
|
|
767
|
+
* @since 2.7.0
|
|
768
|
+
*/
|
|
769
|
+
addCronJob(spec: CronJobSpec): ApiObject;
|
|
478
770
|
/**
|
|
479
771
|
* Adds a custom resource definition (CRD) YAML or object
|
|
480
772
|
* @param yamlOrObject - CRD YAML content string or object
|
package/dist/lib/rutter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rutter.d.ts","sourceRoot":"","sources":["../../src/lib/rutter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,SA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