timonel 2.4.0 → 2.5.1
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 +13 -0
- package/dist/cli.js +33 -38
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/resources/core/coreResources.d.ts +182 -0
- package/dist/lib/resources/core/coreResources.d.ts.map +1 -1
- package/dist/lib/resources/core/coreResources.js +267 -20
- package/dist/lib/resources/core/coreResources.js.map +1 -1
- package/dist/lib/rutter.d.ts +13 -0
- package/dist/lib/rutter.d.ts.map +1 -1
- package/dist/lib/rutter.js +45 -16
- package/dist/lib/rutter.js.map +1 -1
- package/dist/lib/utils/helmHelpers.d.ts +58 -0
- package/dist/lib/utils/helmHelpers.d.ts.map +1 -0
- package/dist/lib/utils/helmHelpers.js +155 -0
- package/dist/lib/utils/helmHelpers.js.map +1 -0
- package/dist/lib/utils/podTemplates.d.ts +192 -0
- package/dist/lib/utils/podTemplates.d.ts.map +1 -0
- package/dist/lib/utils/podTemplates.js +331 -0
- package/dist/lib/utils/podTemplates.js.map +1 -0
- package/dist/lib/utils/resourceNaming.d.ts +57 -0
- package/dist/lib/utils/resourceNaming.d.ts.map +1 -0
- package/dist/lib/utils/resourceNaming.js +82 -0
- package/dist/lib/utils/resourceNaming.js.map +1 -0
- package/package.json +11 -4
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Helm chart helpers and templates
|
|
3
|
+
* @since 2.5.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Helper definition for Helm templates
|
|
7
|
+
* @interface HelperDefinition
|
|
8
|
+
* @since 2.5.0
|
|
9
|
+
*/
|
|
10
|
+
export interface HelperDefinition {
|
|
11
|
+
/** Helper name (without quotes or hyphens) */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Helper template content */
|
|
14
|
+
template: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Standard Helm chart helpers following best practices
|
|
18
|
+
* @since 2.5.0
|
|
19
|
+
*/
|
|
20
|
+
export declare const STANDARD_HELPERS: HelperDefinition[];
|
|
21
|
+
/**
|
|
22
|
+
* AWS-specific Helm helpers
|
|
23
|
+
* @since 2.5.0
|
|
24
|
+
*/
|
|
25
|
+
export declare const AWS_HELPERS: HelperDefinition[];
|
|
26
|
+
/**
|
|
27
|
+
* Azure-specific Helm helpers
|
|
28
|
+
* @since 2.5.0
|
|
29
|
+
*/
|
|
30
|
+
export declare const AZURE_HELPERS: HelperDefinition[];
|
|
31
|
+
/**
|
|
32
|
+
* GCP-specific Helm helpers
|
|
33
|
+
* @since 2.5.0
|
|
34
|
+
*/
|
|
35
|
+
export declare const GCP_HELPERS: HelperDefinition[];
|
|
36
|
+
/**
|
|
37
|
+
* Converts helper definitions to Helm template format
|
|
38
|
+
* @param helpers - Array of helper definitions
|
|
39
|
+
* @returns Formatted Helm template string
|
|
40
|
+
* @since 2.5.0
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatHelpers(helpers: HelperDefinition[]): string;
|
|
43
|
+
/**
|
|
44
|
+
* Gets default helpers based on cloud provider
|
|
45
|
+
* @param cloudProvider - Target cloud provider
|
|
46
|
+
* @returns Combined standard and cloud-specific helpers
|
|
47
|
+
* @since 2.5.0
|
|
48
|
+
*/
|
|
49
|
+
export declare function getDefaultHelpers(cloudProvider?: 'aws' | 'azure' | 'gcp'): HelperDefinition[];
|
|
50
|
+
/**
|
|
51
|
+
* Generates complete _helpers.tpl content
|
|
52
|
+
* @param cloudProvider - Optional cloud provider for specific helpers
|
|
53
|
+
* @param customHelpers - Additional custom helpers
|
|
54
|
+
* @returns Complete helpers template content
|
|
55
|
+
* @since 2.5.0
|
|
56
|
+
*/
|
|
57
|
+
export declare function generateHelpersTemplate(cloudProvider?: 'aws' | 'azure' | 'gcp', customHelpers?: HelperDefinition[]): string;
|
|
58
|
+
//# sourceMappingURL=helmHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helmHelpers.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/helmHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,EAoC9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAiBzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,gBAAgB,EAa3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAazC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAWjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,gBAAgB,EAAE,CAgB7F;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,KAAK,EACvC,aAAa,CAAC,EAAE,gBAAgB,EAAE,GACjC,MAAM,CAQR"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Helm chart helpers and templates
|
|
3
|
+
* @since 2.5.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Standard Helm chart helpers following best practices
|
|
7
|
+
* @since 2.5.0
|
|
8
|
+
*/
|
|
9
|
+
export const STANDARD_HELPERS = [
|
|
10
|
+
{
|
|
11
|
+
name: 'chart.name',
|
|
12
|
+
template: `{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}`,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'chart.fullname',
|
|
16
|
+
template: `{{- if .Values.fullnameOverride }}
|
|
17
|
+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
18
|
+
{{- else }}
|
|
19
|
+
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
20
|
+
{{- if contains $name .Release.Name }}
|
|
21
|
+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
|
22
|
+
{{- else }}
|
|
23
|
+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
|
24
|
+
{{- end }}
|
|
25
|
+
{{- end }}`,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'chart.chart',
|
|
29
|
+
template: `{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}`,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'chart.labels',
|
|
33
|
+
template: `helm.sh/chart: {{ include "chart.chart" . }}
|
|
34
|
+
{{ include "chart.selectorLabels" . }}
|
|
35
|
+
{{- if .Chart.AppVersion }}
|
|
36
|
+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
37
|
+
{{- end }}
|
|
38
|
+
app.kubernetes.io/managed-by: {{ .Release.Service }}`,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'chart.selectorLabels',
|
|
42
|
+
template: `app.kubernetes.io/name: {{ include "chart.name" . }}
|
|
43
|
+
app.kubernetes.io/instance: {{ .Release.Name }}`,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* AWS-specific Helm helpers
|
|
48
|
+
* @since 2.5.0
|
|
49
|
+
*/
|
|
50
|
+
export const AWS_HELPERS = [
|
|
51
|
+
{
|
|
52
|
+
name: 'aws.region',
|
|
53
|
+
template: `{{- .Values.aws.region | default "us-east-1" }}`,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'aws.accountId',
|
|
57
|
+
template: `{{- required "AWS Account ID is required" .Values.aws.accountId }}`,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'aws.irsaRoleArn',
|
|
61
|
+
template: `{{- printf "arn:aws:iam::%s:role/%s" (include "aws.accountId" .) .Values.aws.irsaRoleName }}`,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'aws.ecrRepository',
|
|
65
|
+
template: `{{- printf "%s.dkr.ecr.%s.amazonaws.com/%s" (include "aws.accountId" .) (include "aws.region" .) .Values.aws.ecrRepositoryName }}`,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* Azure-specific Helm helpers
|
|
70
|
+
* @since 2.5.0
|
|
71
|
+
*/
|
|
72
|
+
export const AZURE_HELPERS = [
|
|
73
|
+
{
|
|
74
|
+
name: 'azure.resourceGroup',
|
|
75
|
+
template: `{{- required "Azure Resource Group is required" .Values.azure.resourceGroup }}`,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'azure.subscriptionId',
|
|
79
|
+
template: `{{- required "Azure Subscription ID is required" .Values.azure.subscriptionId }}`,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'azure.acrLoginServer',
|
|
83
|
+
template: `{{- printf "%s.azurecr.io" .Values.azure.acrName }}`,
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
/**
|
|
87
|
+
* GCP-specific Helm helpers
|
|
88
|
+
* @since 2.5.0
|
|
89
|
+
*/
|
|
90
|
+
export const GCP_HELPERS = [
|
|
91
|
+
{
|
|
92
|
+
name: 'gcp.projectId',
|
|
93
|
+
template: `{{- required "GCP Project ID is required" .Values.gcp.projectId }}`,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'gcp.region',
|
|
97
|
+
template: `{{- .Values.gcp.region | default "us-central1" }}`,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'gcp.garRepository',
|
|
101
|
+
template: `{{- printf "%s-docker.pkg.dev/%s/%s" (include "gcp.region" .) (include "gcp.projectId" .) .Values.gcp.repositoryName }}`,
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
/**
|
|
105
|
+
* Converts helper definitions to Helm template format
|
|
106
|
+
* @param helpers - Array of helper definitions
|
|
107
|
+
* @returns Formatted Helm template string
|
|
108
|
+
* @since 2.5.0
|
|
109
|
+
*/
|
|
110
|
+
export function formatHelpers(helpers) {
|
|
111
|
+
return helpers
|
|
112
|
+
.map((helper) => `{{/*
|
|
113
|
+
${helper.name}
|
|
114
|
+
*/}}
|
|
115
|
+
{{- define "${helper.name}" -}}
|
|
116
|
+
${helper.template}
|
|
117
|
+
{{- end }}`)
|
|
118
|
+
.join('\n\n');
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Gets default helpers based on cloud provider
|
|
122
|
+
* @param cloudProvider - Target cloud provider
|
|
123
|
+
* @returns Combined standard and cloud-specific helpers
|
|
124
|
+
* @since 2.5.0
|
|
125
|
+
*/
|
|
126
|
+
export function getDefaultHelpers(cloudProvider) {
|
|
127
|
+
const helpers = [...STANDARD_HELPERS];
|
|
128
|
+
switch (cloudProvider) {
|
|
129
|
+
case 'aws':
|
|
130
|
+
helpers.push(...AWS_HELPERS);
|
|
131
|
+
break;
|
|
132
|
+
case 'azure':
|
|
133
|
+
helpers.push(...AZURE_HELPERS);
|
|
134
|
+
break;
|
|
135
|
+
case 'gcp':
|
|
136
|
+
helpers.push(...GCP_HELPERS);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
return helpers;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Generates complete _helpers.tpl content
|
|
143
|
+
* @param cloudProvider - Optional cloud provider for specific helpers
|
|
144
|
+
* @param customHelpers - Additional custom helpers
|
|
145
|
+
* @returns Complete helpers template content
|
|
146
|
+
* @since 2.5.0
|
|
147
|
+
*/
|
|
148
|
+
export function generateHelpersTemplate(cloudProvider, customHelpers) {
|
|
149
|
+
const helpers = getDefaultHelpers(cloudProvider);
|
|
150
|
+
if (customHelpers) {
|
|
151
|
+
helpers.push(...customHelpers);
|
|
152
|
+
}
|
|
153
|
+
return formatHelpers(helpers);
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=helmHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helmHelpers.js","sourceRoot":"","sources":["../../../src/lib/utils/helmHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAuB;IAClD;QACE,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,6EAA6E;KACxF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE;;;;;;;;;WASH;KACR;IACD;QACE,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,gGAAgG;KAC3G;IACD;QACE,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE;;;;;qDAKuC;KAClD;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,QAAQ,EAAE;gDACkC;KAC7C;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAuB;IAC7C;QACE,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,iDAAiD;KAC5D;IACD;QACE,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,oEAAoE;KAC/E;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,8FAA8F;KACzG;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,mIAAmI;KAC9I;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAuB;IAC/C;QACE,IAAI,EAAE,qBAAqB;QAC3B,QAAQ,EAA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IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pod template utilities for generating reusable Kubernetes pod specifications
|
|
3
|
+
* @since 2.5.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Container specification for pod templates
|
|
7
|
+
* @interface ContainerSpec
|
|
8
|
+
* @since 2.5.0
|
|
9
|
+
*/
|
|
10
|
+
export interface ContainerSpec {
|
|
11
|
+
/** Container name */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Container image */
|
|
14
|
+
image: string;
|
|
15
|
+
/** Container port */
|
|
16
|
+
port?: number;
|
|
17
|
+
/** Environment variables */
|
|
18
|
+
env?: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
value?: string;
|
|
21
|
+
valueFrom?: unknown;
|
|
22
|
+
}>;
|
|
23
|
+
/** Resource requirements */
|
|
24
|
+
resources?: {
|
|
25
|
+
requests?: {
|
|
26
|
+
cpu?: string;
|
|
27
|
+
memory?: string;
|
|
28
|
+
};
|
|
29
|
+
limits?: {
|
|
30
|
+
cpu?: string;
|
|
31
|
+
memory?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Volume mounts */
|
|
35
|
+
volumeMounts?: Array<{
|
|
36
|
+
name: string;
|
|
37
|
+
mountPath: string;
|
|
38
|
+
readOnly?: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
/** Security context */
|
|
41
|
+
securityContext?: unknown;
|
|
42
|
+
/** Liveness probe */
|
|
43
|
+
livenessProbe?: unknown;
|
|
44
|
+
/** Readiness probe */
|
|
45
|
+
readinessProbe?: unknown;
|
|
46
|
+
/** Startup probe */
|
|
47
|
+
startupProbe?: unknown;
|
|
48
|
+
/** Command to run */
|
|
49
|
+
command?: string[];
|
|
50
|
+
/** Arguments to command */
|
|
51
|
+
args?: string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Pod template specification
|
|
55
|
+
* @interface PodTemplateSpec
|
|
56
|
+
* @since 2.5.0
|
|
57
|
+
*/
|
|
58
|
+
export interface PodTemplateSpec {
|
|
59
|
+
/** Pod name */
|
|
60
|
+
name: string;
|
|
61
|
+
/** Container specifications */
|
|
62
|
+
containers: ContainerSpec[];
|
|
63
|
+
/** Init containers */
|
|
64
|
+
initContainers?: ContainerSpec[];
|
|
65
|
+
/** Volumes */
|
|
66
|
+
volumes?: Array<unknown>;
|
|
67
|
+
/** Service account name */
|
|
68
|
+
serviceAccountName?: string;
|
|
69
|
+
/** Restart policy */
|
|
70
|
+
restartPolicy?: 'Always' | 'OnFailure' | 'Never';
|
|
71
|
+
/** Node selector */
|
|
72
|
+
nodeSelector?: Record<string, string>;
|
|
73
|
+
/** Tolerations */
|
|
74
|
+
tolerations?: Array<unknown>;
|
|
75
|
+
/** Affinity */
|
|
76
|
+
affinity?: unknown;
|
|
77
|
+
/** Security context */
|
|
78
|
+
securityContext?: unknown;
|
|
79
|
+
/** DNS policy */
|
|
80
|
+
dnsPolicy?: string;
|
|
81
|
+
/** Host network */
|
|
82
|
+
hostNetwork?: boolean;
|
|
83
|
+
/** Priority class name */
|
|
84
|
+
priorityClassName?: string;
|
|
85
|
+
/** Labels */
|
|
86
|
+
labels?: Record<string, string>;
|
|
87
|
+
/** Annotations */
|
|
88
|
+
annotations?: Record<string, string>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Security profile for pod templates
|
|
92
|
+
* @since 2.5.0
|
|
93
|
+
*/
|
|
94
|
+
export type SecurityProfile = 'baseline' | 'restricted' | 'privileged';
|
|
95
|
+
/**
|
|
96
|
+
* Workload type for pod templates
|
|
97
|
+
* @since 2.5.0
|
|
98
|
+
*/
|
|
99
|
+
export type WorkloadType = 'web' | 'api' | 'worker' | 'database' | 'cache' | 'batch';
|
|
100
|
+
/**
|
|
101
|
+
* Creates a secure pod template with best practices
|
|
102
|
+
* @param spec - Pod template specification
|
|
103
|
+
* @param profile - Security profile to apply
|
|
104
|
+
* @returns Pod template object
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const template = createSecurePodTemplate({
|
|
109
|
+
* name: 'web-app',
|
|
110
|
+
* containers: [{
|
|
111
|
+
* name: 'app',
|
|
112
|
+
* image: 'nginx:1.27',
|
|
113
|
+
* port: 80
|
|
114
|
+
* }]
|
|
115
|
+
* }, 'restricted');
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @since 2.5.0
|
|
119
|
+
*/
|
|
120
|
+
export declare function createSecurePodTemplate(spec: PodTemplateSpec, profile?: SecurityProfile): Record<string, unknown>;
|
|
121
|
+
/**
|
|
122
|
+
* Creates a workload-optimized pod template
|
|
123
|
+
* @param spec - Pod template specification
|
|
124
|
+
* @param workloadType - Type of workload
|
|
125
|
+
* @returns Pod template object
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* const template = createWorkloadPodTemplate({
|
|
130
|
+
* name: 'api-server',
|
|
131
|
+
* containers: [{
|
|
132
|
+
* name: 'api',
|
|
133
|
+
* image: 'myapi:latest',
|
|
134
|
+
* port: 8080
|
|
135
|
+
* }]
|
|
136
|
+
* }, 'api');
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* @since 2.5.0
|
|
140
|
+
*/
|
|
141
|
+
export declare function createWorkloadPodTemplate(spec: PodTemplateSpec, workloadType: WorkloadType): Record<string, unknown>;
|
|
142
|
+
/**
|
|
143
|
+
* Creates a multi-container pod template with sidecar pattern
|
|
144
|
+
* @param mainContainer - Main application container
|
|
145
|
+
* @param sidecars - Sidecar containers
|
|
146
|
+
* @param options - Additional pod options
|
|
147
|
+
* @returns Pod template object
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const template = createSidecarPodTemplate(
|
|
152
|
+
* { name: 'app', image: 'myapp:latest', port: 8080 },
|
|
153
|
+
* [{ name: 'proxy', image: 'envoy:latest', port: 9901 }],
|
|
154
|
+
* { name: 'app-with-proxy' }
|
|
155
|
+
* );
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @since 2.5.0
|
|
159
|
+
*/
|
|
160
|
+
export declare function createSidecarPodTemplate(mainContainer: ContainerSpec, sidecars: ContainerSpec[], options: Partial<PodTemplateSpec>): Record<string, unknown>;
|
|
161
|
+
/**
|
|
162
|
+
* Creates a pod template with health checks
|
|
163
|
+
* @param spec - Pod template specification
|
|
164
|
+
* @param healthConfig - Health check configuration
|
|
165
|
+
* @returns Pod template object
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* const template = createHealthyPodTemplate({
|
|
170
|
+
* name: 'web-app',
|
|
171
|
+
* containers: [{
|
|
172
|
+
* name: 'app',
|
|
173
|
+
* image: 'nginx:1.27',
|
|
174
|
+
* port: 80
|
|
175
|
+
* }]
|
|
176
|
+
* }, {
|
|
177
|
+
* httpPath: '/health',
|
|
178
|
+
* port: 80
|
|
179
|
+
* });
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @since 2.5.0
|
|
183
|
+
*/
|
|
184
|
+
export declare function createHealthyPodTemplate(spec: PodTemplateSpec, healthConfig: {
|
|
185
|
+
httpPath?: string;
|
|
186
|
+
port?: number;
|
|
187
|
+
initialDelaySeconds?: number;
|
|
188
|
+
periodSeconds?: number;
|
|
189
|
+
timeoutSeconds?: number;
|
|
190
|
+
failureThreshold?: number;
|
|
191
|
+
}): Record<string, unknown>;
|
|
192
|
+
//# sourceMappingURL=podTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"podTemplates.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/podTemplates.ts"],"names":[],"m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