Skip to content

Commit bffc453

Browse files
committed
[Feature] [Platform] Storage
1 parent 87d14d5 commit bffc453

Some content is hidden

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

54 files changed

+2316
-58
lines changed

.golangci.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ linters-settings:
6161
pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1
6262
- alias: networkingApi
6363
pkg: github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1
64+
- alias: platformApi
65+
pkg: github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1
6466
- alias: schedulerApiv1alpha1
6567
pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1
6668
- alias: schedulerContainerApiv1alpha1

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- (Feature) (Integration) SchedulerV2
1010
- (Feature) (Integration) Basic Envs
1111
- (Maintenance) Inspector Generics
12+
- (Feature) (Platform) Storage
1213

1314
## [1.2.43](https://github.com/arangodb/kube-arangodb/tree/1.2.43) (2024-10-14)
1415
- (Feature) ArangoRoute CRD

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

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ 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: ["*"]
2219
{{- if .Values.rbac.extensions.acs }}
2320
- apiGroups: ["database.arangodb.com"]
2421
resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"]

chart/kube-arangodb/templates/deployment.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ spec:
123123
{{ if .Values.operator.features.scheduler }}
124124
- --operator.scheduler
125125
{{- end }}
126+
{{ if .Values.operator.features.platform }}
127+
- --operator.platform
128+
{{- end }}
126129
{{ if .Values.operator.features.k8sToK8sClusterSync }}
127130
- --operator.k2k-cluster-sync
128131
{{- end }}

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

+6-51
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,11 @@ metadata:
1313
app.kubernetes.io/instance: {{ .Release.Name }}
1414
release: {{ .Release.Name }}
1515
rules:
16-
- apiGroups:
17-
- "ml.arangodb.com"
18-
resources:
19-
- "arangomlextensions"
20-
- "arangomlextensions/status"
21-
- "arangomlbatchjobs"
22-
- "arangomlbatchjobs/status"
23-
- "arangomlcronjobs"
24-
- "arangomlcronjobs/status"
25-
- "arangomlstorages"
26-
- "arangomlstorages/status"
27-
verbs:
28-
- "*"
29-
- apiGroups:
30-
- "scheduler.arangodb.com"
31-
resources:
32-
- "arangoprofiles"
33-
- "arangoprofiles/status"
34-
verbs:
35-
- "*"
36-
- apiGroups:
37-
- "database.arangodb.com"
38-
resources:
39-
- "arangodeployments"
40-
verbs:
41-
- "get"
42-
- "list"
43-
- "watch"
44-
- apiGroups:
45-
- "rbac.authorization.k8s.io"
46-
resources:
47-
- "roles"
48-
- "rolebindings"
49-
verbs: ["*"]
50-
- apiGroups:
51-
- "batch"
52-
resources:
53-
- "cronjobs"
54-
- "jobs"
55-
verbs: ["*"]
56-
- apiGroups: ["apps"]
57-
resources:
58-
- "statefulsets"
59-
verbs: ["*"]
60-
- apiGroups: [""]
61-
resources:
62-
- "pods"
63-
- "secrets"
64-
- "services"
65-
- "serviceaccounts"
66-
verbs: ["*"]
16+
- apiGroups: ["networking.arangodb.com"]
17+
resources: ["arangoroutes", "arangoroutes/status"]
18+
verbs: ["*"]
19+
- apiGroups: [""]
20+
resources: ["pods", "services", "endpoints"]
21+
verbs: ["get", "list", "watch"]
6722
{{- end }}
6823
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
3+
{{ if .Values.operator.features.platform -}}
4+
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: ClusterRoleBinding
7+
metadata:
8+
name: {{ template "kube-arangodb.rbac-cluster" . }}-platform
9+
labels:
10+
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
11+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
12+
app.kubernetes.io/managed-by: {{ .Release.Service }}
13+
app.kubernetes.io/instance: {{ .Release.Name }}
14+
release: {{ .Release.Name }}
15+
roleRef:
16+
apiGroup: rbac.authorization.k8s.io
17+
kind: ClusterRole
18+
name: {{ template "kube-arangodb.rbac-cluster" . }}-platform
19+
subjects:
20+
- kind: ServiceAccount
21+
name: {{ template "kube-arangodb.operatorName" . }}
22+
namespace: {{ .Release.Namespace }}
23+
24+
{{- end }}
25+
{{- end }}
26+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
3+
{{ if .Values.operator.features.platform -}}
4+
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: ClusterRole
7+
metadata:
8+
name: {{ template "kube-arangodb.rbac-cluster" . }}-platform
9+
labels:
10+
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
11+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
12+
app.kubernetes.io/managed-by: {{ .Release.Service }}
13+
app.kubernetes.io/instance: {{ .Release.Name }}
14+
release: {{ .Release.Name }}
15+
rules:
16+
- apiGroups: ["apiextensions.k8s.io"]
17+
resources: ["customresourcedefinitions"]
18+
verbs: ["get", "list", "watch"]
19+
20+
{{- end }}
21+
{{- end }}
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{ if .Values.rbac.enabled -}}
2+
{{ if .Values.operator.features.platform -}}
3+
4+
apiVersion: rbac.authorization.k8s.io/v1
5+
kind: RoleBinding
6+
metadata:
7+
name: {{ template "kube-arangodb.rbac" . }}-platform
8+
namespace: {{ .Release.Namespace }}
9+
labels:
10+
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
11+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
12+
app.kubernetes.io/managed-by: {{ .Release.Service }}
13+
app.kubernetes.io/instance: {{ .Release.Name }}
14+
release: {{ .Release.Name }}
15+
roleRef:
16+
apiGroup: rbac.authorization.k8s.io
17+
kind: Role
18+
name: {{ template "kube-arangodb.rbac" . }}-platform
19+
subjects:
20+
- kind: ServiceAccount
21+
name: {{ template "kube-arangodb.operatorName" . }}
22+
namespace: {{ .Release.Namespace }}
23+
24+
{{- end }}
25+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{ if .Values.rbac.enabled -}}
2+
{{ if .Values.operator.features.platform -}}
3+
4+
apiVersion: rbac.authorization.k8s.io/v1
5+
kind: Role
6+
metadata:
7+
name: {{ template "kube-arangodb.rbac" . }}-platform
8+
namespace: {{ .Release.Namespace }}
9+
labels:
10+
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
11+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
12+
app.kubernetes.io/managed-by: {{ .Release.Service }}
13+
app.kubernetes.io/instance: {{ .Release.Name }}
14+
release: {{ .Release.Name }}
15+
rules:
16+
- apiGroups: ["platform.arangodb.com"]
17+
resources: ["arangoplatformstorages", "arangoplatformstorages/status"]
18+
verbs: ["*"]
19+
- apiGroups: [""]
20+
resources: ["pods", "services", "endpoints"]
21+
verbs: ["get", "list", "watch"]
22+
{{- end }}
23+
{{- end }}

