Skip to content

Commit 00ea397

Browse files
committed
Reconcile fork features with upstream
1 parent 0ab1439 commit 00ea397

41 files changed

Lines changed: 663 additions & 741 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎charts/substrate-crds/templates/ate.dev_actortemplates.yaml‎

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,26 @@ spec:
199199
required:
200200
- port
201201
type: object
202+
timeoutSeconds:
203+
default: 30
204+
description: |-
205+
TimeoutSeconds is how long to keep polling HTTPGet before giving up.
206+
Exceeding it fails the actor start rather than proceeding with a
207+
container that never reported ready.
208+
209+
How long a workload takes to become ready is a property of that workload,
210+
which is why this is set per template rather than cluster-wide: a heavy
211+
runtime that needs minutes should not force every other template to wait
212+
as long before its failures surface.
213+
214+
Unset defaults to 30, applied by the API server so the effective value is
215+
visible on the stored object rather than only in the ateom. A manifest
216+
asking for 0 is rejected: unlike a warmup delay, a zero deadline could
217+
never be met, so it is never what a template author means.
218+
format: int32
219+
maximum: 3600
220+
minimum: 1
221+
type: integer
202222
required:
203223
- httpGet
204224
type: object
@@ -305,6 +325,25 @@ spec:
305325
- Full
306326
- Data
307327
type: string
328+
onResume:
329+
default: {}
330+
description: |-
331+
OnResume specifies, per snapshot situation, what supplies the guest
332+
state at resume (see OnResumeConfig). "fromData: Golden" requires
333+
sandboxClass "microvm".
334+
properties:
335+
fromData:
336+
default: ColdBoot
337+
description: |-
338+
FromData applies when the resume uses a Data-scope snapshot (from
339+
onPause or onCommit): "ColdBoot" starts fresh from the OCI image with
340+
the durable data restored; "Golden" combines the durable data with the
341+
template's golden snapshot. Defaults to "ColdBoot".
342+
enum:
343+
- ColdBoot
344+
- Golden
345+
type: string
346+
type: object
308347
required:
309348
- location
310349
type: object
@@ -420,13 +459,17 @@ spec:
420459
x-kubernetes-validations:
421460
- message: Spec is immutable
422461
rule: self == oldSelf
423-
- message: At most one DurableDir-typed volume is supported per ActorTemplate
424-
rule: '!has(self.volumes) || self.volumes.filter(v, has(v.durableDir)).size()
425-
<= 1'
426-
- message: A container may mount at most one DurableDir-typed volume
427-
rule: '!has(self.containers) || self.containers.all(c, !has(c.volumeMounts)
462+
- message: Only one DurableDir-typed volume is supported when sandboxClass
463+
is 'gvisor'
464+
rule: (has(self.sandboxClass) && self.sandboxClass == 'microvm') ||
465+
!has(self.volumes) || self.volumes.filter(v, has(v.durableDir)).size()
466+
<= 1
467+
- message: A container may mount only one DurableDir-typed volume when
468+
sandboxClass is 'gvisor'
469+
rule: (has(self.sandboxClass) && self.sandboxClass == 'microvm') ||
470+
!has(self.containers) || self.containers.all(c, !has(c.volumeMounts)
428471
|| c.volumeMounts.filter(vm, has(self.volumes) && self.volumes.exists(v,
429-
v.name == vm.name && has(v.durableDir))).size() <= 1)'
472+
v.name == vm.name && has(v.durableDir))).size() <= 1)
430473
- message: All volumes defined in spec.volumes must be mounted by at least
431474
one container
432475
rule: '!has(self.volumes) || self.volumes.all(v, has(self.containers)
@@ -435,6 +478,11 @@ spec:
435478
- message: ExternalVolumes are not supported when sandboxClass is 'microvm'
436479
rule: '!has(self.sandboxClass) || self.sandboxClass != ''microvm'' ||
437480
!has(self.volumes) || !self.volumes.exists(v, has(v.externalVolumeTemplate))'
481+
- message: 'onResume.fromData: Golden is not supported when sandboxClass
482+
is ''gvisor'''
483+
rule: '(has(self.sandboxClass) && self.sandboxClass == ''microvm'')
484+
|| !has(self.snapshotsConfig.onResume) || (has(self.snapshotsConfig.onResume.fromData)
485+
? self.snapshotsConfig.onResume.fromData : ''ColdBoot'') != ''Golden'''
438486
status:
439487
description: status is the observed state of ActorTemplate
440488
properties:

