Skip to content

Commit 20f553c

Browse files
committed
[Bugfix] Fix Gateway Options
1 parent 0a339b4 commit 20f553c

Some content is hidden

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

48 files changed

+2248
-0
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
@@ -10,6 +10,7 @@
1010
- (Feature) (Integration) Basic Envs
1111
- (Maintenance) Inspector Generics
1212
- (Bugfix) Fix Gateway Options
13+
- (Feature) (Platform) Storage
1314

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

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 }}
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/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+
}

pkg/apis/platform/v1alpha1/storage.go

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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 (
24+
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
25+
26+
"github.com/arangodb/kube-arangodb/pkg/apis/networking"
27+
)
28+
29+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
30+
31+
// ArangoPlatformStorageList is a list of ArangoPlatform Storage.
32+
type ArangoPlatformStorageList struct {
33+
meta.TypeMeta `json:",inline"`
34+
meta.ListMeta `json:"metadata,omitempty"`
35+
36+
Items []ArangoPlatformStorage `json:"items"`
37+
}
38+
39+
// +genclient
40+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
41+
42+
// ArangoPlatformStorage contains definition and status of the ArangoPlatform Storage.
43+
type ArangoPlatformStorage struct {
44+
meta.TypeMeta `json:",inline"`
45+
meta.ObjectMeta `json:"metadata,omitempty"`
46+
47+
Spec ArangoPlatformStorageSpec `json:"spec"`
48+
Status ArangoPlatformStorageStatus `json:"status"`
49+
}
50+
51+
// AsOwner creates an OwnerReference for the given Extension
52+
func (a *ArangoPlatformStorage) AsOwner() meta.OwnerReference {
53+
trueVar := true
54+
return meta.OwnerReference{
55+
APIVersion: SchemeGroupVersion.String(),
56+
Kind: networking.ArangoRouteResourceKind,
57+
Name: a.Name,
58+
UID: a.UID,
59+
Controller: &trueVar,
60+
}
61+
}
62+
63+
func (a *ArangoPlatformStorage) GetStatus() ArangoPlatformStorageStatus {
64+
return a.Status
65+
}
66+
67+
func (a *ArangoPlatformStorage) SetStatus(status ArangoPlatformStorageStatus) {
68+
a.Status = status
69+
}

0 commit comments

Comments
 (0)