Skip to content

Commit 15f3db6

Browse files
Copilotg3force
andauthored
Add ToolGateway CRD (#58)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: g3force <779094+g3force@users.noreply.github.com>
1 parent ffbc0f6 commit 15f3db6

6 files changed

Lines changed: 773 additions & 38 deletions

File tree

PROJECT

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,20 @@ 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: ToolGateway
67+
path: github.com/agentic-layer/agent-runtime-operator/api/v1alpha1
68+
version: v1alpha1
69+
- api:
70+
crdVersion: v1
71+
namespaced: false
72+
domain: agentic-layer.ai
73+
group: runtime
74+
kind: ToolGatewayClass
75+
path: github.com/agentic-layer/agent-runtime-operator/api/v1alpha1
76+
version: v1alpha1
6177
version: "3"

api/v1alpha1/toolgateway_types.go

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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+
corev1 "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
)
23+
24+
// ToolGatewaySpec defines the desired state of ToolGateway
25+
type ToolGatewaySpec struct {
26+
// ToolGatewayClassName specifies which ToolGatewayClass to use for this gateway instance.
27+
// This is only needed if multiple gateway classes are defined in the cluster.
28+
ToolGatewayClassName string `json:"toolGatewayClassName,omitempty"`
29+
30+
// Environment variables to pass to the ToolGateway container.
31+
// These can include configuration values, credentials, or feature flags.
32+
// +optional
33+
Env []corev1.EnvVar `json:"env,omitempty"`
34+
35+
// List of sources to populate environment variables in the ToolGateway container.
36+
// This allows loading variables from ConfigMaps and Secrets.
37+
// +optional
38+
EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
39+
}
40+
41+
// ToolGatewayStatus defines the observed state of ToolGateway
42+
type ToolGatewayStatus struct {
43+
// Conditions represent the latest available observations of the gateway's state
44+
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
45+
}
46+
47+
// +kubebuilder:object:root=true
48+
// +kubebuilder:subresource:status
49+
50+
// ToolGateway is the Schema for the toolgateways API
51+
type ToolGateway struct {
52+
metav1.TypeMeta `json:",inline"`
53+
metav1.ObjectMeta `json:"metadata,omitempty"`
54+
55+
Spec ToolGatewaySpec `json:"spec,omitempty"`
56+
Status ToolGatewayStatus `json:"status,omitempty"`
57+
}
58+
59+
// +kubebuilder:object:root=true
60+
61+
// ToolGatewayList contains a list of ToolGateway
62+
type ToolGatewayList struct {
63+
metav1.TypeMeta `json:",inline"`
64+
metav1.ListMeta `json:"metadata,omitempty"`
65+
Items []ToolGateway `json:"items"`
66+
}
67+
68+
// ToolGatewayClassSpec defines the desired state of ToolGatewayClass
69+
type ToolGatewayClassSpec struct {
70+
// Controller is the name of the controller that should handle this gateway class
71+
// +kubebuilder:validation:Required
72+
Controller string `json:"controller"`
73+
}
74+
75+
// ToolGatewayClassStatus defines the observed state of ToolGatewayClass
76+
type ToolGatewayClassStatus struct {
77+
// Conditions represent the latest available observations of the gateway class's state
78+
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
79+
}
80+
81+
// +kubebuilder:object:root=true
82+
// +kubebuilder:subresource:status
83+
// +kubebuilder:resource:scope=Cluster
84+
// +kubebuilder:printcolumn:name="Controller",type="string",JSONPath=".spec.controller"
85+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
86+
87+
// ToolGatewayClass is the Schema for the toolgatewayclasses API
88+
type ToolGatewayClass struct {
89+
metav1.TypeMeta `json:",inline"`
90+
metav1.ObjectMeta `json:"metadata,omitempty"`
91+
92+
Spec ToolGatewayClassSpec `json:"spec,omitempty"`
93+
Status ToolGatewayClassStatus `json:"status,omitempty"`
94+
}
95+
96+
// +kubebuilder:object:root=true
97+
98+
// ToolGatewayClassList contains a list of ToolGatewayClass
99+
type ToolGatewayClassList struct {
100+
metav1.TypeMeta `json:",inline"`
101+
metav1.ListMeta `json:"metadata,omitempty"`
102+
Items []ToolGatewayClass `json:"items"`
103+
}
104+
105+
func init() {
106+
SchemeBuilder.Register(&ToolGateway{}, &ToolGatewayList{}, &ToolGatewayClass{}, &ToolGatewayClassList{})
107+
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 206 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)