8000 [Feature] ArangoRoute CRD · arangodb/kube-arangodb@764187f · GitHub
[go: up one dir, main page]

Skip to content

Commit 764187f

Browse files
committed
[Feature] ArangoRoute CRD
1 parent 375c89e commit 764187f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2775
-25
lines changed

.golangci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ linters-settings:
7777
alias: mlSharedTests
7878
- pkg: github.com/arangodb/kube-arangodb/pkg/apis/analytics/v1alpha1
7979
alias: analyticsApi
80+
- pkg: github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1
81+
alias: networkingApi
8082
- pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1
8183
alias: mlApi
8284
- pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
4+
- (Feature) ArangoRoute CRD
45

56
## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23)
67
- (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ update-generated:
440440
apps:v1 \
441441
ml:v1alpha1 ml:v1beta1 \
442442
scheduler:v1alpha1 scheduler:v1beta1 \
443-
analytics:v1alpha1" \
443+
analytics:v1alpha1 \
444+
networking:v1alpha1" \
444445
--go-header-file "./tools/codegen/boilerplate.go.txt" \
445446
$(VERIFYARGS)
446447
GOPATH=$(GOBUILDDIR) $(VENDORDIR)/k8s.io/code-generator/generate-groups.sh \
@@ -894,7 +895,8 @@ CRDS:=apps-job \
894895
replication-deploymentreplication \
895896
ml-storage ml-extension ml-job-batch ml-job-cron \
896897
scheduler-profile \
897-
analytics-graphanalyticsengine
898+
analytics-graphanalyticsengine \
899+
networking-route
898900

899901
.PHONY: sync
900902
sync:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: arangoroutes.networking.arangodb.com
5+
spec:
6+
group: networking.arangodb.com
7+
names:
8+
kind: ArangoRoute
9+
listKind: ArangoRouteList
10+
plural: arangoroutes
11+
singular: arangoroute
12+
scope: Namespaced
13+
versions:
14+
- name: v1alpha1
15+
schema:
16+
openAPIV3Schema:
17+
type: object
18+
x-kubernetes-preserve-unknown-fields: true
19+
served: true
20+
storage: true
21+
subresources:
22+
status: {}

chart/kube-arangodb/templates/deployment-operator/role.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ rules:
1616
- apiGroups: ["database.arangodb.com"]
1717
resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"]
1818
verbs: ["*"]
19+
- apiGroups: ["networking.arangodb.com"]
20+
resources: ["arangoroutes", "arangoroutes/status"]
21+
verbs: ["*"]
1922
{{- if .Values.rbac.extensions.acs }}
2023
- apiGroups: ["database.arangodb.com"]
2124
resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"]

docs/api/ArangoRoute.V1Alpha1.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
layout: page
3+
parent: CRD reference
4+
title: ArangoRoute V1Alpha1
5+
---
6+
7+
# API Reference for ArangoRoute V1Alpha1
8+
9+
## Spec
10+
11+
### .spec.deployment
12+
13+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec.go#L7)</sup>
14+
15+
Deployment specifies the ArangoDeployment object name
16+
17+
***
18+
19+
### .spec.destination.schema
20+
21+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L10)</sup>
22+
23+
Schema defines HTTP/S schema used for connection
24+
25+
***
26+
27+
### .spec.destination.service.checksum
28+
29+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61)</sup>
30+
31+
UID keeps the information about object Checksum
32+
33+
***
34+
35+
### .spec.destination.service.name
36+
37+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52)</sup>
38+
39+
Name of the object
40+
41+
***
42+
43+
### .spec.destination.service.namespace
44+
45+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55)</sup>
46+
47+
Namespace of the object. Should default to the namespace of the parent object
48+
49+
***
50+
51+
### .spec.destination.service.port
52+
53+
Type: `intstr.IntOrString` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_service.go#L16)</sup>
54+
55+
Port defines Port or Port Name used as destination
56+
57+
Links:
58+
* [Documentation](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/)
59+
60+
***
61+
62+
### .spec.destination.service.uid
63+
64+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58)</sup>
65+
66+
UID keeps the information about object UID
67+
68+
***
69+
70+
### .spec.destination.tls.insecure
71+
72+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go#L5)</sup>
73+
74+
Insecure allows Insecure traffic
75+
76+
***
77+
78+
### .spec.route.path
79+
80+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_route.go#L9)</sup>
81+
82+
Path specifies the Path route
83+
84+
## Status
85+
86+
### .status.conditions
87+
88+
Type: `api.Conditions` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status.go#L8)</sup>
89+
90+
Conditions specific to the entire extension
91+

internal/cr_validation_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
deploymentv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1"
4141
mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
4242
mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
43+
networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
4344
replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1"
4445
replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1"
4546
schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
@@ -283,6 +284,15 @@ func Test_GenerateCRValidationSchemas(t *testing.T) {
283284
},
284285
},
285286
},
287+
"networking-route": {
288+
fmt.Sprintf("%s/pkg/apis/networking/v1alpha1", root): {
289+
"v1alpha1": {
290+
objects: map[string]interface{}{
291+
"spec": networkingApi.ArangoRoute{}.Spec,
292+
},
293+
},
294+
},
295+
},
286296
}
287297

288298
for filePrefix, packagesToVersion := range input {

internal/docs_parser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func isSimpleType(obj reflect.Type) (string, string, bool) {
293293
}
294294

295295
func extractTag(tag string) (string, bool) {
296-
parts := strings.SplitN(tag, ",", 2)
296+
parts := strings.Split(tag, ",")
297297

298298
if len(parts) == 1 {
299299
return parts[0], false

internal/docs_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
4343
mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
4444
mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
45+
networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
4546
replicationApi "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1"
4647
schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
4748
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
@@ -249,6 +250,19 @@ func Test_GenerateAPIDocs(t *testing.T) {
249250
},
250251
},
251252
},
253+
"networking": map[string]inputPackage{
254+
"v1alpha1": {
255+
Types: inputPackageTypes{
256+
"ArangoRoute.V1Alpha1": {
257+
"Spec": networkingApi.ArangoRoute{}.Spec,
258+
"Status": networkingApi.ArangoRoute{}.Status,
259+
},
260+
},
261+
Shared: []string{
262+
"shared/v1",
263+
},
264+
},
265+
},
252266
"analytics": map[string]inputPackage{
253267
"v1alpha1": {
254268
Types: inputPackageTypes{

internal/schema_builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func (b *schemaBuilder) StructToSchema(t *testing.T, structObj reflect.Type, pat
228228
schema.Properties[k] = v
229229
}
230230
} else {
231-
require.NotEmpty(t, n, fullFieldName)
231+
require.NotEmpty(t, n, fullFieldName, inline)
232232
schema.Properties[n] = *s
233233
}
234234
}

0 commit comments

Comments
 (0)
0