Skip to content

Commit 08caaee

Browse files
authored
Add AgentRuntimeConfiguration CRD for configurable agent template images (#70)
1 parent 6a398f8 commit 08caaee

16 files changed

Lines changed: 626 additions & 20 deletions

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ resources:
5858
kind: AiGatewayClass
5959
path: github.com/agentic-layer/agent-runtime-operator/api/v1alpha1
6060
version: v1alpha1
61+
- api:
62+
crdVersion: v1
63+
namespaced: true
64+
domain: agentic-layer.ai
65+
group: runtime
66+
kind: AgentRuntimeConfiguration
67+
path: github.com/agentic-layer/agent-runtime-operator/api/v1alpha1
68+
version: v1alpha1
6169
- api:
6270
crdVersion: v1
6371
namespaced: true
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
Copyright 2025 Agentic Layer.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// AgentRuntimeConfigurationSpec defines the desired state of AgentRuntimeConfiguration.
24+
type AgentRuntimeConfigurationSpec struct {
25+
// AgentTemplateImages defines the default template images for different agent frameworks.
26+
// These images are used when an Agent resource does not specify a custom image.
27+
// +optional
28+
AgentTemplateImages *AgentTemplateImages `json:"agentTemplateImages,omitempty"`
29+
}
30+
31+
// AgentTemplateImages defines template images for agent frameworks.
32+
type AgentTemplateImages struct {
33+
// GoogleAdk is the template image for the Google ADK framework.
34+
// If not specified, the operator's built-in default will be used.
35+
// +optional
36+
GoogleAdk string `json:"googleAdk,omitempty"`
37+
38+
// Additional framework images can be added here in the future, e.g.:
39+
// LangChain string `json:"langChain,omitempty"`
40+
// CrewAI string `json:"crewAi,omitempty"`
41+
}
42+
43+
// AgentRuntimeConfigurationStatus defines the observed state of AgentRuntimeConfiguration.
44+
type AgentRuntimeConfigurationStatus struct {
45+
// Conditions represent the latest available observations of the configuration's state.
46+
// +optional
47+
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
48+
}
49+
50+
// +kubebuilder:object:root=true
51+
// +kubebuilder:subresource:status
52+
// +kubebuilder:printcolumn:name="Google ADK Image",type=string,JSONPath=`.spec.agentTemplateImages.googleAdk`
53+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
54+
55+
// AgentRuntimeConfiguration is the Schema for the agentruntimeconfigurations API.
56+
// It provides namespace-scoped configuration for the agent-runtime-operator.
57+
type AgentRuntimeConfiguration struct {
58+
metav1.TypeMeta `json:",inline"`
59+
metav1.ObjectMeta `json:"metadata,omitempty"`
60+
61+
Spec AgentRuntimeConfigurationSpec `json:"spec,omitempty"`
62+
Status AgentRuntimeConfigurationStatus `json:"status,omitempty"`
63+
}
64+
65+
// +kubebuilder:object:root=true
66+
67+
// AgentRuntimeConfigurationList contains a list of AgentRuntimeConfiguration.
68+
type AgentRuntimeConfigurationList struct {
69+
metav1.TypeMeta `json:",inline"`
70+
metav1.ListMeta `json:"metadata,omitempty"`
71+
Items []AgentRuntimeConfiguration `json:"items"`
72+
}
73+
74+
func init() {
75+
SchemeBuilder.Register(&AgentRuntimeConfiguration{}, &AgentRuntimeConfigurationList{})
76+
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.18.0
7+
name: agentruntimeconfigurations.runtime.agentic-layer.ai
8+
spec:
9+
group: runtime.agentic-layer.ai
10+
names:
11+
kind: AgentRuntimeConfiguration
12+
listKind: AgentRuntimeConfigurationList
13+
plural: agentruntimeconfigurations
14+
singular: agentruntimeconfiguration
15+
scope: Namespaced
16+
versions:
17+
- additionalPrinterColumns:
18+
- jsonPath: .spec.agentTemplateImages.googleAdk
19+
name: Google ADK Image
20+
type: string
21+
- jsonPath: .metadata.creationTimestamp
22+
name: Age
23+
type: date
24+
name: v1alpha1
25+
schema:
26+
openAPIV3Schema:
27+
description: |-
28+
AgentRuntimeConfiguration is the Schema for the agentruntimeconfigurations API.
29+
It provides namespace-scoped configuration for the agent-runtime-operator.
30+
properties:
31+
apiVersion:
32+
description: |-
33+
APIVersion defines the versioned schema of this representation of an object.
34+
Servers should convert recognized schemas to the latest internal value, and
35+
may reject unrecognized values.
36+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
37+
type: string
38+
kind:
39+
description: |-
40+
Kind is a string value representing the REST resource this object represents.
41+
Servers may infer this from the endpoint the client submits requests to.
42+
Cannot be updated.
43+
In CamelCase.
44+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
45+
type: string
46+
metadata:
47+
type: object
48+
spec:
49+
description: AgentRuntimeConfigurationSpec defines the desired state of
50+
AgentRuntimeConfiguration.
51+
properties:
52+
agentTemplateImages:
53+
description: |-
54+
AgentTemplateImages defines the default template images for different agent frameworks.
55+
These images are used when an Agent resource does not specify a custom image.
56+
properties:
57+
googleAdk:
58+
description: |-
59+
GoogleAdk is the template image for the Google ADK framework.
60+
If not specified, the operator's built-in default will be used.
61+
type: string
62+
type: object
63+
type: object
64+
status:
65+
description: AgentRuntimeConfigurationStatus defines the observed state
66+
of AgentRuntimeConfiguration.
67+
properties:
68+
conditions:
69+
description: Conditions represent the latest available observations
70+
of the configuration's state.
71+
items:
72+
description: Condition contains details for one aspect of the current
73+
state of this API Resource.
74+
properties:
75+
lastTransitionTime:
76+
description: |-
77+
lastTransitionTime is the last time the condition transitioned from one status to another.
78+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
79+
format: date-time
80+
type: string
81+
message:
82+
description: |-
83+
message is a human readable message indicating details about the transition.
84+
This may be an empty string.
85+
maxLength: 32768
86+
type: string
87+
observedGeneration:
88+
description: |-
89+
observedGeneration represents the .metadata.generation that the condition was set based upon.
90+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
91+
with respect to the current state of the instance.
92+
format: int64
93+
minimum: 0
94+
type: integer
95+
reason:
96+
description: |-
97+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
98+
Producers of specific condition types may define expected values and meanings for this field,
99+
and whether the values are considered a guaranteed API.
100+
The value should be a CamelCase string.
101+
This field may not be empty.
102+
maxLength: 1024
103+
minLength: 1
104+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
105+
type: string
106+
status:
107+
description: status of the condition, one of True, False, Unknown.
108+
enum:
109+
- "True"
110+
- "False"
111+
- Unknown
112+
type: string
113+
type:
114+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
115+
maxLength: 316
116+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
117+
type: string
118+
required:
119+
- lastTransitionTime
120+
- message
121+
- reason
122+
- status
123+
- type
124+
type: object
125+
type: array
126+
type: object
127+
type: object
128+
served: true
129+
storage: true
130+
subresources:
131+
status: {}

config/crd/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- bases/runtime.agentic-layer.ai_agentgatewayclasses.yaml
77
- bases/runtime.agentic-layer.ai_agenticworkforces.yaml
88
- bases/runtime.agentic-layer.ai_agents.yaml
9+
- bases/runtime.agentic-layer.ai_agentruntimeconfigurations.yaml
910
- bases/runtime.agentic-layer.ai_aigateways.yaml
1011
- bases/runtime.agentic-layer.ai_aigatewayclasses.yaml
1112
- bases/runtime.agentic-layer.ai_toolgatewayclasses.yaml

config/manager/manager.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ spec:
5959
- --health-probe-bind-address=:8081
6060
image: controller:latest
6161
name: manager
62+
env:
63+
- name: POD_NAMESPACE
64+
valueFrom:
65+
fieldRef:
66+
fieldPath: metadata.namespace
6267
ports: [ ]
6368
securityContext:
6469
allowPrivilegeEscalation: false

config/rbac/role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ rules:
6363
- apiGroups:
6464
- runtime.agentic-layer.ai
6565
resources:
66+
- agentruntimeconfigurations
6667
- aigateways
6768
- toolgateways
6869
verbs:

config/samples/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
resources:
33
- runtime_v1alpha1_agent.yaml
44
- runtime_v1alpha1_agenticworkforce.yaml
5+
- runtime_v1alpha1_agentruntimeconfiguration.yaml
56
- runtime_v1alpha1_toolserver.yaml
67
# +kubebuilder:scaffold:manifestskustomizesamples
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: runtime.agentic-layer.ai/v1alpha1
2+
kind: AgentRuntimeConfiguration
3+
metadata:
4+
name: default
5+
namespace: agent-runtime-operator-system
6+
spec:
7+
agentTemplateImages:
8+
# Customize the default template image for Google ADK framework agents
9+
# This will be used when an Agent resource does not specify a custom image
10+
googleAdk: "ghcr.io/agentic-layer/agent-template-adk:0.6.1"

0 commit comments

Comments
 (0)