@highstate/library 0.9.16 → 0.9.19
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/highstate.library.msgpack +0 -0
- package/dist/index.js +3548 -2985
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/common/access-point.ts +105 -0
- package/src/common/files.ts +137 -0
- package/src/common/index.ts +3 -0
- package/src/common/server.ts +231 -0
- package/src/databases/index.ts +4 -0
- package/src/databases/mariadb.ts +37 -0
- package/src/databases/mongodb.ts +37 -0
- package/src/databases/postgresql.ts +37 -0
- package/src/databases/shared.ts +61 -0
- package/src/distributions/ubuntu.ts +13 -11
- package/src/dns.ts +116 -18
- package/src/git.ts +14 -10
- package/src/impl-ref.ts +26 -0
- package/src/index.ts +14 -15
- package/src/k3s.ts +14 -12
- package/src/k8s/apps/code-server.ts +48 -0
- package/src/k8s/apps/gitea.ts +25 -0
- package/src/k8s/apps/grocy.ts +39 -0
- package/src/k8s/apps/hubble.ts +30 -0
- package/src/{apps → k8s/apps}/index.ts +16 -13
- package/src/k8s/apps/kubernetes-dashboard.ts +28 -0
- package/src/k8s/apps/mariadb.ts +83 -0
- package/src/k8s/apps/maybe.ts +39 -0
- package/src/k8s/apps/mongodb.ts +84 -0
- package/src/k8s/apps/postgresql.ts +86 -0
- package/src/k8s/apps/shared.ts +149 -0
- package/src/k8s/apps/syncthing.ts +72 -0
- package/src/k8s/apps/traefik.ts +40 -0
- package/src/k8s/apps/vaultwarden.ts +31 -0
- package/src/k8s/apps/workload.ts +214 -0
- package/src/k8s/apps/zitadel.ts +26 -0
- package/src/k8s/cert-manager.ts +80 -0
- package/src/k8s/cilium.ts +64 -0
- package/src/k8s/gateway.ts +70 -0
- package/src/k8s/index.ts +9 -0
- package/src/{obfuscators → k8s/obfuscators}/phantun.ts +14 -10
- package/src/{obfuscators → k8s/obfuscators}/shared.ts +17 -11
- package/src/k8s/resources.ts +111 -0
- package/src/k8s/service.ts +65 -0
- package/src/k8s/shared.ts +343 -0
- package/src/k8s/workload.ts +77 -0
- package/src/network.ts +249 -63
- package/src/nixos.ts +38 -77
- package/src/proxmox.ts +203 -96
- package/src/restic.ts +28 -19
- package/src/sops.ts +19 -8
- package/src/ssh.ts +122 -24
- package/src/talos.ts +21 -19
- package/src/third-party/cloudflare.ts +59 -0
- package/src/third-party/index.ts +3 -0
- package/src/{mullvad.ts → third-party/mullvad.ts} +11 -9
- package/src/third-party/timeweb.ts +99 -0
- package/src/utils.ts +27 -6
- package/src/wireguard.ts +249 -115
- package/src/apps/code-server.ts +0 -34
- package/src/apps/deployment.ts +0 -60
- package/src/apps/dns.ts +0 -107
- package/src/apps/gitea.ts +0 -18
- package/src/apps/grocy.ts +0 -20
- package/src/apps/hubble.ts +0 -20
- package/src/apps/kubernetes-dashboard.ts +0 -19
- package/src/apps/mariadb.ts +0 -81
- package/src/apps/maybe.ts +0 -25
- package/src/apps/mongodb.ts +0 -81
- package/src/apps/network.ts +0 -55
- package/src/apps/postgresql.ts +0 -81
- package/src/apps/shared.ts +0 -290
- package/src/apps/syncthing.ts +0 -54
- package/src/apps/test.ts +0 -19
- package/src/apps/traefik.ts +0 -36
- package/src/apps/vaultwarden.ts +0 -23
- package/src/apps/zitadel.ts +0 -21
- package/src/cloudflare.ts +0 -26
- package/src/common.ts +0 -200
- package/src/files.ts +0 -146
- package/src/k8s.ts +0 -638
- package/src/timeweb.ts +0 -75
- package/src/{obfuscators → k8s/obfuscators}/index.ts +1 -1
@@ -0,0 +1,65 @@
|
|
1
|
+
import { defineEntity, z } from "@highstate/contract"
|
2
|
+
import { l4EndpointEntity } from "../network"
|
3
|
+
import { scopedResourceSchema } from "./resources"
|
4
|
+
|
5
|
+
export const endpointServiceMetadataSchema = z.object({
|
6
|
+
"k8s.service": z.object({
|
7
|
+
/**
|
8
|
+
* The ID of the cluster where the service is located.
|
9
|
+
*/
|
10
|
+
clusterId: z.string(),
|
11
|
+
|
12
|
+
/**
|
13
|
+
* The name of the cluster where the service is located.
|
14
|
+
*/
|
15
|
+
clusterName: z.string(),
|
16
|
+
|
17
|
+
/**
|
18
|
+
* The name of the service.
|
19
|
+
*/
|
20
|
+
name: z.string(),
|
21
|
+
|
22
|
+
/**
|
23
|
+
* The namespace of the service.
|
24
|
+
*/
|
25
|
+
namespace: z.string(),
|
26
|
+
|
27
|
+
/**
|
28
|
+
* The selector of the service.
|
29
|
+
*/
|
30
|
+
selector: z.record(z.string(), z.string()),
|
31
|
+
|
32
|
+
/**
|
33
|
+
* The target port of the service.
|
34
|
+
*/
|
35
|
+
targetPort: z.union([z.string(), z.number()]),
|
36
|
+
}),
|
37
|
+
})
|
38
|
+
|
39
|
+
export const serviceEndpointSchema = z.intersection(
|
40
|
+
l4EndpointEntity.schema,
|
41
|
+
z.object({
|
42
|
+
metadata: endpointServiceMetadataSchema,
|
43
|
+
}),
|
44
|
+
)
|
45
|
+
|
46
|
+
export const serviceEntity = defineEntity({
|
47
|
+
type: "k8s.service.v1",
|
48
|
+
|
49
|
+
schema: z.object({
|
50
|
+
...scopedResourceSchema.shape,
|
51
|
+
type: z.literal("service"),
|
52
|
+
endpoints: serviceEndpointSchema.array(),
|
53
|
+
}),
|
54
|
+
|
55
|
+
meta: {
|
56
|
+
color: "#2196F3",
|
57
|
+
},
|
58
|
+
})
|
59
|
+
|
60
|
+
export const serviceTypeSchema = z.enum(["NodePort", "LoadBalancer", "ClusterIP"])
|
61
|
+
|
62
|
+
export type EndpointServiceMetadata = z.infer<typeof endpointServiceMetadataSchema>
|
63
|
+
export type ServiceEndpoint = z.infer<typeof serviceEndpointSchema>
|
64
|
+
export type ServiceType = z.infer<typeof serviceTypeSchema>
|
65
|
+
export type Service = z.infer<typeof serviceEntity.schema>
|
@@ -0,0 +1,343 @@
|
|
1
|
+
import { $args, defineEntity, defineUnit, z } from "@highstate/contract"
|
2
|
+
import { serverEntity } from "../common"
|
3
|
+
import * as dns from "../dns"
|
4
|
+
import { implementationReferenceSchema } from "../impl-ref"
|
5
|
+
import { l3EndpointEntity, l4EndpointEntity } from "../network"
|
6
|
+
import { arrayPatchModeSchema } from "../utils"
|
7
|
+
import { scopedResourceSchema } from "./resources"
|
8
|
+
|
9
|
+
export const fallbackKubeApiAccessSchema = z.object({
|
10
|
+
serverIp: z.string(),
|
11
|
+
serverPort: z.number(),
|
12
|
+
})
|
13
|
+
|
14
|
+
export const tunDevicePolicySchema = z.union([
|
15
|
+
z.object({
|
16
|
+
type: z.literal("host"),
|
17
|
+
}),
|
18
|
+
z.object({
|
19
|
+
type: z.literal("plugin"),
|
20
|
+
resourceName: z.string(),
|
21
|
+
resourceValue: z.string(),
|
22
|
+
}),
|
23
|
+
])
|
24
|
+
|
25
|
+
export const externalServiceTypeSchema = z.enum(["NodePort", "LoadBalancer"])
|
26
|
+
export const scheduleOnMastersPolicySchema = z.enum(["always", "when-no-workers", "never"])
|
27
|
+
|
28
|
+
export const clusterQuirksSchema = z.object({
|
29
|
+
/**
|
30
|
+
* The IP and port of the kube-apiserver available from the cluster.
|
31
|
+
*
|
32
|
+
* Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.
|
33
|
+
*/
|
34
|
+
fallbackKubeApiAccess: fallbackKubeApiAccessSchema.optional(),
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Specifies the policy for using the tun device inside containers.
|
38
|
+
*
|
39
|
+
* If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.
|
40
|
+
*
|
41
|
+
* For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.
|
42
|
+
*/
|
43
|
+
tunDevicePolicy: tunDevicePolicySchema.optional(),
|
44
|
+
|
45
|
+
/**
|
46
|
+
* The service type to use for external services.
|
47
|
+
*
|
48
|
+
* If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.
|
49
|
+
*/
|
50
|
+
externalServiceType: externalServiceTypeSchema.optional(),
|
51
|
+
})
|
52
|
+
|
53
|
+
export const clusterInfoProperties = {
|
54
|
+
/**
|
55
|
+
* The unique identifier of the cluster.
|
56
|
+
*
|
57
|
+
* Should be defined as a `uid` of the `kube-system` namespace which is always present in the cluster.
|
58
|
+
*/
|
59
|
+
id: z.string(),
|
60
|
+
|
61
|
+
/**
|
62
|
+
* The ID of the connection to the cluster.
|
63
|
+
*
|
64
|
+
* If not explicitly set, should be the same as the cluster ID.
|
65
|
+
*
|
66
|
+
* When reducing cluster access, the `uid` of the service account should be used instead.
|
67
|
+
*/
|
68
|
+
connectionId: z.string(),
|
69
|
+
|
70
|
+
/**
|
71
|
+
* The name of the cluster.
|
72
|
+
*/
|
73
|
+
name: z.string(),
|
74
|
+
|
75
|
+
/**
|
76
|
+
* The optional reference to the network policy implementation.
|
77
|
+
*
|
78
|
+
* If not provided, the native Kubernetes NetworkPolicy implementation will be used.
|
79
|
+
*/
|
80
|
+
networkPolicyImplRef: implementationReferenceSchema.optional(),
|
81
|
+
|
82
|
+
/**
|
83
|
+
* The endpoints of the cluster nodes.
|
84
|
+
*
|
85
|
+
* The entry may represent real node endpoint or virtual endpoint (like a load balancer).
|
86
|
+
*
|
87
|
+
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
88
|
+
*/
|
89
|
+
endpoints: l3EndpointEntity.schema.array(),
|
90
|
+
|
91
|
+
/**
|
92
|
+
* The endpoints of the API server.
|
93
|
+
*
|
94
|
+
* The entry may represent real node endpoint or virtual endpoint (like a load balancer).
|
95
|
+
*
|
96
|
+
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
97
|
+
*/
|
98
|
+
apiEndpoints: l4EndpointEntity.schema.array(),
|
99
|
+
|
100
|
+
/**
|
101
|
+
* The external IPs of the cluster nodes allowed to be used for external access.
|
102
|
+
*/
|
103
|
+
externalIps: z.string().array(),
|
104
|
+
|
105
|
+
/**
|
106
|
+
* The extra quirks of the cluster to improve compatibility.
|
107
|
+
*/
|
108
|
+
quirks: clusterQuirksSchema.optional(),
|
109
|
+
|
110
|
+
/**
|
111
|
+
* The extra metadata to attach to the cluster.
|
112
|
+
*/
|
113
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
114
|
+
} as const
|
115
|
+
|
116
|
+
export const clusterEntity = defineEntity({
|
117
|
+
type: "k8s.cluster.v1",
|
118
|
+
|
119
|
+
schema: z.object({
|
120
|
+
...clusterInfoProperties,
|
121
|
+
kubeconfig: z.string(),
|
122
|
+
}),
|
123
|
+
|
124
|
+
meta: {
|
125
|
+
color: "#2196F3",
|
126
|
+
},
|
127
|
+
})
|
128
|
+
|
129
|
+
export const internalIpsPolicySchema = z.enum(["always", "public", "never"])
|
130
|
+
|
131
|
+
export const scheduleOnMastersPolicyArgs = $args({
|
132
|
+
/**
|
133
|
+
* The policy for scheduling workloads on master nodes.
|
134
|
+
*
|
135
|
+
* - `always`: always schedule workloads on master nodes regardless of the number of workers;
|
136
|
+
* - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);
|
137
|
+
* - `never`: never schedule workloads on master nodes.
|
138
|
+
*/
|
139
|
+
scheduleOnMastersPolicy: scheduleOnMastersPolicySchema.default("when-no-workers"),
|
140
|
+
})
|
141
|
+
|
142
|
+
export const clusterInputs = {
|
143
|
+
masters: {
|
144
|
+
entity: serverEntity,
|
145
|
+
multiple: true,
|
146
|
+
},
|
147
|
+
workers: {
|
148
|
+
entity: serverEntity,
|
149
|
+
multiple: true,
|
150
|
+
required: false,
|
151
|
+
},
|
152
|
+
} as const
|
153
|
+
|
154
|
+
export const clusterOutputs = {
|
155
|
+
k8sCluster: clusterEntity,
|
156
|
+
apiEndpoints: {
|
157
|
+
entity: l4EndpointEntity,
|
158
|
+
multiple: true,
|
159
|
+
},
|
160
|
+
endpoints: {
|
161
|
+
entity: l3EndpointEntity,
|
162
|
+
multiple: true,
|
163
|
+
},
|
164
|
+
} as const
|
165
|
+
|
166
|
+
/**
|
167
|
+
* The existing Kubernetes cluster created outside of the Highstate.
|
168
|
+
*/
|
169
|
+
export const existingCluster = defineUnit({
|
170
|
+
type: "k8s.existing-cluster.v1",
|
171
|
+
|
172
|
+
args: {
|
173
|
+
/**
|
174
|
+
* The list of external IPs of the cluster nodes allowed to be used for external access.
|
175
|
+
*
|
176
|
+
* If not provided, will be automatically detected by querying the cluster nodes.
|
177
|
+
*/
|
178
|
+
externalIps: z.string().array().optional(),
|
179
|
+
|
180
|
+
/**
|
181
|
+
* The policy for using internal IPs of the nodes as external IPs.
|
182
|
+
*
|
183
|
+
* - `always`: always use internal IPs as external IPs;
|
184
|
+
* - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
|
185
|
+
* - `never`: never use internal IPs as external IPs.
|
186
|
+
*/
|
187
|
+
internalIpsPolicy: internalIpsPolicySchema.default("public"),
|
188
|
+
|
189
|
+
/**
|
190
|
+
* The extra quirks of the cluster to improve compatibility.
|
191
|
+
*/
|
192
|
+
quirks: clusterQuirksSchema.optional(),
|
193
|
+
},
|
194
|
+
|
195
|
+
secrets: {
|
196
|
+
/**
|
197
|
+
* The kubeconfig of the cluster to use for connecting to the cluster.
|
198
|
+
*
|
199
|
+
* Will be available for all components using `cluster` output of this unit.
|
200
|
+
*/
|
201
|
+
kubeconfig: z.record(z.string(), z.unknown()),
|
202
|
+
},
|
203
|
+
|
204
|
+
outputs: clusterOutputs,
|
205
|
+
|
206
|
+
meta: {
|
207
|
+
title: "Existing Cluster",
|
208
|
+
icon: "devicon:kubernetes",
|
209
|
+
category: "Kubernetes",
|
210
|
+
},
|
211
|
+
|
212
|
+
source: {
|
213
|
+
package: "@highstate/k8s",
|
214
|
+
path: "units/existing-cluster",
|
215
|
+
},
|
216
|
+
})
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Patches some properties of the cluster and outputs the updated cluster.
|
220
|
+
*/
|
221
|
+
export const clusterPatch = defineUnit({
|
222
|
+
type: "k8s.cluster-patch.v1",
|
223
|
+
|
224
|
+
args: {
|
225
|
+
/**
|
226
|
+
* The endpoints of the API server.
|
227
|
+
*
|
228
|
+
* The entry may represent real node endpoint or virtual endpoint (like a load balancer).
|
229
|
+
*
|
230
|
+
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
231
|
+
*/
|
232
|
+
apiEndpoints: z.string().array().default([]),
|
233
|
+
|
234
|
+
/**
|
235
|
+
* The mode to use for patching the API endpoints.
|
236
|
+
*
|
237
|
+
* - `prepend`: prepend the new endpoints to the existing ones (default);
|
238
|
+
* - `replace`: replace the existing endpoints with the new ones.
|
239
|
+
*/
|
240
|
+
apiEndpointsPatchMode: arrayPatchModeSchema.default("prepend"),
|
241
|
+
|
242
|
+
/**
|
243
|
+
* The endpoints of the cluster nodes.
|
244
|
+
*
|
245
|
+
* The entry may represent real node endpoint or virtual endpoint (like a load balancer).
|
246
|
+
*
|
247
|
+
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
248
|
+
*/
|
249
|
+
endpoints: z.string().array().default([]),
|
250
|
+
|
251
|
+
/**
|
252
|
+
* The mode to use for patching the endpoints.
|
253
|
+
*
|
254
|
+
* - `prepend`: prepend the new endpoints to the existing ones (default);
|
255
|
+
* - `replace`: replace the existing endpoints with the new ones.
|
256
|
+
*/
|
257
|
+
endpointsPatchMode: arrayPatchModeSchema.default("prepend"),
|
258
|
+
},
|
259
|
+
|
260
|
+
inputs: {
|
261
|
+
k8sCluster: clusterEntity,
|
262
|
+
apiEndpoints: {
|
263
|
+
entity: l4EndpointEntity,
|
264
|
+
required: false,
|
265
|
+
multiple: true,
|
266
|
+
},
|
267
|
+
endpoints: {
|
268
|
+
entity: l3EndpointEntity,
|
269
|
+
required: false,
|
270
|
+
multiple: true,
|
271
|
+
},
|
272
|
+
},
|
273
|
+
|
274
|
+
outputs: clusterOutputs,
|
275
|
+
|
276
|
+
meta: {
|
277
|
+
title: "Cluster Patch",
|
278
|
+
icon: "devicon:kubernetes",
|
279
|
+
secondaryIcon: "fluent:patch-20-filled",
|
280
|
+
category: "Kubernetes",
|
281
|
+
},
|
282
|
+
|
283
|
+
source: {
|
284
|
+
package: "@highstate/k8s",
|
285
|
+
path: "units/cluster-patch",
|
286
|
+
},
|
287
|
+
})
|
288
|
+
|
289
|
+
/**
|
290
|
+
* Creates a set of DNS records for the cluster and updates the endpoints.
|
291
|
+
*/
|
292
|
+
export const clusterDns = defineUnit({
|
293
|
+
type: "k8s.cluster-dns.v1",
|
294
|
+
|
295
|
+
args: {
|
296
|
+
...dns.createArgs(),
|
297
|
+
...dns.createArgs("api"),
|
298
|
+
},
|
299
|
+
|
300
|
+
inputs: {
|
301
|
+
k8sCluster: clusterEntity,
|
302
|
+
...dns.inputs,
|
303
|
+
},
|
304
|
+
|
305
|
+
outputs: clusterOutputs,
|
306
|
+
|
307
|
+
meta: {
|
308
|
+
title: "Cluster DNS",
|
309
|
+
icon: "devicon:kubernetes",
|
310
|
+
secondaryIcon: "mdi:dns",
|
311
|
+
category: "Kubernetes",
|
312
|
+
},
|
313
|
+
|
314
|
+
source: {
|
315
|
+
package: "@highstate/k8s",
|
316
|
+
path: "units/cluster-dns",
|
317
|
+
},
|
318
|
+
})
|
319
|
+
|
320
|
+
export const monitorWorkerResourceGroupSchema = z.object({
|
321
|
+
type: z.enum(["deployment", "statefulset", "pod", "service"]),
|
322
|
+
namespace: z.string(),
|
323
|
+
names: z.string().array().optional(),
|
324
|
+
})
|
325
|
+
|
326
|
+
export const monitorWorkerParamsSchema = z.object({
|
327
|
+
/**
|
328
|
+
* The content of the kubeconfig to use for monitoring.
|
329
|
+
*/
|
330
|
+
kubeconfig: z.string(),
|
331
|
+
|
332
|
+
/**
|
333
|
+
* The resources to monitor in the cluster.
|
334
|
+
*/
|
335
|
+
resources: scopedResourceSchema.array(),
|
336
|
+
})
|
337
|
+
|
338
|
+
export type Cluster = z.infer<typeof clusterEntity.schema>
|
339
|
+
|
340
|
+
export type InternalIpsPolicy = z.infer<typeof internalIpsPolicySchema>
|
341
|
+
|
342
|
+
export type MonitorWorkerParams = z.infer<typeof monitorWorkerParamsSchema>
|
343
|
+
export type MonitorWorkerResourceGroup = z.infer<typeof monitorWorkerResourceGroupSchema>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import { defineEntity, z } from "@highstate/contract"
|
2
|
+
import { scopedResourceSchema } from "./resources"
|
3
|
+
import { serviceEntity } from "./service"
|
4
|
+
|
5
|
+
/**
|
6
|
+
* The entity which represents a Kubernetes deployment managed by Highstate.
|
7
|
+
*
|
8
|
+
* Also includes a service associated with the deployment.
|
9
|
+
*/
|
10
|
+
export const deploymentEntity = defineEntity({
|
11
|
+
type: "k8s.deployment.v1",
|
12
|
+
|
13
|
+
schema: z.object({
|
14
|
+
...scopedResourceSchema.shape,
|
15
|
+
type: z.literal("deployment"),
|
16
|
+
service: serviceEntity.schema.optional(),
|
17
|
+
}),
|
18
|
+
|
19
|
+
meta: {
|
20
|
+
color: "#4CAF50",
|
21
|
+
},
|
22
|
+
})
|
23
|
+
|
24
|
+
/**
|
25
|
+
* The entity which represents a Kubernetes stateful set managed by Highstate.
|
26
|
+
*
|
27
|
+
* Also includes a service associated with the stateful set.
|
28
|
+
*/
|
29
|
+
export const statefulSetEntity = defineEntity({
|
30
|
+
type: "k8s.stateful-set.v1",
|
31
|
+
|
32
|
+
schema: z.object({
|
33
|
+
...scopedResourceSchema.shape,
|
34
|
+
type: z.literal("stateful-set"),
|
35
|
+
service: serviceEntity.schema,
|
36
|
+
}),
|
37
|
+
|
38
|
+
meta: {
|
39
|
+
color: "#FFC107",
|
40
|
+
},
|
41
|
+
})
|
42
|
+
|
43
|
+
/**
|
44
|
+
* The entity which represents a Kubernetes workload exposed via a service.
|
45
|
+
*
|
46
|
+
* It can be either a deployment or a stateful set.
|
47
|
+
*/
|
48
|
+
export const exposableWorkloadEntity = defineEntity({
|
49
|
+
type: "k8s.exposable-workload.v1",
|
50
|
+
|
51
|
+
schema: z.union([deploymentEntity.schema, statefulSetEntity.schema]),
|
52
|
+
|
53
|
+
meta: {
|
54
|
+
color: "#4CAF50",
|
55
|
+
},
|
56
|
+
})
|
57
|
+
|
58
|
+
/**
|
59
|
+
* The network interface in a network namespace of the pod which can accept and transmit network traffic.
|
60
|
+
*/
|
61
|
+
export const networkInterfaceEntity = defineEntity({
|
62
|
+
type: "k8s.network-interface.v1",
|
63
|
+
|
64
|
+
schema: z.object({
|
65
|
+
name: z.string(),
|
66
|
+
workload: exposableWorkloadEntity.schema,
|
67
|
+
}),
|
68
|
+
|
69
|
+
meta: {
|
70
|
+
color: "#2196F3",
|
71
|
+
},
|
72
|
+
})
|
73
|
+
|
74
|
+
export type Deployment = z.infer<typeof deploymentEntity.schema>
|
75
|
+
export type StatefulSet = z.infer<typeof statefulSetEntity.schema>
|
76
|
+
export type ExposableWorkload = z.infer<typeof exposableWorkloadEntity.schema>
|
77
|
+
export type NetworkInterface = z.infer<typeof networkInterfaceEntity.schema>
|