Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ this order, writing nothing before the gate:
rotation keeps the revision and changes no pod template; muster's own credentials carry the same revision
(`<installation>-muster-credentials-revision`, the Secret `muster-credentials-revision`, handed through the meta
chart's `components.<name>.valuesFromRefs` to every workload that reads them: muster, its Valkey and, where each
runs, klaus-gateway and the agent-, cluster- and model-manager). Unseen by the
runs, klaus-gateway and the agent-, cluster-, model- and skill-manager). Unseen by the
comparison: a literal the render changes under an encrypted field — the record holds it encrypted. A
value frozen in a file the definition does not own whole (one with several owners) cannot rotate and
refuses the commit naming the file. Where the capability is on record (its marker file exists), a
Expand Down
4 changes: 2 additions & 2 deletions definitions/agent-platform/features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ features:
- {id: oauth2-proxy-existing-secret, kind: configmap, key: kagent.oauth2-proxy.config.existingSecret}
- {id: oauth2-proxy-inline-credentials, kind: configmap, key: kagent.oauth2-proxy.config.clientID / kagent.oauth2-proxy.config.clientSecret / kagent.oauth2-proxy.config.cookieSecret (never inline)}
- {id: muster-and-valkey-existing-secrets, kind: configmap, key: muster.muster.oauth.server.existingSecret / muster.muster.oauth.server.storage.valkey.existingSecret / valkey}
- {id: muster-credentials-revision-refs, kind: configmap, key: "components.muster.valuesFromRefs / components.valkey.valuesFromRefs / components.klaus-gateway.valuesFromRefs / components.agent-manager.valuesFromRefs / components.cluster-manager.valuesFromRefs / components.model-manager.valuesFromRefs (the credentials revision the HelmReleases of the workloads that read muster's credentials take into their charts' checksum values or a pod annotation)"}
- {id: muster-credentials-revision-refs, kind: configmap, key: "components.muster.valuesFromRefs / components.valkey.valuesFromRefs / components.klaus-gateway.valuesFromRefs / components.agent-manager.valuesFromRefs / components.cluster-manager.valuesFromRefs / components.model-manager.valuesFromRefs / components.skill-manager.valuesFromRefs (the credentials revision the HelmReleases of the workloads that read muster's credentials take into their charts' checksum values or a pod annotation)"}
- {id: muster-credentials-revision, kind: extras, key: "agent-platform/secrets/muster-credentials-revision.yaml / agent-platform/secrets/muster-oauth-credentials.yaml stringData.credentials-revision / agent-platform/secrets/muster-valkey-credentials.yaml stringData.revision (the revision held by muster's credentials Secrets and by the Secret the HelmReleases read, so a rotation restarts every workload that reads them)"}
- {id: kagent-credentials-revision-refs, kind: configmap, key: "components.kagent.valuesFromRefs (kagent's credentials revision the kagent HelmRelease takes onto the oauth2-proxy's pod annotations)"}
- {id: kagent-credentials-revision, kind: extras, key: "agent-platform/secrets/kagent-credentials-revision.yaml / agent-platform/secrets/kagent-oauth2-proxy-credentials.yaml stringData.credentials-revision (the revision held by the oauth2-proxy's credentials Secret and by the Secret the kagent HelmRelease reads, so a rotation of the kagent client or cookie secret restarts the proxy)"}
Expand Down Expand Up @@ -84,7 +84,7 @@ features:
- {id: live-kagent-provider-values, kind: live, key: "kagent HelmRelease .spec.values.providers (where the meta chart the installation resolves still takes kagent.providers)"}
- {id: live-konfiguration-source, kind: live, key: "Konfiguration agent-platform-konfiguration on its GitRepository's revision: behind within its reconciliation interval reads rolling, longer drifted"}
- {id: live-helmreleases-ready, kind: live, key: "HelmReleases agent-platform, kagent, connectivity, muster, mcps, and agent-platform-operator with the organizations, Ready"}
- {id: live-platform-workloads, kind: live, key: "the Deployments that read muster's credentials Available: muster, its Valkey, and klaus-gateway, agent-manager, cluster-manager and model-manager where each runs"}
- {id: live-platform-workloads, kind: live, key: "the Deployments that read muster's credentials Available: muster, its Valkey, and klaus-gateway, agent-manager, cluster-manager and model-manager where each runs, and skill-manager with the agent-manager from meta chart 4.179.0-rc.9 on"}
- {id: live-kagent-workloads, kind: live, key: kagent pods Running and the CNPG cluster healthy}
- {id: live-pod-certificate-request, kind: live, key: "certificates.k8s.io/v1beta1 podcertificaterequests served by the apiserver (Agent Substrate's feature gates, the 4 line)"}
- {id: live-drift, kind: live, key: live values equal the rendered manifests}
Expand Down
5 changes: 5 additions & 0 deletions definitions/agent-platform/migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
#
# The M numbers are the wave-1 migration list's (M1–M11) and continue removals.yaml's (M30…).
migrations:
# --- M44 — a rotated muster credential rolls the skill-manager too ---
# The meta chart runs the skill-manager beside the agent-manager from 4.179.0 on; it reads the platform
# client's secret once at start, like the managers of M38.
- key: configmap:components.skill-manager.valuesFromRefs
reason: "Added: on the 4 line from agent-platform 4.179.0 on, the skill-manager HelmRelease reads muster's credentials revision from the Secret muster-credentials-revision onto a pod annotation (valuesFrom with targetPath), so a rotation of the platform client's secret restarts the skill-manager, which reads it at start, instead of leaving it on the old one until a hand-run restart · M44"
# --- M42 — muster's OIDC discovery against Dex is allowed a private address on a private installation ---
# Dex resolves to the internal load balancer on a private installation; the shared defaults derive the flag
# from managementCluster.private, which is false where the ingress alone is private, so the definition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ heron: enabled
live-kagent-provider-values: runtime kagent HelmRelease .spec.values.providers (where the meta chart the installation resolves still takes kagent.providers)
live-konfiguration-source: runtime Konfiguration agent-platform-konfiguration on its GitRepository's revision: behind within its reconciliation interval reads rolling, longer drifted
live-helmreleases-ready: runtime HelmReleases agent-platform, kagent, connectivity, muster, mcps, and agent-platform-operator with the organizations, Ready
live-platform-workloads: runtime the Deployments that read muster's credentials Available: muster, its Valkey, and klaus-gateway, agent-manager, cluster-manager and model-manager where each runs
live-platform-workloads: runtime the Deployments that read muster's credentials Available: muster, its Valkey, and klaus-gateway, agent-manager, cluster-manager and model-manager where each runs, and skill-manager with the agent-manager from meta chart 4.179.0-rc.9 on
live-kagent-workloads: runtime kagent pods Running and the CNPG cluster healthy
live-pod-certificate-request: runtime certificates.k8s.io/v1beta1 podcertificaterequests served by the apiserver (Agent Substrate's feature gates, the 4 line)
live-drift: runtime live values equal the rendered manifests
Expand Down Expand Up @@ -85,7 +85,7 @@ kestrel: enabled
live-kagent-provider-values: runtime kagent HelmRelease .spec.values.providers (where the meta chart the installation resolves still takes kagent.providers)
live-konfiguration-source: runtime Konfiguration agent-platform-konfiguration on its GitRepository's revision: behind within its reconciliation interval reads rolling, longer drifted
live-helmreleases-ready: runtime HelmReleases agent-platform, kagent, connectivity, muster, mcps, and agent-platform-operator with the organizations, Ready
live-platform-workloads: runtime the Deployments that read muster's credentials Available: muster, its Valkey, and klaus-gateway, agent-manager, cluster-manager and model-manager where each runs
live-platform-workloads: runtime the Deployments that read muster's credentials Available: muster, its Valkey, and klaus-gateway, agent-manager, cluster-manager and model-manager where each runs, and skill-manager with the agent-manager from meta chart 4.179.0-rc.9 on
live-kagent-workloads: runtime kagent pods Running and the CNPG cluster healthy
live-pod-certificate-request: runtime certificates.k8s.io/v1beta1 podcertificaterequests served by the apiserver (Agent Substrate's feature gates, the 4 line)
live-drift: runtime live values equal the rendered manifests
Expand Down
4 changes: 4 additions & 0 deletions render/agentplatform/consumption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ var consumptionShapes = []consumptionShape{
{name: shapeOrganizationsCommit, platform: shapeOrganizationsCommit},
{name: shapeOrganizationsPortal, platform: shapeOrganizationsPortal, portal: shapeOrganizationsPortal + portalInputSuffix},
{name: shapeCredentialForm, platform: shapeCredentialForm},
// The skill-manager's sources and GitHub App and the default agent's
// switch and model (meta chart 4.179.0 and later).
{name: shapeSkillManagerAgentOff, platform: shapeSkillManagerAgentOff},
{name: shapeSkillManagerAgentModel, platform: shapeSkillManagerAgentModel},
}

const (
Expand Down
9 changes: 9 additions & 0 deletions render/agentplatform/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const (
// componentModelManager is no choice of the policy's: the meta chart's 4
// line runs it by default and the definition leaves it on.
componentModelManager = "model-manager"
// componentSkillManager is no choice of the policy's either: the meta
// chart runs it wherever the agent-manager runs, from skillManagerChart
// on.
componentSkillManager = "skill-manager"
)

// organisationComponents are the components policy.yaml lists per
Expand Down Expand Up @@ -1148,6 +1152,11 @@ func (in *Input) klausGateway() bool { return in.Components[componentKlausGate
func (in *Input) clusterManager() bool { return in.Components[componentClusterManager] }
func (in *Input) modelManager() bool { return in.Installation.ChartLine == lineFour }

// skillManager says whether the meta chart runs the skill-manager: with the
// agent-manager, on a chart from skillManagerChart on (a versions.chart hold
// below it runs a chart without the component).
func (in *Input) skillManager() bool { return in.agentManager() && in.reachesSkillManagerChart() }

// portalHost is the installation whose management-clusters tree hosts the
// portal the platform's portal section is written into (hostedPortal); empty
// when there is none.
Expand Down
11 changes: 7 additions & 4 deletions render/agentplatform/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (in *Input) configmapPatch() render.Map {
m = append(m, e("skillManager", render.Map{e("sources", in.SkillManagerSources)}))
}
if in.SkillManagerAppSecret != "" {
m = append(m, e("skill-manager", render.Map{e("github", render.Map{e("app", render.Map{e("secretName", in.SkillManagerAppSecret)})})}))
m = append(m, e(componentSkillManager, render.Map{e("github", render.Map{e("app", render.Map{e("secretName", in.SkillManagerAppSecret)})})}))
}
m = in.organizationsValues(m)
m = in.platformTenantValues(m)
Expand Down Expand Up @@ -603,16 +603,19 @@ type musterConsumer struct {
// managers, whose OAuth resource servers take the platform client's secret
// from the Secret global.identity names (DEX_CLIENT_SECRET): the agent-manager
// and the cluster-manager where the policy runs them, the model-manager
// wherever the 4 line runs (the meta chart's default). TestRenderConsumption
// holds the list to the charts: every pod that reads either Secret is a
// consumer's, and the revision changes its pod template.
// wherever the 4 line runs (the meta chart's default), and the skill-manager
// wherever the meta chart runs it (beside the agent-manager, from
// skillManagerChart on). TestRenderConsumption holds the list to the
// charts: every pod that reads either Secret is a consumer's, and the
// revision changes its pod template.
var musterConsumers = []musterConsumer{
{component: componentMuster, deployment: componentMuster, revision: musterChecksumValues, runs: always},
{component: componentValkey, deployment: "muster-valkey", revision: []string{valkeyChecksumValue}, runs: always},
{component: componentKlausGateway, deployment: componentKlausGateway, revision: []string{podRevisionAnnotation}, runs: (*Input).klausGateway},
{component: componentAgentManager, deployment: componentAgentManager, revision: []string{podRevisionAnnotation}, runs: (*Input).agentManager},
{component: componentClusterManager, deployment: componentClusterManager, revision: []string{podRevisionAnnotation}, runs: (*Input).clusterManager},
{component: componentModelManager, deployment: componentModelManager, revision: []string{podRevisionAnnotation}, runs: (*Input).modelManager},
{component: componentSkillManager, deployment: componentSkillManager, revision: []string{podRevisionAnnotation}, runs: (*Input).skillManager},
}

func always(*Input) bool { return true }
Expand Down
59 changes: 56 additions & 3 deletions render/agentplatform/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const (
shapeCredentialForm = "credential-form" //nolint:gosec // a golden shape's name, no credential
shapePlatformTenantRetired = "platform-tenant-retired"
shapePlatformTenantTeam = "platform-tenant-team"
// The skill-manager's sources and GitHub App, with the default agent
// off, or on a named ModelConfig (meta chart 4.179.0 and later).
shapeSkillManagerAgentOff = "skill-manager-default-agent-off"
shapeSkillManagerAgentModel = "skill-manager-default-agent-model"
)

// The keys of the choices' documents the refusal cases build.
Expand Down Expand Up @@ -97,7 +101,8 @@ const (

// shapes are the installation shapes, in the order the goldens are rendered.
var shapes = []string{shapePublicCustomer, shapeGiantswarmOwned, shapeGiantswarmSlackApp, shapeGiantswarmSlackAppPub, shapeHubPrivateTarget, shapeMultiClusterAggregator, shapeSecondHub, shapeHandKeptPortal, shapeRegisteredServers, shapePortalGitHubGrant, shapePortalHive, shapeCustomerSibling, shapeConfidentialClient,
shapeOrganizationsApply, shapeOrganizationsCommit, shapeOrganizationsPortal, shapeCredentialForm, shapePlatformTenantRetired, shapePlatformTenantTeam}
shapeOrganizationsApply, shapeOrganizationsCommit, shapeOrganizationsPortal, shapeCredentialForm, shapePlatformTenantRetired, shapePlatformTenantTeam,
shapeSkillManagerAgentOff, shapeSkillManagerAgentModel}

func loadInput(t *testing.T, shape string) (map[string]any, map[string]string) {
t.Helper()
Expand Down Expand Up @@ -1778,8 +1783,8 @@ func TestSkillManagerAppSecret(t *testing.T) {
return input, secrets
}
input, secrets := loadInput(t, shapeHubPrivateTarget)
if got := renderedPatch(t, input, secrets); strings.Contains(got, "skill-manager:") {
t.Errorf("no App, and the patch carries skill-manager:\n%s", got)
if got := renderedPatch(t, input, secrets); strings.Contains(got, "\nskill-manager:") {
t.Errorf("no App, and the patch carries the skill-manager's values (skill-manager:):\n%s", got)
}

want := "\nskill-manager:\n github:\n app:\n secretName: " + skillsApp + "\n"
Expand Down Expand Up @@ -1810,6 +1815,54 @@ func TestSkillManagerAppSecret(t *testing.T) {
})
}

// TestSkillManagerReadsMusterCredentials hands the credentials revision to
// the skill-manager's HelmRelease and probes its Deployment wherever the meta
// chart runs it: beside the agent-manager, with no versions.chart hold or a
// hold that admits the release with the skill-manager. A hold below it runs
// a chart without the component, and an installation without the
// agent-manager runs none: neither gets the wiring nor the probe.
func TestSkillManagerReadsMusterCredentials(t *testing.T) {
const wiring = "\n skill-manager:\n valuesFromRefs:\n - kind: Secret\n name: muster-credentials-revision\n"
for _, c := range []struct {
name string
hold string
noAM bool
wants bool
}{
{"no hold", "", false, true},
{"a hold on the release", "~4.179.0", false, true},
{"a hold on a candidate with the skill-manager", "4.179.0-rc.9", false, true},
{"a hold on the candidate before", "4.179.0-rc.8", false, false},
{"a hold on the release before", holdReleaseBeforeSkillManager, false, false},
{"a hold below", holdBelowSkillManager, false, false},
{"no agent-manager", "", true, false},
} {
t.Run(c.name, func(t *testing.T) {
input, secrets := loadInput(t, shapeHubPrivateTarget)
if c.hold != "" {
input[keyVersions] = map[string]any{keyChart: c.hold}
}
if c.noAM {
input["installation"].(map[string]any)["customer"] = customerWithoutKagent
input["clusterManager"] = map[string]any{keyGitHub: map[string]any{keyEnabled: false}}
}
result, err := Render(input, secrets, render.ModeCommit)
if err != nil {
t.Fatal(err)
}
if got := strings.Contains(platformPatch(t, result), wiring); got != c.wants {
t.Errorf("components.skill-manager.valuesFromRefs rendered: %v, want %v", got, c.wants)
}
probed := slices.ContainsFunc(result.Probes, func(p render.Probe) bool {
return p.ID == platformWorkloadsDimension && p.Resource == "Deployment" && p.Name == componentSkillManager
})
if probed != c.wants {
t.Errorf("Deployment %s probed: %v, want %v", componentSkillManager, probed, c.wants)
}
})
}
}

// TestAgentManagerSkillRepositoriesAreURLs refuses an object in
// agent-manager's deprecated skill repositories: the object form is the
// skill-manager's (skillManager.sources).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ components:
name: muster-credentials-revision
valuesKey: revision
targetPath: podAnnotations.muster-credentials-revision
skill-manager:
valuesFromRefs:
- kind: Secret
name: muster-credentials-revision
valuesKey: revision
targetPath: podAnnotations.muster-credentials-revision
postgres:
enabled: true
llmRouting:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@
expect:
condition: Available
conditionStatus: "True"
- id: live-platform-workloads
feature: runtime
kind: Condition
namespace: agent-platform
resource: Deployment
name: skill-manager
expect:
condition: Available
conditionStatus: "True"
- id: live-kagent-workloads
feature: runtime
kind: Condition
Expand Down
Loading
Loading