@mark1russell7/kind 0.11.11 → 0.12.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/README.md +24 -2
- package/build/index.d.ts +106 -6
- package/build/index.js +360 -38
- package/build/index.js.map +1 -1
- package/build/{judge-0ku_4dsJ.d.ts → judge-BH4WtL3f.d.ts} +47 -15
- package/build/{judge-CLBiWALR.js → judge-CMQeiw8k.js} +13 -7
- package/build/{judge-CLBiWALR.js.map → judge-CMQeiw8k.js.map} +1 -1
- package/build/judge.d.ts +2 -2
- package/build/judge.js +1 -1
- package/image/agent.mjs +20 -6
- package/package.json +1 -1
- package/src/backends.ts +59 -4
- package/src/compose.ts +37 -2
|
@@ -4,9 +4,17 @@ import { Coupling, Gate, Poll, Stage, Timing } from "@mark1russell7/service";
|
|
|
4
4
|
import { RedisKnobs } from "@mark1russell7/service/redis";
|
|
5
5
|
import { SessionCheckKnobs } from "@mark1russell7/service/http-client";
|
|
6
6
|
//#region src/scenario.d.ts
|
|
7
|
-
/** A kube-proxy mode is the
|
|
7
|
+
/** A kube-proxy mode is the mode of kube-proxy on each node: iptables (the default of kind), IPVS or nftables. */
|
|
8
8
|
type KubeProxyMode = "iptables" | "ipvs" | "nftables";
|
|
9
9
|
declare const KUBE_PROXY_MODES: readonly KubeProxyMode[];
|
|
10
|
+
/**
|
|
11
|
+
* A dataplane is the path of a Service on each node, and the mode of a cell. It is kube-proxy in one
|
|
12
|
+
* of its modes, or `cilium`: Cilium is the CNI and replaces kube-proxy (`cilium.ts`).
|
|
13
|
+
*/
|
|
14
|
+
type Dataplane = KubeProxyMode | "cilium";
|
|
15
|
+
declare const DATAPLANES: readonly Dataplane[];
|
|
16
|
+
/** This function tells if a dataplane is a mode of kube-proxy. */
|
|
17
|
+
declare const isKubeProxyMode: (mode: Dataplane) => mode is KubeProxyMode;
|
|
10
18
|
/** A node image is the kind node image of one Kubernetes version, pinned by digest. */
|
|
11
19
|
interface NodeImage {
|
|
12
20
|
readonly kubernetes: string;
|
|
@@ -20,8 +28,8 @@ interface NodeImage {
|
|
|
20
28
|
declare const NODE_IMAGES: Readonly<Record<string, NodeImage>>;
|
|
21
29
|
/**
|
|
22
30
|
* A scenario is one kind cluster as data. The lab generates the configuration of kind from it, and
|
|
23
|
-
* nothing comes from a default of kind. The scenario gives the node count, the version, the
|
|
24
|
-
* of kube-proxy
|
|
31
|
+
* nothing comes from a default of kind. The scenario gives the node count, the version, the
|
|
32
|
+
* dataplane, the sync periods of kube-proxy, the CNI and the subnets.
|
|
25
33
|
*/
|
|
26
34
|
interface KindScenario {
|
|
27
35
|
/** This name names the cluster and its Docker network: lowercase letters, digits and dashes. */
|
|
@@ -30,15 +38,18 @@ interface KindScenario {
|
|
|
30
38
|
readonly kubernetes: string;
|
|
31
39
|
/** This count is the number of workers. The cluster also has one control plane. */
|
|
32
40
|
readonly workers: number;
|
|
41
|
+
/** This dataplane is the path of a Service on each node. */
|
|
42
|
+
readonly dataplane: Dataplane;
|
|
43
|
+
/** This is kube-proxy and its sync periods, or null when Cilium replaces kube-proxy. */
|
|
33
44
|
readonly kubeProxy: {
|
|
34
45
|
readonly mode: KubeProxyMode;
|
|
35
46
|
/** This time is the shortest interval between two syncs of the rules. */
|
|
36
47
|
readonly minSyncPeriod: Quantity;
|
|
37
48
|
/** This time is the interval of the full sync of the rules. */
|
|
38
49
|
readonly syncPeriod: Quantity;
|
|
39
|
-
};
|
|
40
|
-
/** This CNI is kindnet, the CNI of kind.
|
|
41
|
-
readonly cni: "kindnet";
|
|
50
|
+
} | null;
|
|
51
|
+
/** This CNI is kindnet, the CNI of kind, beside kube-proxy. The CNI of the dataplane `cilium` is Cilium. */
|
|
52
|
+
readonly cni: "kindnet" | "cilium";
|
|
42
53
|
readonly podSubnet: string;
|
|
43
54
|
readonly serviceSubnet: string;
|
|
44
55
|
/**
|
|
@@ -55,15 +66,21 @@ declare const ZONE_KEPT = "zone-a";
|
|
|
55
66
|
declare const ZONE_LOST = "zone-b";
|
|
56
67
|
/** This function gives the zone of the node at the position `at` of `nodeNames`, in a cluster of `count` nodes. */
|
|
57
68
|
declare const zoneOf: (at: number, count: number) => string;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
/**
|
|
70
|
+
* This function gives a scenario with the defaults of Kubernetes for kube-proxy, as explicit values.
|
|
71
|
+
* The dataplane `cilium` has no kube-proxy, and its CNI is Cilium.
|
|
72
|
+
*/
|
|
73
|
+
declare const scenario: (name: string, mode: Dataplane, workers: number, kubernetes?: string, zoned?: boolean) => KindScenario;
|
|
74
|
+
/**
|
|
75
|
+
* This function gives the problems of a scenario. A problem is a name that kind refuses, no image for
|
|
76
|
+
* the version, or a count out of range. A kube-proxy or a CNI that does not agree with the dataplane is a problem too.
|
|
77
|
+
*/
|
|
61
78
|
declare const scenarioProblems: (s: KindScenario) => string[];
|
|
62
79
|
/** This function gives the names of the node containers, as kind names them: the control plane, then each worker. */
|
|
63
80
|
declare const nodeNames: (s: KindScenario) => string[];
|
|
64
81
|
/** This function gives a duration as kube-proxy reads it, in whole milliseconds: `1s`, `500ms`. */
|
|
65
82
|
declare const goDuration: (amount: Quantity) => string;
|
|
66
|
-
/** This function gives the KubeProxyConfiguration patch of a scenario, as kubeadm reads it. */
|
|
83
|
+
/** This function gives the KubeProxyConfiguration patch of a scenario, as kubeadm reads it. It refuses a scenario with no kube-proxy. */
|
|
67
84
|
declare const kubeProxyPatch: (s: KindScenario) => string;
|
|
68
85
|
/** A kind configuration is the cluster file that `kind create cluster --config` reads. JSON is YAML, thus the lab writes it as JSON. */
|
|
69
86
|
interface KindConfig {
|
|
@@ -71,7 +88,8 @@ interface KindConfig {
|
|
|
71
88
|
readonly apiVersion: "kind.x-k8s.io/v1alpha4";
|
|
72
89
|
readonly networking: {
|
|
73
90
|
readonly ipFamily: "ipv4";
|
|
74
|
-
|
|
91
|
+
/** This mode is the mode of kube-proxy, or `none` for no kube-proxy. */
|
|
92
|
+
readonly kubeProxyMode: KubeProxyMode | "none";
|
|
75
93
|
readonly disableDefaultCNI: boolean;
|
|
76
94
|
readonly podSubnet: string;
|
|
77
95
|
readonly serviceSubnet: string;
|
|
@@ -83,7 +101,12 @@ interface KindConfig {
|
|
|
83
101
|
}>;
|
|
84
102
|
readonly kubeadmConfigPatches: readonly string[];
|
|
85
103
|
}
|
|
86
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* This function generates the configuration of kind from a scenario. It refuses a scenario with a
|
|
106
|
+
* problem. The dataplane `cilium` gets no kindnet, as the kind guide of Cilium 1.20.4 tells
|
|
107
|
+
* (`Documentation/installation/kind-configure.rst`). It also gets no kube-proxy, because Cilium
|
|
108
|
+
* replaces it (`Documentation/network/kubernetes/kubeproxy-free.rst`).
|
|
109
|
+
*/
|
|
87
110
|
declare const kindConfig: (s: KindScenario) => KindConfig;
|
|
88
111
|
/** This function gives the first and the last address of an IPv4 CIDR, as numbers. */
|
|
89
112
|
declare const cidrRange: (cidr: string) => [number, number];
|
|
@@ -300,6 +323,14 @@ interface Declaration {
|
|
|
300
323
|
* With `http/1.1` or no value, the edge is `node:http`.
|
|
301
324
|
*/
|
|
302
325
|
readonly protocol?: EdgeProtocol | undefined;
|
|
326
|
+
/**
|
|
327
|
+
* This flag is the shared gate (S6, candidate E). With true, the readiness probe that the kubelet
|
|
328
|
+
* reads leaves out each check of Redis, a dependency that each replica shares. Thus a failure of
|
|
329
|
+
* Redis keeps each replica in the endpoints. The controller still reads the checks of Redis, thus
|
|
330
|
+
* the service refuses each request at once with a 503. With false or no value, each check that
|
|
331
|
+
* gates readiness also gates the probe. A declaration with the gate needs Redis.
|
|
332
|
+
*/
|
|
333
|
+
readonly sharedGate?: boolean | undefined;
|
|
303
334
|
}
|
|
304
335
|
/** An edge protocol is the protocol of the HTTP edge of the service: HTTP/1.1, or HTTP/2 without TLS (`h2c`). */
|
|
305
336
|
type EdgeProtocol = "http/1.1" | "h2c";
|
|
@@ -545,7 +576,8 @@ interface KindCell<A = Quantity> {
|
|
|
545
576
|
readonly mesh?: Mesh | undefined;
|
|
546
577
|
/** This text names a system of the plan that the cell replaces with the service of this repository, or null. */
|
|
547
578
|
readonly substitutes: string | null;
|
|
548
|
-
|
|
579
|
+
/** This mode is the dataplane of the cluster of the cell: a mode of kube-proxy, or Cilium. */
|
|
580
|
+
readonly mode: Dataplane;
|
|
549
581
|
readonly workers: number;
|
|
550
582
|
readonly trigger: Trigger<A>;
|
|
551
583
|
readonly pod: PodSettings;
|
|
@@ -1148,5 +1180,5 @@ declare const quantileOf: (sorted: readonly number[], p: number) => number;
|
|
|
1148
1180
|
*/
|
|
1149
1181
|
declare const medianInterval: (sorted: readonly number[]) => [number, number];
|
|
1150
1182
|
//#endregion
|
|
1151
|
-
export { unitOf as $, secondsOf as $t, TriggerV1 as A,
|
|
1152
|
-
//# sourceMappingURL=judge-
|
|
1183
|
+
export { unitOf as $, secondsOf as $t, TriggerV1 as A, KubeProxyMode as An, restartsAt as At, RunCheck as B, kindConfig as Bn, stoppingOf as Bt, KindCellResult as C, WindowPrediction as Cn, kernelCounts as Ct, PredictionV1 as D, KUBE_PROXY_MODES as Dn, recordsOf as Dt, LoadSample as E, Dataplane as En, podsOf as Et, KIND_NOISE as F, ZONE_LOST as Fn, sliceEmptyOf as Ft, factsOf as G, zoneOf as Gn, CLIENT as Gt, checkRun as H, nodeNames as Hn, tunnelsOf as Ht, KindDecision as I, cidrOverlap as In, sliceReadyAt as It, observationEnd as J, PORT as Jt, judgeKind as K, HEALTH_PORT as Kt, KindVerdict as L, cidrRange as Ln, sliceReadyOf as Lt, upgrade as M, NodeImage as Mn, signalOf as Mt, upgradeCell as N, ZONE_KEPT as Nn, signalsOf as Nt, RunCheckV1 as O, KindConfig as On, requestsOf as Ot, Deleted as P, ZONE_LABEL as Pn, sliceDropOf as Pt, reusesReset as Q, seconds as Qt, LAST_SLACK as R, goDuration as Rn, slicesOf as Rt, KindCellRecordV1 as S, TriggerKind as Sn, isTunnelState as St, KindVerdictV1 as T, DATAPLANES as Tn, podsAt as Tt, cyclesOf as U, scenario as Un, ztunnelPodsOf as Ut, RunFacts as V, kubeProxyPatch as Vn, transitionOf as Vt, deletionsOf as W, scenarioProblems as Wn, ztunnelReplaced as Wt, propagationSource as X, SERVER as Xt, propagationOf as Y, REDIS as Yt, referenceOf as Z, bandOf as Zt, ClusterManifest as _, Replica as _n, deletionOf as _t, STAGES as a, Flap as an, PropagationSource as at, FORMAT_V1 as b, Template as bn, failuresOf as bt, readRecord as c, KubeletProbe as cn, RulesLine as ct, calibrationOf as d, MeshMode as dn, TCP_STATE as dt, showBand as en, updatesOf as et, cellsTable as f, NonePrediction as fn, TunnelLine as ft, BandV1 as g, Reference as gn, byNode as gt, timeSpread as h, RedisDeclaration as hn, byClients as ht, quantileOf as i, EdgeProtocol as in, PodLine as it, judge as j, NODE_IMAGES as jn, rulesOf as jt, RunFactsV1 as k, KindScenario as kn, restartOf as kt, Judged as l, Mesh as ln, SliceLine as lt, predictionText as m, Prediction as mn, backendsAt as mt, medianInterval as n, Cycle as nn, HBONE_PORT as nt, kindCellRecordSchema as o, KindCell as on, RecordLine as ot, medianText as p, PodSettings as pn, ZtunnelPodLine as pt, observationAfter as q, LOG_LABEL as qt, middle as r, Declaration as rn, Line as rt, kindCellRecordV1Schema as s, KindRun as sn, Request as st, RELATIVE as t, Band as tn, Endpoint as tt, TimeSpread as u, MeshFlavor as un, SocketLine as ut, EnvironmentManifest as v, ResetReuse as vn, dropOf as vt, KindCellV1 as w, Workload as wn, outcomesOf as wt, KindCellRecord as x, Trigger as xn, intakeOf as xt, FORMAT as y, Stack as yn, emptyOf as yt, Propagated as z, isKubeProxyMode as zn, socketsOf as zt };
|
|
1184
|
+
//# sourceMappingURL=judge-BH4WtL3f.d.ts.map
|
|
@@ -1328,11 +1328,12 @@ const TRIGGERS = [
|
|
|
1328
1328
|
"zone-loss",
|
|
1329
1329
|
"latency"
|
|
1330
1330
|
];
|
|
1331
|
-
const
|
|
1331
|
+
const KUBE_PROXY = [
|
|
1332
1332
|
"iptables",
|
|
1333
1333
|
"ipvs",
|
|
1334
1334
|
"nftables"
|
|
1335
1335
|
];
|
|
1336
|
+
const MODES = [...KUBE_PROXY, "cilium"];
|
|
1336
1337
|
const time = quantitySchema("time");
|
|
1337
1338
|
const extent = extentSchema("time");
|
|
1338
1339
|
const count = z.number().int().nonnegative();
|
|
@@ -1401,7 +1402,8 @@ const declaration = z.object({
|
|
|
1401
1402
|
threshold: time
|
|
1402
1403
|
}).nullable(),
|
|
1403
1404
|
lameDuck: z.boolean().optional(),
|
|
1404
|
-
protocol: z.enum(["http/1.1", "h2c"]).optional()
|
|
1405
|
+
protocol: z.enum(["http/1.1", "h2c"]).optional(),
|
|
1406
|
+
sharedGate: z.boolean().optional()
|
|
1405
1407
|
});
|
|
1406
1408
|
const replica = z.object({
|
|
1407
1409
|
pod: z.string(),
|
|
@@ -1443,15 +1445,19 @@ const manifest = z.object({
|
|
|
1443
1445
|
name: z.string(),
|
|
1444
1446
|
kubernetes: z.string(),
|
|
1445
1447
|
workers: count,
|
|
1448
|
+
dataplane: z.enum(MODES).optional(),
|
|
1446
1449
|
kubeProxy: z.object({
|
|
1447
|
-
mode: z.enum(
|
|
1450
|
+
mode: z.enum(KUBE_PROXY),
|
|
1448
1451
|
minSyncPeriod: time,
|
|
1449
1452
|
syncPeriod: time
|
|
1450
|
-
}),
|
|
1451
|
-
cni: z.
|
|
1453
|
+
}).nullable(),
|
|
1454
|
+
cni: z.enum(["kindnet", "cilium"]),
|
|
1452
1455
|
podSubnet: z.string(),
|
|
1453
1456
|
serviceSubnet: z.string()
|
|
1454
|
-
}),
|
|
1457
|
+
}).transform(({ dataplane, ...rest }) => ({
|
|
1458
|
+
...rest,
|
|
1459
|
+
dataplane: dataplane ?? rest.kubeProxy?.mode ?? "cilium"
|
|
1460
|
+
})),
|
|
1455
1461
|
cluster: z.object({
|
|
1456
1462
|
kind: z.string(),
|
|
1457
1463
|
nodeImage: z.string(),
|
|
@@ -1712,4 +1718,4 @@ const readRecord = (data) => {
|
|
|
1712
1718
|
//#endregion
|
|
1713
1719
|
export { rulesOf as $, RELATIVE as A, dropOf as B, observationEnd as C, reusesReset as D, referenceOf as E, TCP_STATE as F, kernelCounts as G, failuresOf as H, backendsAt as I, podsOf as J, outcomesOf as K, byClients as L, middle as M, quantileOf as N, unitOf as O, HBONE_PORT as P, restartsAt as Q, byNode as R, observationAfter as S, showBand as St, propagationSource as T, intakeOf as U, emptyOf as V, isTunnelState as W, requestsOf as X, recordsOf as Y, restartOf as Z, checkRun as _, REDIS as _t, calibrationOf as a, sliceReadyOf as at, factsOf as b, seconds as bt, predictionText as c, stoppingOf as ct, FORMAT_V1 as d, ztunnelPodsOf as dt, signalOf as et, judge as f, ztunnelReplaced as ft, LAST_SLACK as g, PORT as gt, KIND_NOISE as h, LOG_LABEL as ht, readRecord as i, sliceReadyAt as it, medianInterval as j, updatesOf as k, timeSpread as l, transitionOf as lt, upgradeCell as m, HEALTH_PORT as mt, kindCellRecordSchema as n, sliceDropOf as nt, cellsTable as o, slicesOf as ot, upgrade as p, CLIENT as pt, podsAt as q, kindCellRecordV1Schema as r, sliceEmptyOf as rt, medianText as s, socketsOf as st, STAGES as t, signalsOf as tt, FORMAT as u, tunnelsOf as ut, cyclesOf as v, SERVER as vt, propagationOf as w, judgeKind as x, secondsOf as xt, deletionsOf as y, bandOf as yt, deletionOf as z };
|
|
1714
1720
|
|
|
1715
|
-
//# sourceMappingURL=judge-
|
|
1721
|
+
//# sourceMappingURL=judge-CMQeiw8k.js.map
|