@highstate/library 0.14.2 → 0.16.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/dist/highstate.library.msgpack +0 -0
- package/dist/index.js +1721 -953
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/abbreviations.ts +1 -0
- package/src/common/access-point.ts +2 -2
- package/src/common/files.ts +10 -0
- package/src/common/server.ts +15 -57
- package/src/databases/etcd.ts +97 -0
- package/src/databases/index.ts +1 -0
- package/src/databases/mariadb.ts +48 -2
- package/src/databases/mongodb.ts +48 -2
- package/src/databases/postgresql.ts +51 -2
- package/src/databases/redis.ts +48 -2
- package/src/databases/s3.ts +65 -6
- package/src/databases/shared.ts +12 -6
- package/src/dns.ts +59 -49
- package/src/k8s/apps/etcd.ts +46 -0
- package/src/k8s/apps/index.ts +2 -0
- package/src/k8s/apps/mariadb.ts +0 -5
- package/src/k8s/apps/minio.ts +0 -5
- package/src/k8s/apps/mongodb.ts +0 -5
- package/src/k8s/apps/postgresql.ts +0 -5
- package/src/k8s/apps/shared.ts +10 -1
- package/src/k8s/apps/traefik.ts +16 -1
- package/src/k8s/apps/valkey.ts +0 -5
- package/src/k8s/apps/wg-feed-server.ts +34 -0
- package/src/k8s/reduced-access.ts +23 -53
- package/src/k8s/resources.ts +78 -35
- package/src/k8s/service.ts +21 -10
- package/src/k8s/shared.ts +60 -90
- package/src/k8s/workload.ts +87 -26
- package/src/network/address-space.ts +94 -0
- package/src/network/address.ts +33 -0
- package/src/network/dynamic-endpoint.ts +39 -0
- package/src/network/endpoint-schema.ts +116 -0
- package/src/network/endpoint.ts +347 -0
- package/src/network/index.ts +6 -0
- package/src/network/subnet.ts +31 -0
- package/src/ssh.ts +66 -10
- package/src/third-party/cloudflare.ts +1 -0
- package/src/utils.ts +41 -11
- package/src/wireguard.ts +340 -150
- package/src/network.ts +0 -391
package/src/dns.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineEntity, defineUnit, z } from "@highstate/contract"
|
|
2
|
+
import { mapValues, pick } from "remeda"
|
|
3
|
+
import { serverEntity } from "./common/server"
|
|
2
4
|
import { implementationReferenceSchema } from "./impl-ref"
|
|
3
|
-
import {
|
|
4
|
-
import { arrayPatchModeSchema, prefixKeysWith } from "./utils"
|
|
5
|
+
import { l3EndpointEntity, l4EndpointEntity, networkArgs } from "./network"
|
|
5
6
|
|
|
6
7
|
export const providerEntity = defineEntity({
|
|
7
8
|
type: "dns.provider.v1",
|
|
@@ -13,11 +14,9 @@ export const providerEntity = defineEntity({
|
|
|
13
14
|
id: z.string(),
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* The
|
|
17
|
-
*
|
|
18
|
-
* If the provider manages multiple domains, the separate provider entity should be created for each domain.
|
|
17
|
+
* The zones managed by the DNS provider.
|
|
19
18
|
*/
|
|
20
|
-
|
|
19
|
+
zones: z.string().array(),
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* The reference to the implementation of the DNS provider.
|
|
@@ -34,13 +33,26 @@ export const recordSet = defineUnit({
|
|
|
34
33
|
type: "dns.record-set.v1",
|
|
35
34
|
|
|
36
35
|
args: {
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The FQDN of the DNS to create.
|
|
38
|
+
*
|
|
39
|
+
* If not provided, the name of the unit will be used.
|
|
40
|
+
*/
|
|
41
|
+
recordName: z.string().optional(),
|
|
38
42
|
|
|
39
43
|
/**
|
|
40
44
|
* The values of the DNS record.
|
|
45
|
+
*
|
|
46
|
+
* Will be parsed as endpoints and merged with provided L3/L4/L7 endpoint inputs.
|
|
41
47
|
*/
|
|
42
48
|
values: z.string().array().default([]),
|
|
43
49
|
|
|
50
|
+
...mapValues(
|
|
51
|
+
//
|
|
52
|
+
pick(networkArgs, ["endpointFilter"]),
|
|
53
|
+
arg => ({ ...arg, schema: arg.schema.default(`type != "hostname"`) }),
|
|
54
|
+
),
|
|
55
|
+
|
|
44
56
|
/**
|
|
45
57
|
* The TTL of the DNS record.
|
|
46
58
|
*/
|
|
@@ -57,6 +69,11 @@ export const recordSet = defineUnit({
|
|
|
57
69
|
* Available only for public IPs and some DNS providers like Cloudflare.
|
|
58
70
|
*/
|
|
59
71
|
proxied: z.boolean().default(false),
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Wait for the DNS record creation/update to be visible at local DNS before continuing.
|
|
75
|
+
*/
|
|
76
|
+
waitLocal: z.boolean().default(true),
|
|
60
77
|
},
|
|
61
78
|
|
|
62
79
|
inputs: {
|
|
@@ -70,6 +87,15 @@ export const recordSet = defineUnit({
|
|
|
70
87
|
multiple: true,
|
|
71
88
|
},
|
|
72
89
|
|
|
90
|
+
/**
|
|
91
|
+
* The servers to wait for the DNS records to be visible at before continuing.
|
|
92
|
+
*/
|
|
93
|
+
waitServers: {
|
|
94
|
+
entity: serverEntity,
|
|
95
|
+
required: false,
|
|
96
|
+
multiple: true,
|
|
97
|
+
},
|
|
98
|
+
|
|
73
99
|
/**
|
|
74
100
|
* The L3 endpoints to use as values of the DNS records.
|
|
75
101
|
*/
|
|
@@ -87,18 +113,44 @@ export const recordSet = defineUnit({
|
|
|
87
113
|
required: false,
|
|
88
114
|
multiple: true,
|
|
89
115
|
},
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The L7 endpoints to use as values of the DNS records.
|
|
119
|
+
*/
|
|
120
|
+
l7Endpoints: {
|
|
121
|
+
entity: l4EndpointEntity,
|
|
122
|
+
required: false,
|
|
123
|
+
multiple: true,
|
|
124
|
+
},
|
|
90
125
|
},
|
|
91
126
|
|
|
92
127
|
outputs: {
|
|
128
|
+
/**
|
|
129
|
+
* The filtered L3 endpoints with all IPs replaced with FQDNs.
|
|
130
|
+
* The duplicates are removed and metadata is merged.
|
|
131
|
+
*/
|
|
93
132
|
l3Endpoints: {
|
|
94
133
|
entity: l3EndpointEntity,
|
|
95
134
|
multiple: true,
|
|
96
135
|
},
|
|
97
136
|
|
|
137
|
+
/**
|
|
138
|
+
* The filtered L4 endpoints with all IPs replaced with FQDNs.
|
|
139
|
+
* The duplicates are removed and metadata is merged.
|
|
140
|
+
*/
|
|
98
141
|
l4Endpoints: {
|
|
99
142
|
entity: l4EndpointEntity,
|
|
100
143
|
multiple: true,
|
|
101
144
|
},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The filtered L7 endpoints with all IPs replaced with FQDNs.
|
|
148
|
+
* The duplicates are removed and metadata is merged.
|
|
149
|
+
*/
|
|
150
|
+
l7Endpoints: {
|
|
151
|
+
entity: l4EndpointEntity,
|
|
152
|
+
multiple: true,
|
|
153
|
+
},
|
|
102
154
|
},
|
|
103
155
|
|
|
104
156
|
meta: {
|
|
@@ -115,48 +167,6 @@ export const recordSet = defineUnit({
|
|
|
115
167
|
},
|
|
116
168
|
})
|
|
117
169
|
|
|
118
|
-
export function createArgs<TPrefix extends string = "">(prefix?: TPrefix) {
|
|
119
|
-
return prefixKeysWith(prefix, {
|
|
120
|
-
/**
|
|
121
|
-
* The FQDN to register the existing endpoints with.
|
|
122
|
-
*
|
|
123
|
-
* Will be inserted at the beginning of the resulting endpoint list.
|
|
124
|
-
*
|
|
125
|
-
* Will throw an error if no matching provider is found.
|
|
126
|
-
*/
|
|
127
|
-
fqdn: z.string().optional(),
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* The endpoint filter to filter the endpoints before creating the DNS records.
|
|
131
|
-
*
|
|
132
|
-
* Possible values:
|
|
133
|
-
*
|
|
134
|
-
* - `public`: only endpoints exposed to the public internet;
|
|
135
|
-
* - `external`: reachable from outside the system but not public (e.g., LAN, VPC);
|
|
136
|
-
* - `internal`: reachable only from within the system boundary (e.g., inside a cluster).
|
|
137
|
-
*
|
|
138
|
-
* You can select one or more values.
|
|
139
|
-
*
|
|
140
|
-
* If no value is provided, the endpoints will be filtered by the most accessible type:
|
|
141
|
-
*
|
|
142
|
-
* - if any public endpoints exist, all public endpoints are selected;
|
|
143
|
-
* - otherwise, if any external endpoints exist, all external endpoints are selected;
|
|
144
|
-
* - if neither exist, all internal endpoints are selected.
|
|
145
|
-
*/
|
|
146
|
-
endpointFilter: endpointFilterSchema.default([]),
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* The mode to use for patching the existing endpoints.
|
|
150
|
-
*
|
|
151
|
-
* - `prepend`: Prepend the FQDN to the existing endpoints. It will make them prioritized.
|
|
152
|
-
* - `replace`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.
|
|
153
|
-
*
|
|
154
|
-
* The default is `prepend`.
|
|
155
|
-
*/
|
|
156
|
-
patchMode: arrayPatchModeSchema.default("prepend"),
|
|
157
|
-
})
|
|
158
|
-
}
|
|
159
|
-
|
|
160
170
|
export const inputs = {
|
|
161
171
|
/**
|
|
162
172
|
* The DNS providers to use to create the DNS records.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
|
2
|
+
import { pick } from "remeda"
|
|
3
|
+
import * as databases from "../../databases"
|
|
4
|
+
import {
|
|
5
|
+
appName,
|
|
6
|
+
optionalSharedInputs,
|
|
7
|
+
sharedArgs,
|
|
8
|
+
sharedInputs,
|
|
9
|
+
sharedSecrets,
|
|
10
|
+
source,
|
|
11
|
+
} from "./shared"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The etcd instance deployed on Kubernetes.
|
|
15
|
+
*/
|
|
16
|
+
export const etcd = defineUnit({
|
|
17
|
+
type: "k8s.apps.etcd.v1",
|
|
18
|
+
|
|
19
|
+
args: {
|
|
20
|
+
...appName("etcd"),
|
|
21
|
+
...pick(sharedArgs, ["external"]),
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
secrets: {
|
|
25
|
+
...pick(sharedSecrets, ["backupKey"]),
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
inputs: {
|
|
29
|
+
...pick(sharedInputs, ["k8sCluster"]),
|
|
30
|
+
...pick(optionalSharedInputs, ["resticRepo"]),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
outputs: {
|
|
34
|
+
etcd: databases.etcdEntity,
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
meta: {
|
|
38
|
+
title: "etcd",
|
|
39
|
+
icon: "simple-icons:etcd",
|
|
40
|
+
iconColor: "#0069ab",
|
|
41
|
+
secondaryIcon: "mdi:database",
|
|
42
|
+
category: "Databases",
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
source: source("etcd/app"),
|
|
46
|
+
})
|
package/src/k8s/apps/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./code-server"
|
|
2
|
+
export * from "./etcd"
|
|
2
3
|
export * from "./grocy"
|
|
3
4
|
export * from "./hubble"
|
|
4
5
|
export * from "./kubernetes-dashboard"
|
|
@@ -22,4 +23,5 @@ export * from "./syncthing"
|
|
|
22
23
|
export * from "./traefik"
|
|
23
24
|
export * from "./valkey"
|
|
24
25
|
export * from "./vaultwarden"
|
|
26
|
+
export * from "./wg-feed-server"
|
|
25
27
|
export * from "./workload"
|
package/src/k8s/apps/mariadb.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
3
|
import * as databases from "../../databases"
|
|
4
|
-
import { l4EndpointEntity } from "../../network"
|
|
5
4
|
import { serviceEntity } from "../service"
|
|
6
5
|
import {
|
|
7
6
|
appName,
|
|
@@ -36,10 +35,6 @@ export const mariadb = defineUnit({
|
|
|
36
35
|
outputs: {
|
|
37
36
|
mariadb: databases.mariadbEntity,
|
|
38
37
|
service: serviceEntity,
|
|
39
|
-
endpoints: {
|
|
40
|
-
entity: l4EndpointEntity,
|
|
41
|
-
multiple: true,
|
|
42
|
-
},
|
|
43
38
|
},
|
|
44
39
|
|
|
45
40
|
meta: {
|
package/src/k8s/apps/minio.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { $secrets, defineUnit, text, z } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
3
|
import * as databases from "../../databases"
|
|
4
|
-
import { l4EndpointEntity } from "../../network"
|
|
5
4
|
import { serviceEntity } from "../service"
|
|
6
5
|
import { appName, optionalSharedInputs, sharedArgs, sharedInputs, source } from "./shared"
|
|
7
6
|
|
|
@@ -64,10 +63,6 @@ export const minio = defineUnit({
|
|
|
64
63
|
outputs: {
|
|
65
64
|
s3: databases.s3Entity,
|
|
66
65
|
service: serviceEntity,
|
|
67
|
-
endpoints: {
|
|
68
|
-
entity: l4EndpointEntity,
|
|
69
|
-
multiple: true,
|
|
70
|
-
},
|
|
71
66
|
},
|
|
72
67
|
|
|
73
68
|
meta: {
|
package/src/k8s/apps/mongodb.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
3
|
import * as databases from "../../databases"
|
|
4
|
-
import { l4EndpointEntity } from "../../network"
|
|
5
4
|
import { serviceEntity } from "../service"
|
|
6
5
|
import {
|
|
7
6
|
appName,
|
|
@@ -37,10 +36,6 @@ export const mongodb = defineUnit({
|
|
|
37
36
|
outputs: {
|
|
38
37
|
mongodb: databases.mongodbEntity,
|
|
39
38
|
service: serviceEntity,
|
|
40
|
-
endpoints: {
|
|
41
|
-
entity: l4EndpointEntity,
|
|
42
|
-
multiple: true,
|
|
43
|
-
},
|
|
44
39
|
},
|
|
45
40
|
|
|
46
41
|
meta: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
3
|
import * as databases from "../../databases"
|
|
4
|
-
import { l4EndpointEntity } from "../../network"
|
|
5
4
|
import { serviceEntity } from "../service"
|
|
6
5
|
import {
|
|
7
6
|
appName,
|
|
@@ -37,10 +36,6 @@ export const postgresql = defineUnit({
|
|
|
37
36
|
outputs: {
|
|
38
37
|
postgresql: databases.postgresqlEntity,
|
|
39
38
|
service: serviceEntity,
|
|
40
|
-
endpoints: {
|
|
41
|
-
entity: l4EndpointEntity,
|
|
42
|
-
multiple: true,
|
|
43
|
-
},
|
|
44
39
|
},
|
|
45
40
|
|
|
46
41
|
meta: {
|
package/src/k8s/apps/shared.ts
CHANGED
|
@@ -12,7 +12,13 @@ import {
|
|
|
12
12
|
} from "@highstate/contract"
|
|
13
13
|
import { mapValues } from "remeda"
|
|
14
14
|
import { accessPointEntity } from "../../common"
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
etcdEntity,
|
|
17
|
+
mariadbEntity,
|
|
18
|
+
mongodbEntity,
|
|
19
|
+
postgresqlEntity,
|
|
20
|
+
redisEntity,
|
|
21
|
+
} from "../../databases"
|
|
16
22
|
import { providerEntity } from "../../dns"
|
|
17
23
|
import { repositoryEntity } from "../../restic"
|
|
18
24
|
import { namespaceEntity, persistentVolumeClaimEntity } from "../resources"
|
|
@@ -141,6 +147,9 @@ export const sharedInputs = $inputs({
|
|
|
141
147
|
redis: {
|
|
142
148
|
entity: redisEntity,
|
|
143
149
|
},
|
|
150
|
+
etcd: {
|
|
151
|
+
entity: etcdEntity,
|
|
152
|
+
},
|
|
144
153
|
})
|
|
145
154
|
|
|
146
155
|
type ToOptionalInputs<T extends Record<string, FullComponentInputOptions>> = Simplify<{
|
package/src/k8s/apps/traefik.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const traefik = defineUnit({
|
|
|
13
13
|
|
|
14
14
|
args: {
|
|
15
15
|
...appName("traefik"),
|
|
16
|
-
...pick(sharedArgs, ["external", "replicas"
|
|
16
|
+
...pick(sharedArgs, ["external", "replicas"]),
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The name of the class to configure for ingress and gateway resources.
|
|
@@ -21,6 +21,21 @@ export const traefik = defineUnit({
|
|
|
21
21
|
* Defaults to "traefik".
|
|
22
22
|
*/
|
|
23
23
|
className: z.string().default("traefik"),
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Whether to create and enable reconciliation for Traefik CRDs.
|
|
27
|
+
*/
|
|
28
|
+
enableTraefikCrds: z.boolean().default(true),
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Whether to enable reconciliation for Ingress resources and create ingress class.
|
|
32
|
+
*/
|
|
33
|
+
enableIngressApi: z.boolean().default(true),
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Whether to enable reconciliation for Gateway API resources and create gateway class.
|
|
37
|
+
*/
|
|
38
|
+
enableGatewayApi: z.boolean().default(false),
|
|
24
39
|
},
|
|
25
40
|
|
|
26
41
|
inputs: {
|
package/src/k8s/apps/valkey.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
3
|
import { databases } from "../.."
|
|
4
|
-
import { l4EndpointEntity } from "../../network"
|
|
5
4
|
import { serviceEntity } from "../service"
|
|
6
5
|
import {
|
|
7
6
|
appName,
|
|
@@ -35,10 +34,6 @@ export const valkey = defineUnit({
|
|
|
35
34
|
outputs: {
|
|
36
35
|
redis: databases.redisEntity,
|
|
37
36
|
service: serviceEntity,
|
|
38
|
-
endpoints: {
|
|
39
|
-
entity: l4EndpointEntity,
|
|
40
|
-
multiple: true,
|
|
41
|
-
},
|
|
42
37
|
},
|
|
43
38
|
|
|
44
39
|
meta: {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
|
2
|
+
import { pick } from "remeda"
|
|
3
|
+
import { l4EndpointEntity } from "../../network"
|
|
4
|
+
import { appName, sharedArgs, sharedInputs, source } from "./shared"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The WG Feed Server deployed on Kubernetes.
|
|
8
|
+
*/
|
|
9
|
+
export const wgFeedServer = defineUnit({
|
|
10
|
+
type: "k8s.apps.wg-feed-server.v1",
|
|
11
|
+
|
|
12
|
+
args: {
|
|
13
|
+
...appName("wg-feed-server"),
|
|
14
|
+
...pick(sharedArgs, ["fqdn"]),
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
inputs: {
|
|
18
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint", "etcd"]),
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
outputs: {
|
|
22
|
+
endpoint: l4EndpointEntity,
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
meta: {
|
|
26
|
+
title: "WG Feed Server",
|
|
27
|
+
icon: "simple-icons:wireguard",
|
|
28
|
+
iconColor: "#88171a",
|
|
29
|
+
secondaryIcon: "mdi:broadcast",
|
|
30
|
+
category: "Wireguard",
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
source: source("wg-feed-server"),
|
|
34
|
+
})
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { defineUnit, z } from "@highstate/contract"
|
|
2
|
-
import {
|
|
3
|
-
import { serviceEntity } from "./service"
|
|
2
|
+
import { namespaceEntity, resourceEntity } from "./resources"
|
|
4
3
|
import { clusterEntity } from "./shared"
|
|
5
|
-
import { deploymentEntity, statefulSetEntity } from "./workload"
|
|
6
4
|
|
|
7
|
-
const
|
|
5
|
+
export const accessVerbSchema = z.enum([
|
|
8
6
|
"get",
|
|
9
7
|
"list",
|
|
10
8
|
"watch",
|
|
@@ -15,26 +13,34 @@ const k8sVerbsSchema = z.enum([
|
|
|
15
13
|
"deletecollection",
|
|
16
14
|
])
|
|
17
15
|
|
|
16
|
+
export const acessRuleSchema = z.object({
|
|
17
|
+
apiGroups: z.string().array(),
|
|
18
|
+
resources: z.string().array(),
|
|
19
|
+
verbs: accessVerbSchema.array(),
|
|
20
|
+
resourceNames: z.string().array().default([]),
|
|
21
|
+
})
|
|
22
|
+
|
|
18
23
|
/**
|
|
19
24
|
* Creates a reduced access cluster with ServiceAccount-based authentication for specific Kubernetes resources.
|
|
20
25
|
*/
|
|
21
26
|
export const reducedAccessCluster = defineUnit({
|
|
22
|
-
type: "k8s.reduced-access-cluster.
|
|
27
|
+
type: "k8s.reduced-access-cluster.v1",
|
|
23
28
|
|
|
24
29
|
args: {
|
|
25
30
|
/**
|
|
26
|
-
* The
|
|
31
|
+
* The name of the ServiceAccount to create.
|
|
27
32
|
*
|
|
28
|
-
*
|
|
33
|
+
* If not provided, will be the same as the unit name.
|
|
29
34
|
*/
|
|
30
|
-
|
|
35
|
+
serviceAccountName: z.string().optional(),
|
|
31
36
|
|
|
32
37
|
/**
|
|
33
|
-
* The
|
|
38
|
+
* The rules defining the access permissions for the ServiceAccount.
|
|
34
39
|
*
|
|
35
|
-
* If
|
|
40
|
+
* If rule's `apiGroups` and `resources` exactly match resources from the `resources` input,
|
|
41
|
+
* their names will be added to the rule's `resourceNames` list.
|
|
36
42
|
*/
|
|
37
|
-
|
|
43
|
+
rules: acessRuleSchema.array().default([]),
|
|
38
44
|
},
|
|
39
45
|
|
|
40
46
|
inputs: {
|
|
@@ -46,55 +52,19 @@ export const reducedAccessCluster = defineUnit({
|
|
|
46
52
|
namespace: namespaceEntity,
|
|
47
53
|
|
|
48
54
|
/**
|
|
49
|
-
* The
|
|
50
|
-
*/
|
|
51
|
-
deployments: {
|
|
52
|
-
entity: deploymentEntity,
|
|
53
|
-
multiple: true,
|
|
54
|
-
required: false,
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* The stateful sets to grant access to.
|
|
59
|
-
*/
|
|
60
|
-
statefulSets: {
|
|
61
|
-
entity: statefulSetEntity,
|
|
62
|
-
multiple: true,
|
|
63
|
-
required: false,
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* The services to grant access to.
|
|
68
|
-
*/
|
|
69
|
-
services: {
|
|
70
|
-
entity: serviceEntity,
|
|
71
|
-
multiple: true,
|
|
72
|
-
required: false,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* The persistent volume claims to grant access to.
|
|
77
|
-
*/
|
|
78
|
-
persistentVolumeClaims: {
|
|
79
|
-
entity: persistentVolumeClaimEntity,
|
|
80
|
-
multiple: true,
|
|
81
|
-
required: false,
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* The secrets to grant access to.
|
|
55
|
+
* The extra namespaces to bind to the ClusterRole and allow ServiceAccount to access them with specified rules.
|
|
86
56
|
*/
|
|
87
|
-
|
|
88
|
-
entity:
|
|
57
|
+
extraNamespaces: {
|
|
58
|
+
entity: namespaceEntity,
|
|
89
59
|
multiple: true,
|
|
90
60
|
required: false,
|
|
91
61
|
},
|
|
92
62
|
|
|
93
63
|
/**
|
|
94
|
-
* The
|
|
64
|
+
* The resources to which access will be granted.
|
|
95
65
|
*/
|
|
96
|
-
|
|
97
|
-
entity:
|
|
66
|
+
resources: {
|
|
67
|
+
entity: resourceEntity,
|
|
98
68
|
multiple: true,
|
|
99
69
|
required: false,
|
|
100
70
|
},
|