chart/kube-arangodb/values.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ operator:
3636
analytics: false
3737
networking: true
3838
scheduler: true
39+
platform: true
3940
tolerations: []
4041
rbac:
4142
enabled: true

pkg/apis/networking/v1alpha1/route_spec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type ArangoRouteSpec struct {
3434
}
3535

3636
func (s *ArangoRouteSpec) GetDeployment() string {
37-
if s == nil || s.Destination == nil {
37+
if s == nil || s.Deployment == nil {
3838
return ""
3939
}
4040

pkg/apis/platform/definitions.go

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package platform
22+
23+
const (
24+
ArangoPlatformStorageCRDName = ArangoPlatformStorageResourcePlural + "." + ArangoPlatformGroupName
25+
ArangoPlatformStorageResourceKind = "ArangoPlatformStorage"
26+
ArangoPlatformStorageResourcePlural = "arangoplatformstorages"
27+
28+
ArangoPlatformGroupName = "platform.arangodb.com"
29+
)
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package v1alpha1
22+
23+
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
24+
25+
const (
26+
SpecValidCondition api.ConditionType = "SpecValid"
27+
ReadyCondition api.ConditionType = "Ready"
28+
)

pkg/apis/platform/v1alpha1/doc.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
// +k8s:deepcopy-gen=package
22+
// +groupName=platform.arangodb.com
23+
package v1alpha1
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package v1alpha1
22+
23+
import (
24+
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
25+
"k8s.io/apimachinery/pkg/runtime"
26+
"k8s.io/apimachinery/pkg/runtime/schema"
27+
28+
"github.com/arangodb/kube-arangodb/pkg/apis/networking"
29+
)
30+
31+
const (
32+
ArangoPlatformVersion = "v1alpha1"
33+
)
34+
35+
var (
36+
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
37+
AddToScheme = SchemeBuilder.AddToScheme
38+
39+
SchemeGroupVersion = schema.GroupVersion{Group: networking.ArangoNetworkingGroupName, Version: ArangoPlatformVersion}
40+
)
41+
42+
// Resource gets an ArangoCluster GroupResource for a specified resource
43+
func Resource(resource string) schema.GroupResource {
44+
return SchemeGroupVersion.WithResource(resource).GroupResource()
45+
}
46+
47+
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
48+
func addKnownTypes(s *runtime.Scheme) error {
49+
s.AddKnownTypes(SchemeGroupVersion,
50+
&ArangoPlatformStorage{},
51+
&ArangoPlatformStorageList{},
52+
)
53+
meta.AddToGroupVersion(s, SchemeGroupVersion)
54+
return nil
55+
}

0 commit comments

Comments
 (0)