Skip to content

Commit 13c94ba

Browse files
authored
feat(deployment): upgrade contour to 1.31.1 (chart 20.0.3) (#6898)
1 parent f496899 commit 13c94ba

File tree

6 files changed

+52
-161
lines changed

6 files changed

+52
-161
lines changed

.github/workflows/typescript-typecheck.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
2424
with:
25-
version: 'v3.18.1'
25+
version: 'v3.18.4'
2626

2727
- name: install helm deps
2828
run:

deployment/generate.ts

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { execSync } from 'child_process';
22
import { readFile, writeFile } from 'fs/promises';
3-
import { gunzip } from 'node:zlib';
4-
import { Readable } from 'stream';
5-
import { gunzipSync } from 'zlib';
6-
import * as yaml from 'js-yaml';
73
import { compile } from 'json-schema-to-typescript';
8-
import { extract } from 'tar-stream';
94
import { fileSync } from 'tmp';
105
import { OTLP_COLLECTOR_CHART, VECTOR_HELM_CHART } from './utils/observability';
116
import { CONTOUR_CHART } from './utils/reverse-proxy';
@@ -17,33 +12,6 @@ async function generateJsonSchemaFromHelmValues(input: string) {
1712
return await readFile(jsonSchemaTempFile.name, 'utf-8').then(r => JSON.parse(r));
1813
}
1914

20-
function getFileFromTar(tar: Readable, filename: string) {
21-
return new Promise(resolve => {
22-
const extractInstance = extract();
23-
24-
extractInstance.on('entry', function (header, stream, next) {
25-
if (header.name === filename) {
26-
let data = '';
27-
stream.on('data', chunk => (data += chunk));
28-
stream.on('end', () => {
29-
resolve(data);
30-
});
31-
}
32-
stream.on('end', function () {
33-
next(); // ready for next entry
34-
});
35-
36-
stream.resume(); // just auto drain the stream
37-
});
38-
39-
extractInstance.on('finish', function () {
40-
// all entries read
41-
});
42-
43-
tar.pipe(extractInstance);
44-
});
45-
}
46-
4715
async function generateOpenTelemetryCollectorTypes() {
4816
const jsonSchemaUrl = `https://raw.githubusercontent.com/open-telemetry/opentelemetry-helm-charts/opentelemetry-collector-${OTLP_COLLECTOR_CHART.version}/charts/opentelemetry-collector/values.schema.json`;
4917
const jsonSchema = await fetch(jsonSchemaUrl).then(res => res.json());
@@ -64,37 +32,8 @@ async function generateVectorDevTypes() {
6432
}
6533

6634
async function generateContourTypes() {
67-
let helmManifest = await fetch(`${CONTOUR_CHART.fetchOpts!['repo']}/index.yaml`, {
68-
redirect: 'follow',
69-
})
70-
.then(r => r.text())
71-
.then(r => yaml.load(r) as any);
72-
73-
let relevantChart = helmManifest.entries[CONTOUR_CHART['chart'] as string].find(
74-
entry => entry.version === CONTOUR_CHART.version,
75-
);
76-
77-
if (!relevantChart) {
78-
throw new Error(
79-
`Could not find chart ${CONTOUR_CHART['chart']} with version ${CONTOUR_CHART.version} in the Helm repository!`,
80-
);
81-
}
82-
83-
const url = relevantChart.urls.find((url: string) => url.endsWith('.tgz'));
84-
85-
if (!url) {
86-
throw new Error(
87-
`Could not find a .tgz file in the Helm repository for chart ${CONTOUR_CHART['chart']}!`,
88-
);
89-
}
90-
91-
const valuesFile = await fetch(url)
92-
.then(r => r.arrayBuffer())
93-
.then(r => Buffer.from(r))
94-
.then(r => gunzipSync(r))
95-
.then(r => Readable.from(r))
96-
.then(r => getFileFromTar(r, 'contour/values.yaml'))
97-
.then((r: any) => r.toString());
35+
const helmValuesFileUrl = `https://raw.githubusercontent.com/bitnami/charts/contour/${CONTOUR_CHART.version}/bitnami/contour/values.yaml`;
36+
const valuesFile = await fetch(helmValuesFileUrl).then(r => r.text());
9837

9938
const valuesTempFile = fileSync();
10039
await writeFile(valuesTempFile.name, valuesFile);

deployment/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@
1212
"@manypkg/get-packages": "2.2.2",
1313
"@pulumi/cloudflare": "4.16.0",
1414
"@pulumi/command": "1.0.1",
15-
"@pulumi/kubernetes": "4.19.0",
15+
"@pulumi/kubernetes": "4.23.0",
1616
"@pulumi/kubernetesx": "0.1.6",
17-
"@pulumi/pulumi": "3.145.0",
18-
"@pulumi/random": "4.16.2",
17+
"@pulumi/pulumi": "3.185.0",
18+
"@pulumi/random": "4.18.2",
1919
"js-yaml": "4.1.0",
20-
"pg-connection-string": "2.7.0",
21-
"prettier": "3.4.2",
22-
"tar-stream": "3.1.7"
20+
"pg-connection-string": "2.9.1",
21+
"prettier": "3.4.2"
2322
},
2423
"devDependencies": {
2524
"@types/js-yaml": "4.0.9",
2625
"@types/mime-types": "2.1.4",
2726
"@types/node": "22.10.5",
28-
"@types/tar-stream": "3.1.3",
2927
"@types/tmp": "0.2.6",
3028
"json-schema-to-typescript": "15.0.3",
3129
"tmp": "0.2.3",

deployment/utils/contour.types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,10 @@ export interface ContourValues {
796796
defaultStorageClass?: string;
797797
imagePullSecrets?: unknown[];
798798
imageRegistry?: string;
799+
security?: {
800+
allowInsecureImages?: boolean;
801+
[k: string]: unknown;
802+
};
799803
storageClass?: string;
800804
[k: string]: unknown;
801805
};
@@ -858,5 +862,6 @@ export interface ContourValues {
858862
[k: string]: unknown;
859863
};
860864
tlsExistingSecret?: string;
865+
useCertManager?: boolean;
861866
[k: string]: unknown;
862867
}

deployment/utils/reverse-proxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ContourValues } from './contour.types';
44
import { helmChart } from './helm';
55

66
// prettier-ignore
7-
export const CONTOUR_CHART = helmChart('https://raw.githubusercontent.com/bitnami/charts/refs/heads/index/bitnami/', 'contour', '19.3.1');
7+
export const CONTOUR_CHART = helmChart('https://raw.githubusercontent.com/bitnami/charts/refs/heads/index/bitnami/', 'contour', '20.0.3');
88

99
export class Proxy {
1010
private lbService: Output<k8s.core.v1.Service> | null = null;

0 commit comments

Comments
 (0)