@crossdelta/infrastructure 0.11.7 → 0.11.9
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/dist/index.cjs +12 -5
- package/dist/index.js +12 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1142,7 +1142,7 @@ var CADDY_DEFAULTS = {
|
|
|
1142
1142
|
limits: { cpu: "200m", memory: "256Mi" }
|
|
1143
1143
|
},
|
|
1144
1144
|
storage: { size: "1Gi", storageClass: "do-block-storage" },
|
|
1145
|
-
healthCheck: { port:
|
|
1145
|
+
healthCheck: { port: 8080, path: "/healthz" }
|
|
1146
1146
|
};
|
|
1147
1147
|
var indent = (text, level) => {
|
|
1148
1148
|
const prefix = " ".repeat(level);
|
|
@@ -1172,8 +1172,11 @@ var generateHandleBlock = (handle, level, basicAuth) => {
|
|
|
1172
1172
|
${inner}
|
|
1173
1173
|
}`, level);
|
|
1174
1174
|
};
|
|
1175
|
-
var generateRouteBlock = (route, encode) => {
|
|
1175
|
+
var generateRouteBlock = (route, encode, useOnDemandTls) => {
|
|
1176
1176
|
const body = [];
|
|
1177
|
+
if (useOnDemandTls) {
|
|
1178
|
+
body.push(" tls {", " on_demand", " }");
|
|
1179
|
+
}
|
|
1177
1180
|
if (!route.redirect && encode?.length) {
|
|
1178
1181
|
body.push(` encode ${encode.join(" ")}`);
|
|
1179
1182
|
}
|
|
@@ -1232,9 +1235,10 @@ var generateCaddyfile = (config) => {
|
|
|
1232
1235
|
const healthCheckBlock = `:${healthCheck.port} {
|
|
1233
1236
|
respond ${healthCheck.path} 200
|
|
1234
1237
|
}`;
|
|
1238
|
+
const useOnDemandTls = config.onDemandTls != null;
|
|
1235
1239
|
const blocks = [
|
|
1236
1240
|
generateGlobalBlock(config),
|
|
1237
|
-
...config.routes.map((route) => generateRouteBlock(route, config.encode)),
|
|
1241
|
+
...config.routes.map((route) => generateRouteBlock(route, config.encode, useOnDemandTls)),
|
|
1238
1242
|
healthCheckBlock,
|
|
1239
1243
|
...config.catchAllUpstream && config.onDemandTls ? [generateCatchAllBlock(config.catchAllUpstream, config.encode)] : []
|
|
1240
1244
|
];
|
|
@@ -1267,7 +1271,8 @@ var deployCaddy = (provider, namespace, config) => {
|
|
|
1267
1271
|
image: "caddy:2-alpine",
|
|
1268
1272
|
ports: [
|
|
1269
1273
|
{ name: "https", containerPort: 443, protocol: "TCP" },
|
|
1270
|
-
{ name: "http", containerPort: 80, protocol: "TCP" }
|
|
1274
|
+
{ name: "http", containerPort: 80, protocol: "TCP" },
|
|
1275
|
+
{ name: "health", containerPort: healthCheck.port, protocol: "TCP" }
|
|
1271
1276
|
],
|
|
1272
1277
|
resources: buildResourceSpec(config.resources),
|
|
1273
1278
|
volumeMounts: [
|
|
@@ -1324,7 +1329,9 @@ var deployCaddy = (provider, namespace, config) => {
|
|
|
1324
1329
|
annotations: {
|
|
1325
1330
|
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-path": healthCheck.path,
|
|
1326
1331
|
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-protocol": "http",
|
|
1327
|
-
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-port": String(healthCheck.port)
|
|
1332
|
+
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-port": String(healthCheck.port),
|
|
1333
|
+
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-check-interval-seconds": "3",
|
|
1334
|
+
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-healthy-threshold": "3"
|
|
1328
1335
|
}
|
|
1329
1336
|
},
|
|
1330
1337
|
spec: {
|
package/dist/index.js
CHANGED
|
@@ -1046,7 +1046,7 @@ var CADDY_DEFAULTS = {
|
|
|
1046
1046
|
limits: { cpu: "200m", memory: "256Mi" }
|
|
1047
1047
|
},
|
|
1048
1048
|
storage: { size: "1Gi", storageClass: "do-block-storage" },
|
|
1049
|
-
healthCheck: { port:
|
|
1049
|
+
healthCheck: { port: 8080, path: "/healthz" }
|
|
1050
1050
|
};
|
|
1051
1051
|
var indent = (text, level) => {
|
|
1052
1052
|
const prefix = " ".repeat(level);
|
|
@@ -1076,8 +1076,11 @@ var generateHandleBlock = (handle, level, basicAuth) => {
|
|
|
1076
1076
|
${inner}
|
|
1077
1077
|
}`, level);
|
|
1078
1078
|
};
|
|
1079
|
-
var generateRouteBlock = (route, encode) => {
|
|
1079
|
+
var generateRouteBlock = (route, encode, useOnDemandTls) => {
|
|
1080
1080
|
const body = [];
|
|
1081
|
+
if (useOnDemandTls) {
|
|
1082
|
+
body.push(" tls {", " on_demand", " }");
|
|
1083
|
+
}
|
|
1081
1084
|
if (!route.redirect && encode?.length) {
|
|
1082
1085
|
body.push(` encode ${encode.join(" ")}`);
|
|
1083
1086
|
}
|
|
@@ -1136,9 +1139,10 @@ var generateCaddyfile = (config) => {
|
|
|
1136
1139
|
const healthCheckBlock = `:${healthCheck.port} {
|
|
1137
1140
|
respond ${healthCheck.path} 200
|
|
1138
1141
|
}`;
|
|
1142
|
+
const useOnDemandTls = config.onDemandTls != null;
|
|
1139
1143
|
const blocks = [
|
|
1140
1144
|
generateGlobalBlock(config),
|
|
1141
|
-
...config.routes.map((route) => generateRouteBlock(route, config.encode)),
|
|
1145
|
+
...config.routes.map((route) => generateRouteBlock(route, config.encode, useOnDemandTls)),
|
|
1142
1146
|
healthCheckBlock,
|
|
1143
1147
|
...config.catchAllUpstream && config.onDemandTls ? [generateCatchAllBlock(config.catchAllUpstream, config.encode)] : []
|
|
1144
1148
|
];
|
|
@@ -1171,7 +1175,8 @@ var deployCaddy = (provider, namespace, config) => {
|
|
|
1171
1175
|
image: "caddy:2-alpine",
|
|
1172
1176
|
ports: [
|
|
1173
1177
|
{ name: "https", containerPort: 443, protocol: "TCP" },
|
|
1174
|
-
{ name: "http", containerPort: 80, protocol: "TCP" }
|
|
1178
|
+
{ name: "http", containerPort: 80, protocol: "TCP" },
|
|
1179
|
+
{ name: "health", containerPort: healthCheck.port, protocol: "TCP" }
|
|
1175
1180
|
],
|
|
1176
1181
|
resources: buildResourceSpec(config.resources),
|
|
1177
1182
|
volumeMounts: [
|
|
@@ -1228,7 +1233,9 @@ var deployCaddy = (provider, namespace, config) => {
|
|
|
1228
1233
|
annotations: {
|
|
1229
1234
|
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-path": healthCheck.path,
|
|
1230
1235
|
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-protocol": "http",
|
|
1231
|
-
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-port": String(healthCheck.port)
|
|
1236
|
+
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-port": String(healthCheck.port),
|
|
1237
|
+
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-check-interval-seconds": "3",
|
|
1238
|
+
"service.beta.kubernetes.io/do-loadbalancer-healthcheck-healthy-threshold": "3"
|
|
1232
1239
|
}
|
|
1233
1240
|
},
|
|
1234
1241
|
spec: {
|