‎charts/substrate-crds/templates/ate.dev_workerpools.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,17 @@ spec:
411411
type: array
412412
x-kubernetes-list-type: atomic
413413
type: object
414+
terminationGracePeriodSeconds:
415+
default: 300
416+
description: |-
417+
TerminationGracePeriodSeconds is the termination grace period applied to
418+
this pool's worker pods. On eviction, ateom traps SIGTERM and forwards it
419+
to the actor so it can save state and exit cleanly before the kubelet
420+
sends SIGKILL. Tune this to the maximum time your actors need to shut
421+
down gracefully. Defaults to 300 (5 minutes).
422+
format: int32
423+
minimum: 1
424+
type: integer
414425
required:
415426
- ateomImage
416427
- replicas

‎charts/substrate/README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Helm chart for installing Agent Substrate.
66

77
| Mode | Default? | Cluster requirements | Trade-off |
88
|------|----------|----------------------|-----------|
9-
| `jwt` | yes | none beyond stock K8s | Server certs and session signing pools are generated by the chart; clients authenticate via projected ServiceAccount tokens. Valkey runs plaintext intra-cluster. |
9+
| `jwt` | yes | none beyond stock K8s | Server certs and actor signing pools are generated by the chart; clients authenticate via projected ServiceAccount tokens. Valkey runs plaintext intra-cluster. |
1010
| `mtls` | | feature gates `ClusterTrustBundle`, `ClusterTrustBundleProjection`, `PodCertificateRequest` + `certificates.k8s.io/v1beta1` API | Full in-cluster mTLS via the bundled `podcertcontroller`. |
1111

1212
```bash
@@ -31,8 +31,8 @@ JWT mode is standalone by default. The chart generates:
3131

3232
- `Secret/ateapi-tls`
3333
- `ConfigMap/ateapi-ca`
34-
- `Secret/session-id-jwt-pool`
35-
- `Secret/session-id-ca-pool`
34+
- `Secret/actor-id-jwt-pool`
35+
- `Secret/actor-id-ca-pool`
3636

3737
Existing generated data is reused on upgrade so key material does not rotate
3838
during normal chart upgrades. Set `auth.jwt.bootstrap.enabled=false` to bring
@@ -58,7 +58,7 @@ See `values.yaml` for the full set; the important keys:
5858
| `auth.mode` | `jwt` | `jwt` or `mtls` |
5959
| `auth.jwt.issuer` | `https://kubernetes.default.svc.cluster.local` | Override for managed clusters with provider-specific issuers |
6060
| `auth.jwt.audience` | `api.ate-system.svc` | SA token audience |
61-
| `auth.jwt.bootstrap.enabled` | `true` | Generate JWT TLS and session signing material |
61+
| `auth.jwt.bootstrap.enabled` | `true` | Generate JWT TLS and actor signing material |
6262
| `auth.jwt.serverCertSecret` | `ateapi-tls` | Secret name |
6363
| `auth.jwt.caBundleConfigMap` | `ateapi-ca` | ConfigMap name |
6464
| `valkey.enabled` | `true` | Set false if you bring your own Redis/Valkey |

‎charts/substrate/templates/NOTES.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ JWT bootstrap resources are managed by this chart. Existing key material is
1515
reused on upgrade.
1616
{{- else }}
1717
JWT bootstrap is disabled. Provide {{ .Values.auth.jwt.serverCertSecret }},
18-
{{ .Values.auth.jwt.caBundleConfigMap }}, session-id-jwt-pool, and
19-
session-id-ca-pool before pods become healthy.
18+
{{ .Values.auth.jwt.caBundleConfigMap }}, actor-id-jwt-pool, and
19+
actor-id-ca-pool before pods become healthy.
2020
{{- end }}
2121
{{- end }}

