Skip to content

Commit 2e19709

Browse files
Add EnvoyBootstrapConfig CRD to routing.qdrant.io/v1alpha1 (#256)
1 parent 0683768 commit 2e19709

4 files changed

Lines changed: 376 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package v1alpha1
2+
3+
import (
4+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
)
6+
7+
const (
8+
KindEnvoyBootstrapConfig = "EnvoyBootstrapConfig"
9+
ResourceEnvoyBootstrapConfig = "envoybootstrapconfigs"
10+
)
11+
12+
//+kubebuilder:object:root=true
13+
// +kubebuilder:resource:path=envoybootstrapconfigs,singular=envoybootstrapconfig,shortName=ebc;ebcs
14+
// +kubebuilder:printcolumn:name="ClusterID",type=string,JSONPath=`.spec.clusterID`
15+
// +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready`
16+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
17+
// +kubebuilder:subresource:status
18+
19+
// EnvoyBootstrapConfig is the Schema for the envoybootstrapconfigs API.
20+
// It declares the desired state for an Envoy bootstrap configuration.
21+
// The route-manager reconciler watches these resources and produces a
22+
// ConfigMap (rendered bootstrap JSON) and a Secret (access token) in the
23+
// same namespace.
24+
type EnvoyBootstrapConfig struct {
25+
metav1.TypeMeta `json:",inline"`
26+
// Standard object's metadata.
27+
// +optional
28+
metav1.ObjectMeta `json:"metadata,omitempty"`
29+
30+
Spec EnvoyBootstrapConfigSpec `json:"spec,omitempty"`
31+
Status EnvoyBootstrapConfigStatus `json:"status,omitempty"`
32+
}
33+
34+
// EnvoyBootstrapConfigSpec describes the desired Envoy bootstrap configuration.
35+
type EnvoyBootstrapConfigSpec struct {
36+
// ClusterID identifies the Qdrant cluster this Envoy instance serves.
37+
// When set the Envoy runs in dedicated mode for this cluster.
38+
// When nil it runs in shared mode.
39+
// +optional
40+
ClusterID *string `json:"clusterID,omitempty"`
41+
// ProxyProtocolEnabled enables the PROXY protocol on Envoy listeners.
42+
// +kubebuilder:default=false
43+
// +optional
44+
ProxyProtocolEnabled bool `json:"proxyProtocolEnabled,omitempty"`
45+
}
46+
47+
// EnvoyBootstrapConfigStatus defines the observed state of EnvoyBootstrapConfig.
48+
type EnvoyBootstrapConfigStatus struct {
49+
// Ready is true once the ConfigMap and Secret exist and are up-to-date.
50+
Ready bool `json:"ready,omitempty"`
51+
// ConfigMapName is the name of the generated ConfigMap containing the bootstrap JSON.
52+
ConfigMapName string `json:"configMapName,omitempty"`
53+
// SecretName is the name of the access-token Secret (created or reused).
54+
SecretName string `json:"secretName,omitempty"`
55+
// Conditions represent the latest available observations of the resource's state.
56+
// +optional
57+
Conditions []metav1.Condition `json:"conditions,omitempty"`
58+
}
59+
60+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
61+
62+
// EnvoyBootstrapConfigList contains a list of EnvoyBootstrapConfig objects.
63+
type EnvoyBootstrapConfigList struct {
64+
metav1.TypeMeta `json:",inline"`
65+
// Standard list metadata.
66+
// +optional
67+
metav1.ListMeta `json:"metadata,omitempty"`
68+
69+
// List of EnvoyBootstrapConfig objects
70+
Items []EnvoyBootstrapConfig `json:"items"`
71+
}
72+
73+
func init() {
74+
SchemeBuilder.Register(&EnvoyBootstrapConfig{}, &EnvoyBootstrapConfigList{})
75+
}

api/routing/v1alpha1/zz_generated.deepcopy.go

Lines changed: 102 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{{ if .Values.includeRoutingCRDs }}
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.20.1
8+
name: envoybootstrapconfigs.routing.qdrant.io
9+
spec:
10+
group: routing.qdrant.io
11+
names:
12+
kind: EnvoyBootstrapConfig
13+
listKind: EnvoyBootstrapConfigList
14+
plural: envoybootstrapconfigs
15+
shortNames:
16+
- ebc
17+
- ebcs
18+
singular: envoybootstrapconfig
19+
scope: Namespaced
20+
versions:
21+
- additionalPrinterColumns:
22+
- jsonPath: .spec.clusterID
23+
name: ClusterID
24+
type: string
25+
- jsonPath: .status.ready
26+
name: Ready
27+
type: boolean
28+
- jsonPath: .metadata.creationTimestamp
29+
name: Age
30+
type: date
31+
name: v1alpha1
32+
schema:
33+
openAPIV3Schema:
34+
description: |-
35+
EnvoyBootstrapConfig is the Schema for the envoybootstrapconfigs API.
36+
It declares the desired state for an Envoy bootstrap configuration.
37+
The route-manager reconciler watches these resources and produces a
38+
ConfigMap (rendered bootstrap JSON) and a Secret (access token) in the
39+
same namespace.
40+
properties:
41+
apiVersion:
42+
description: |-
43+
APIVersion defines the versioned schema of this representation of an object.
44+
Servers should convert recognized schemas to the latest internal value, and
45+
may reject unrecognized values.
46+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
47+
type: string
48+
kind:
49+
description: |-
50+
Kind is a string value representing the REST resource this object represents.
51+
Servers may infer this from the endpoint the client submits requests to.
52+
Cannot be updated.
53+
In CamelCase.
54+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
55+
type: string
56+
metadata:
57+
type: object
58+
spec:
59+
description: EnvoyBootstrapConfigSpec describes the desired Envoy bootstrap
60+
configuration.
61+
properties:
62+
clusterID:
63+
description: |-
64+
ClusterID identifies the Qdrant cluster this Envoy instance serves.
65+
When set the Envoy runs in dedicated mode for this cluster.
66+
When nil it runs in shared mode.
67+
type: string
68+
proxyProtocolEnabled:
69+
default: false
70+
description: ProxyProtocolEnabled enables the PROXY protocol on Envoy
71+
listeners.
72+
type: boolean
73+
type: object
74+
status:
75+
description: EnvoyBootstrapConfigStatus defines the observed state of
76+
EnvoyBootstrapConfig.
77+
properties:
78+
conditions:
79+
description: Conditions represent the latest available observations
80+
of the resource's state.
81+
items:
82+
description: Condition contains details for one aspect of the current
83+
state of this API Resource.
84+
properties:
85+
lastTransitionTime:
86+
description: |-
87+
lastTransitionTime is the last time the condition transitioned from one status to another.
88+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
89+
format: date-time
90+
type: string
91+
message:
92+
description: |-
93+
message is a human readable message indicating details about the transition.
94+
This may be an empty string.
95+
maxLength: 32768
96+
type: string
97+
observedGeneration:
98+
description: |-
99+
observedGeneration represents the .metadata.generation that the condition was set based upon.
100+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
101+
with respect to the current state of the instance.
102+
format: int64
103+
minimum: 0
104+
type: integer
105+
reason:
106+
description: |-
107+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
108+
Producers of specific condition types may define expected values and meanings for this field,
109+
and whether the values are considered a guaranteed API.
110+
The value should be a CamelCase string.
111+
This field may not be empty.
112+
maxLength: 1024
113+
minLength: 1
114+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
115+
type: string
116+
status:
117+
description: status of the condition, one of True, False, Unknown.
118+
enum:
119+
- "True"
120+
- "False"
121+
- Unknown
122+
type: string
123+
type:
124+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
125+
maxLength: 316
126+
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])$
127+
type: string
128+
required:
129+
- lastTransitionTime
130+
- message
131+
- reason
132+
- status
133+
- type
134+
type: object
135+
type: array
136+
configMapName:
137+
description: ConfigMapName is the name of the generated ConfigMap
138+
containing the bootstrap JSON.
139+
type: string
140+
ready:
141+
description: Ready is true once the ConfigMap and Secret exist and
142+
are up-to-date.
143+
type: boolean
144+
secretName:
145+
description: SecretName is the name of the access-token Secret (created
146+
or reused).
147+
type: string
148+
type: object
149+
type: object
150+
served: true
151+
storage: true
152+
subresources:
153+
status: {}
154+
{{ end }}

0 commit comments

Comments
 (0)