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
990 changes: 990 additions & 0 deletions config/crd/external/monitoring.coreos.com_servicemonitors.yaml

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,62 @@ rules:
- get
- patch
- update
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
53 changes: 52 additions & 1 deletion config/samples/agentrax_v1alpha1_agentdeployment.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,68 @@
# ──────────────────────────────────────────────────────────────────────────────
# Prerequisites for AgentDeployment/query-agent
#
# Apply in order:
# kubectl apply -f config/samples/agentrax_v1alpha1_agentdeployment.yaml
#
# The file creates:
# 1. Namespace tenant-search
# 2. TenantQuota team-search (governs quota for the AgentDeployment)
# 3. AgentDeployment query-agent (references team-search via tenantRef)
# ──────────────────────────────────────────────────────────────────────────────

# 1. Namespace — all resources live here.
apiVersion: v1
kind: Namespace
metadata:
name: tenant-search
labels:
app.kubernetes.io/part-of: agentrax-demo

---
# 2. TenantQuota — must exist before the AgentDeployment is created.
# tenantRef in the AgentDeployment below must match this resource's name.
apiVersion: agentrax.io/v1alpha1
kind: TenantQuota
metadata:
name: team-search
namespace: tenant-search
spec:
# Maximum total replica count across all AgentDeployments in this namespace.
maxTotalReplicas: 10
# Maximum number of distinct AgentDeployments allowed.
maxAgents: 5

---
# 3. AgentDeployment — the main resource.
apiVersion: agentrax.io/v1alpha1
kind: AgentDeployment
metadata:
name: query-agent
namespace: default
namespace: tenant-search
labels:
app.kubernetes.io/part-of: agentrax-demo
spec:
# Image of the model/agent container to deploy.
image: gcr.io/google-containers/echoserver:1.4

# Port the agent listens on (defaults to 8080 if omitted).
port: 8080

# tenantRef names the TenantQuota in the same namespace that governs quota.
# Must match the TenantQuota resource name above.
tenantRef: team-search

# replicas defines the autoscaling policy.
replicas:
min: 1
max: 3
metric: queueDepth
target: 50

# rollout defaults to Recreate; no canary steps required for Phase 1.
rollout:
strategy: Recreate

# mcp.expose: false — MCP registration handled in Phase 5.
mcp:
expose: false
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ go 1.22.0
require (
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.0
k8s.io/api v0.31.0
k8s.io/apiextensions-apiserver v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
sigs.k8s.io/controller-runtime v0.19.0
Expand Down Expand Up @@ -84,8 +87,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.31.0 // indirect
k8s.io/apiextensions-apiserver v0.31.0 // indirect
k8s.io/apiserver v0.31.0 // indirect
k8s.io/component-base v0.31.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
Expand All @@ -95,4 +96,4 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
)
4 changes: 3 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.0 h1:62MgqpTrtjNd8cc0RJSFJ1OHqgSrThgHehGVuQaF/fc=
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.0/go.mod h1:XYrdZw5dW12Cjkt4ndbeNZZTBp4UCHtW0ccR9+sTtPU=
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
Expand Down Expand Up @@ -248,4 +250,4 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h6
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
Loading
Loading