‎charts/substrate/templates/ate-api-server.yaml‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ spec:
100100
- "--redis-client-cert=@env"
101101
- "--client-jwt-issuer=@env"
102102
- "--client-jwt-audience={{ .Values.auth.jwt.audience }}"
103-
- "--session-id-jwt-pool=/run/session-id-jwt-pool/pool.json"
104-
- "--session-id-ca-pool=/run/session-id-ca-pool/pool.json"
103+
- "--actor-id-jwt-pool=/run/actor-id-jwt-pool/pool.json"
104+
- "--actor-id-ca-pool=/run/actor-id-ca-pool/pool.json"
105105
- "--atelet-client-cred-bundle=/run/podidentity.podcert.ate.dev/credential-bundle.pem"
106106
- "--pod-identity-ca-certs=/run/podidentity.podcert.ate.dev/trust-bundle.pem"
107107
{{- else }}
@@ -112,8 +112,8 @@ spec:
112112
- "--redis-use-iam-auth=@env"
113113
- "--client-jwt-issuer={{ .Values.auth.jwt.issuer }}"
114114
- "--client-jwt-audience={{ .Values.auth.jwt.audience }}"
115-
- "--session-id-jwt-pool=/run/session-id-jwt-pool/pool.json"
116-
- "--session-id-ca-pool=/run/session-id-ca-pool/pool.json"
115+
- "--actor-id-jwt-pool=/run/actor-id-jwt-pool/pool.json"
116+
- "--actor-id-ca-pool=/run/actor-id-ca-pool/pool.json"
117117
- "--client-jwt-ca-cert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
118118
{{- end }}
119119
- "--drain-delay=13s"
@@ -144,14 +144,14 @@ spec:
144144
volumeMounts:
145145
{{- if eq .Values.auth.mode "mtls" }}
146146
- { name: servicedns, mountPath: /run/servicedns.podcert.ate.dev }
147-
- { name: session-id-jwt-pool, mountPath: /run/session-id-jwt-pool }
147+
- { name: actor-id-jwt-pool, mountPath: /run/actor-id-jwt-pool }
148148
- { name: valkey-ca-certs, mountPath: /etc/valkey-ca, readOnly: true }
149-
- { name: session-id-ca-pool, mountPath: /run/session-id-ca-pool, readOnly: true }
149+
- { name: actor-id-ca-pool, mountPath: /run/actor-id-ca-pool, readOnly: true }
150150
- { name: podidentity, mountPath: /run/podidentity.podcert.ate.dev, readOnly: true }
151151
{{- else }}
152152
- { name: ateapi-tls, mountPath: /run/ateapi-tls, readOnly: true }
153-
- { name: session-id-jwt-pool, mountPath: /run/session-id-jwt-pool }
154-
- { name: session-id-ca-pool, mountPath: /run/session-id-ca-pool, readOnly: true }
153+
- { name: actor-id-jwt-pool, mountPath: /run/actor-id-jwt-pool }
154+
- { name: actor-id-ca-pool, mountPath: /run/actor-id-ca-pool, readOnly: true }
155155
{{- end }}
156156
ports:
157157
- containerPort: 443
@@ -179,11 +179,11 @@ spec:
179179
signerName: servicedns.podcert.ate.dev/identity
180180
keyType: ECDSAP256
181181
credentialBundlePath: credential-bundle.pem
182-
- name: session-id-jwt-pool
182+
- name: actor-id-jwt-pool
183183
projected:
184184
sources:
185185
- secret:
186-
name: session-id-jwt-pool
186+
name: actor-id-jwt-pool
187187
items:
188188
- { key: pool, path: pool.json }
189189
- name: valkey-ca-certs
@@ -193,11 +193,11 @@ spec:
193193
name: valkey-ca-certs
194194
items:
195195
- { key: ca.crt, path: ca.crt }
196-
- name: session-id-ca-pool
196+
- name: actor-id-ca-pool
197197
projected:
198198
sources:
199199
- secret:
200-
name: session-id-ca-pool
200+
name: actor-id-ca-pool
201201
items:
202202
- { key: pool, path: pool.json }
203203
- name: podidentity
@@ -219,18 +219,18 @@ spec:
219219
secretName: {{ .Values.auth.jwt.serverCertSecret }}
220220
- name: ateapi-tls
221221
emptyDir: {}
222-
- name: session-id-jwt-pool
222+
- name: actor-id-jwt-pool
223223
projected:
224224
sources:
225225
- secret:
226-
name: session-id-jwt-pool
226+
name: actor-id-jwt-pool
227227
items:
228228
- { key: pool, path: pool.json }
229-
- name: session-id-ca-pool
229+
- name: actor-id-ca-pool
230230
projected:
231231
sources:
232232
- secret:
233-
name: session-id-ca-pool
233+
name: actor-id-ca-pool
234234
items:
235235
- { key: pool, path: pool.json }
236236
{{- end }}

‎charts/substrate/templates/ate-controller.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ spec:
8585
- "--ateapi-ca-file=/run/ateapi-ca/ca.crt"
8686
- "--ateapi-server-name={{ include "substrate.fullname" (list "api" .) }}.{{ .Release.Namespace }}.svc"
8787
- "--ateapi-token-file=/var/run/secrets/tokens/ateapi/token"
88+
{{- end }}
89+
{{- if .Values.otel.endpoint }}
90+
env:
91+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
92+
value: {{ .Values.otel.endpoint | quote }}
8893
{{- end }}
8994
ports:
9095
- name: metrics

0 commit comments

Comments
 (0)