1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Feature] [Analytics] Enable TLS and Service (#1662)

This commit is contained in:
Adam Janikowski 2024-05-09 13:12:21 +02:00 committed by GitHub
parent 67f61991f3
commit 21dde23586
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 633 additions and 135 deletions

View file

@ -67,6 +67,8 @@ linters-settings:
alias: schedulerPodResourcesApiv1alpha1
- pkg: github.com/arangodb/kube-arangodb/pkg/apis/shared
alias: shared
- pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/analytics/shared
alias: analyticsShared
- pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/ml/shared
alias: mlShared
- pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/ml/shared/test

View file

@ -13,6 +13,7 @@
- (Feature) (ML) Release V1Beta1 API
- (Maintenance) Update Go to 1.22.3
- (Feature) (Analytics) GAE Integration
- (Feature) (Analytics) Enable TLS and Service
## [1.2.40](https://github.com/arangodb/kube-arangodb/tree/1.2.40) (2024-04-10)
- (Feature) Add Core fields to the Scheduler Container Spec

View file

@ -28,9 +28,14 @@ rules:
- "get"
- "list"
- "watch"
- apiGroups: ["apps"]
resources:
- "statefulsets"
verbs: ["*"]
- apiGroups: [ "" ]
resources:
- "secrets"
- "services"
verbs: [ "*" ]
{{- end }}
{{- end }}

View file

@ -98,7 +98,7 @@ Links:
### .spec.deployment.gpu
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L55)</sup>
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L56)</sup>
GPU defined if GPU Jobs are enabled.
@ -231,7 +231,7 @@ Links:
### .spec.deployment.port
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L58)</sup>
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L59)</sup>
Port defines on which port the container will be listening for connections
@ -262,7 +262,7 @@ Links:
### .spec.deployment.replicas
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L39)</sup>
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L40)</sup>
Replicas defines the number of replicas running specified components. No replicas created if no components are defined.
@ -305,7 +305,7 @@ Links:
### .spec.deployment.service.type
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment_service.go#L37)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment_service.go#L38)</sup>
Type determines how the Service is exposed
@ -317,6 +317,7 @@ Possible Values:
* `"NodePort"` - service will be exposed on one port of every node, in addition to 'ClusterIP' type
* `"LoadBalancer"` - service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type
* `"ExternalName"` - service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved
* `"None"` - service is not created
***
@ -361,7 +362,7 @@ Links:
### .spec.deployment.tls.altNames
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment_tls.go#L28)</sup>
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/tls.go#L28)</sup>
AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
@ -369,7 +370,7 @@ AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
### .spec.deployment.tls.enabled
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1alpha1/extension_spec_deployment_tls.go#L25)</sup>
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/tls.go#L25)</sup>
Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings

View file

@ -98,7 +98,7 @@ Links:
### .spec.deployment.gpu
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L55)</sup>
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L56)</sup>
GPU defined if GPU Jobs are enabled.
@ -231,7 +231,7 @@ Links:
### .spec.deployment.port
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L58)</sup>
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L59)</sup>
Port defines on which port the container will be listening for connections
@ -262,7 +262,7 @@ Links:
### .spec.deployment.replicas
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L39)</sup>
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L40)</sup>
Replicas defines the number of replicas running specified components. No replicas created if no components are defined.
@ -305,7 +305,7 @@ Links:
### .spec.deployment.service.type
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment_service.go#L37)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment_service.go#L38)</sup>
Type determines how the Service is exposed
@ -317,6 +317,7 @@ Possible Values:
* `"NodePort"` - service will be exposed on one port of every node, in addition to 'ClusterIP' type
* `"LoadBalancer"` - service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type
* `"ExternalName"` - service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved
* `"None"` - service is not created
***
@ -361,7 +362,7 @@ Links:
### .spec.deployment.tls.altNames
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment_tls.go#L28)</sup>
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/tls.go#L28)</sup>
AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
@ -369,7 +370,7 @@ AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
### .spec.deployment.tls.enabled
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_spec_deployment_tls.go#L25)</sup>
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/tls.go#L25)</sup>
Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings

View file

@ -8,6 +8,48 @@ title: GraphAnalyticsEngine V1Alpha1
## Spec
### .spec.deployment.port
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/analytics/v1alpha1/gae_spec_deployment.go#L42)</sup>
Port defines on which port the container will be listening for connections
***
### .spec.deployment.service.type
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/analytics/v1alpha1/gae_spec_deployment_service.go#L38)</sup>
Type determines how the Service is exposed
Links:
* [Kubernetes Documentation](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)
Possible Values:
* `"ClusterIP"` (default) - service will only be accessible inside the cluster, via the cluster IP
* `"NodePort"` - service will be exposed on one port of every node, in addition to 'ClusterIP' type
* `"LoadBalancer"` - service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type
* `"ExternalName"` - service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved
* `"None"` - service is not created
***
### .spec.deployment.tls.altNames
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/tls.go#L28)</sup>
AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
***
### .spec.deployment.tls.enabled
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/tls.go#L25)</sup>
Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings
***
### .spec.deploymentName
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/analytics/v1alpha1/gae_spec.go#L30)</sup>
@ -16,15 +58,7 @@ DeploymentName define deployment name used in the object. Immutable
## Status
### .status.conditions
Type: `api.Conditions` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/analytics/v1alpha1/gae_status.go#L31)</sup>
Conditions specific to the entire extension
***
### .status.deployment.checksum
### .status.arangoDB.deployment.checksum
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L61)</sup>
@ -32,7 +66,7 @@ UID keeps the information about object Checksum
***
### .status.deployment.name
### .status.arangoDB.deployment.name
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L52)</sup>
@ -40,7 +74,7 @@ Name of the object
***
### .status.deployment.namespace
### .status.arangoDB.deployment.namespace
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L55)</sup>
@ -48,7 +82,143 @@ Namespace of the object. Should default to the namespace of the parent object
***
### .status.deployment.uid
### .status.arangoDB.deployment.uid
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L58)</sup>
UID keeps the information about object UID
***
### .status.arangoDB.secret.checksum
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L61)</sup>
UID keeps the information about object Checksum
***
### .status.arangoDB.secret.name
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L52)</sup>
Name of the object
***
### .status.arangoDB.secret.namespace
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L55)</sup>
Namespace of the object. Should default to the namespace of the parent object
***
### .status.arangoDB.secret.uid
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L58)</sup>
UID keeps the information about object UID
***
### .status.arangoDB.tls.checksum
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L61)</sup>
UID keeps the information about object Checksum
***
### .status.arangoDB.tls.name
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L52)</sup>
Name of the object
***
### .status.arangoDB.tls.namespace
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L55)</sup>
Namespace of the object. Should default to the namespace of the parent object
***
### .status.arangoDB.tls.uid
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L58)</sup>
UID keeps the information about object UID
***
### .status.conditions
Type: `api.Conditions` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/analytics/v1alpha1/gae_status.go#L30)</sup>
Conditions specific to the entire extension
***
### .status.reconciliation.service.checksum
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L61)</sup>
UID keeps the information about object Checksum
***
### .status.reconciliation.service.name
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L52)</sup>
Name of the object
***
### .status.reconciliation.service.namespace
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L55)</sup>
Namespace of the object. Should default to the namespace of the parent object
***
### .status.reconciliation.service.uid
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L58)</sup>
UID keeps the information about object UID
***
### .status.reconciliation.statefulSet.checksum
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L61)</sup>
UID keeps the information about object Checksum
***
### .status.reconciliation.statefulSet.name
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L52)</sup>
Name of the object
***
### .status.reconciliation.statefulSet.namespace
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L55)</sup>
Namespace of the object. Should default to the namespace of the parent object
***
### .status.reconciliation.statefulSet.uid
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L58)</sup>

View file

@ -23,8 +23,10 @@ package v1alpha1
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
const (
LicenseValidCondition api.ConditionType = "LicenseValid"
DeploymentFoundCondition api.ConditionType = "DeploymentFound"
ReadyCondition api.ConditionType = "Ready"
SpecValidCondition api.ConditionType = "SpecValid"
LicenseValidCondition api.ConditionType = "LicenseValid"
DeploymentFoundCondition api.ConditionType = "DeploymentFound"
ReadyCondition api.ConditionType = "Ready"
SpecValidCondition api.ConditionType = "SpecValid"
StatefulSetReadyCondition api.ConditionType = "StatefulSetReady"
TLSEnabledCondition api.ConditionType = "TLSEnabled"
)

View file

@ -28,6 +28,16 @@ import (
type GraphAnalyticsEngineSpec struct {
// DeploymentName define deployment name used in the object. Immutable
DeploymentName *string `json:"deploymentName,omitempty"`
// Deployment specifies how the GAE will be deployed into cluster
Deployment *GraphAnalyticsEngineSpecDeployment `json:"deployment,omitempty"`
}
func (a *GraphAnalyticsEngineSpec) GetDeployment() *GraphAnalyticsEngineSpecDeployment {
if a == nil || a.Deployment == nil {
return nil
}
return a.Deployment
}
func (g *GraphAnalyticsEngineSpec) Validate() error {

View file

@ -0,0 +1,74 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
)
const (
GraphAnalyticsEngineSpecDeploymentApi = "api"
GraphAnalyticsEngineDeploymentComponentDefaultPort = 8502
)
type GraphAnalyticsEngineSpecDeployment struct {
// Service defines how components will be exposed
Service *GraphAnalyticsEngineSpecDeploymentService `json:"service,omitempty"`
// TLS defined TLS Settings
TLS *sharedApi.TLS `json:"tls,omitempty"`
// Port defines on which port the container will be listening for connections
Port *int32 `json:"port,omitempty"`
}
func (g *GraphAnalyticsEngineSpecDeployment) GetPort(def int32) int32 {
if g == nil || g.Port == nil {
return def
}
return *g.Port
}
func (g *GraphAnalyticsEngineSpecDeployment) GetService() *GraphAnalyticsEngineSpecDeploymentService {
if g == nil {
return nil
}
return g.Service
}
func (g *GraphAnalyticsEngineSpecDeployment) GetTLS() *sharedApi.TLS {
if g == nil {
return nil
}
return g.TLS
}
func (g *GraphAnalyticsEngineSpecDeployment) Validate() error {
if g == nil {
return nil
}
return shared.WithErrors(
shared.PrefixResourceErrors("service", shared.ValidateOptional(g.GetService(), func(s GraphAnalyticsEngineSpecDeploymentService) error { return s.Validate() })),
)
}

View file

@ -0,0 +1,58 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
core "k8s.io/api/core/v1"
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
)
type GraphAnalyticsEngineSpecDeploymentService struct {
// Type determines how the Service is exposed
// +doc/enum: ClusterIP|service will only be accessible inside the cluster, via the cluster IP
// +doc/enum: NodePort|service will be exposed on one port of every node, in addition to 'ClusterIP' type
// +doc/enum: LoadBalancer|service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type
// +doc/enum: ExternalName|service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved
// +doc/enum: None|service is not created
// +doc/default: ClusterIP
// +doc/link: Kubernetes Documentation|https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
Type *core.ServiceType `json:"type,omitempty"`
}
func (g *GraphAnalyticsEngineSpecDeploymentService) GetType() core.ServiceType {
if g == nil || g.Type == nil {
return core.ServiceTypeClusterIP
}
return *g.Type
}
func (g *GraphAnalyticsEngineSpecDeploymentService) Validate() error {
if g == nil {
return nil
}
errs := []error{
shared.PrefixResourceErrors("type", shared.ValidateServiceType(g.GetType())),
}
return shared.WithErrors(errs...)
}

View file

@ -22,7 +22,6 @@ package v1alpha1
import (
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
)
type GraphAnalyticsEngineStatus struct {
@ -30,6 +29,9 @@ type GraphAnalyticsEngineStatus struct {
// +doc/type: api.Conditions
Conditions api.ConditionList `json:"conditions,omitempty"`
// Deployment keeps the ArangoDeployment reference
Deployment *sharedApi.Object `json:"deployment,omitempty"`
// ArangoDB keeps the information about local arangodb reference
ArangoDB *GraphAnalyticsEngineStatusArangoDBRef `json:"arangoDB,omitempty"`
// Reconciliation keeps the information about reconciliation process. For internal use.
Reconciliation *GraphAnalyticsEngineStatusReconciliation `json:"reconciliation,omitempty"`
}

View file

@ -0,0 +1,32 @@
//
// DISCLAIMER
//
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
type GraphAnalyticsEngineStatusArangoDBRef struct {
// Secret keeps the information about ArangoDB deployment
Secret *sharedApi.Object `json:"secret,omitempty"`
// TLS keeps information about TLS Secret rendered from ArangoDB deployment
TLS *sharedApi.Object `json:"tls,omitempty"`
// Deployment keeps the ArangoDeployment reference
Deployment *sharedApi.Object `json:"deployment,omitempty"`
}

View file

@ -20,26 +20,23 @@
package v1alpha1
type ArangoMLExtensionSpecDeploymentTLS struct {
// Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings
Enabled *bool `json:"enabled,omitempty"`
import sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
// AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
AltNames []string `json:"altNames,omitempty"`
type GraphAnalyticsEngineStatusReconciliation struct {
StatefulSet *sharedApi.Object `json:"statefulSet,omitempty"`
Service *sharedApi.Object `json:"service,omitempty"`
}
func (a *ArangoMLExtensionSpecDeploymentTLS) IsEnabled() bool {
if a == nil || a.Enabled == nil {
return true
}
return *a.Enabled
}
func (a *ArangoMLExtensionSpecDeploymentTLS) GetAltNames() []string {
if a == nil || a.AltNames == nil {
func (g *GraphAnalyticsEngineStatusReconciliation) GetStatefulSet() *sharedApi.Object {
if g == nil {
return nil
}
return a.AltNames
return g.StatefulSet
}
func (g *GraphAnalyticsEngineStatusReconciliation) GetService() *sharedApi.Object {
if g == nil {
return nil
}
return g.Service
}

View file

@ -26,8 +26,9 @@
package v1alpha1
import (
v1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
corev1 "k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@ -100,6 +101,11 @@ func (in *GraphAnalyticsEngineSpec) DeepCopyInto(out *GraphAnalyticsEngineSpec)
*out = new(string)
**out = **in
}
if in.Deployment != nil {
in, out := &in.Deployment, &out.Deployment
*out = new(GraphAnalyticsEngineSpecDeployment)
(*in).DeepCopyInto(*out)
}
return
}
@ -113,19 +119,76 @@ func (in *GraphAnalyticsEngineSpec) DeepCopy() *GraphAnalyticsEngineSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GraphAnalyticsEngineSpecDeployment) DeepCopyInto(out *GraphAnalyticsEngineSpecDeployment) {
*out = *in
if in.Service != nil {
in, out := &in.Service, &out.Service
*out = new(GraphAnalyticsEngineSpecDeploymentService)
(*in).DeepCopyInto(*out)
}
if in.TLS != nil {
in, out := &in.TLS, &out.TLS
*out = new(v1.TLS)
(*in).DeepCopyInto(*out)
}
if in.Port != nil {
in, out := &in.Port, &out.Port
*out = new(int32)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GraphAnalyticsEngineSpecDeployment.
func (in *GraphAnalyticsEngineSpecDeployment) DeepCopy() *GraphAnalyticsEngineSpecDeployment {
if in == nil {
return nil
}
out := new(GraphAnalyticsEngineSpecDeployment)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GraphAnalyticsEngineSpecDeploymentService) DeepCopyInto(out *GraphAnalyticsEngineSpecDeploymentService) {
*out = *in
if in.Type != nil {
in, out := &in.Type, &out.Type
*out = new(corev1.ServiceType)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GraphAnalyticsEngineSpecDeploymentService.
func (in *GraphAnalyticsEngineSpecDeploymentService) DeepCopy() *GraphAnalyticsEngineSpecDeploymentService {
if in == nil {
return nil
}
out := new(GraphAnalyticsEngineSpecDeploymentService)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GraphAnalyticsEngineStatus) DeepCopyInto(out *GraphAnalyticsEngineStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make(v1.ConditionList, len(*in))
*out = make(deploymentv1.ConditionList, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Deployment != nil {
in, out := &in.Deployment, &out.Deployment
*out = new(sharedv1.Object)
if in.ArangoDB != nil {
in, out := &in.ArangoDB, &out.ArangoDB
*out = new(GraphAnalyticsEngineStatusArangoDBRef)
(*in).DeepCopyInto(*out)
}
if in.Reconciliation != nil {
in, out := &in.Reconciliation, &out.Reconciliation
*out = new(GraphAnalyticsEngineStatusReconciliation)
(*in).DeepCopyInto(*out)
}
return
@ -140,3 +203,60 @@ func (in *GraphAnalyticsEngineStatus) DeepCopy() *GraphAnalyticsEngineStatus {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GraphAnalyticsEngineStatusArangoDBRef) DeepCopyInto(out *GraphAnalyticsEngineStatusArangoDBRef) {
*out = *in
if in.Secret != nil {
in, out := &in.Secret, &out.Secret
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
if in.TLS != nil {
in, out := &in.TLS, &out.TLS
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
if in.Deployment != nil {
in, out := &in.Deployment, &out.Deployment
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GraphAnalyticsEngineStatusArangoDBRef.
func (in *GraphAnalyticsEngineStatusArangoDBRef) DeepCopy() *GraphAnalyticsEngineStatusArangoDBRef {
if in == nil {
return nil
}
out := new(GraphAnalyticsEngineStatusArangoDBRef)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GraphAnalyticsEngineStatusReconciliation) DeepCopyInto(out *GraphAnalyticsEngineStatusReconciliation) {
*out = *in
if in.StatefulSet != nil {
in, out := &in.StatefulSet, &out.StatefulSet
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
if in.Service != nil {
in, out := &in.Service, &out.Service
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GraphAnalyticsEngineStatusReconciliation.
func (in *GraphAnalyticsEngineStatusReconciliation) DeepCopy() *GraphAnalyticsEngineStatusReconciliation {
if in == nil {
return nil
}
out := new(GraphAnalyticsEngineStatusReconciliation)
in.DeepCopyInto(out)
return out
}

View file

@ -24,6 +24,7 @@ import (
schedulerContainerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/container"
schedulerPodApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/pod"
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
)
@ -42,7 +43,7 @@ type ArangoMLExtensionSpecDeployment struct {
Service *ArangoMLExtensionSpecDeploymentService `json:"service,omitempty"`
// TLS defined TLS Settings for extension
TLS *ArangoMLExtensionSpecDeploymentTLS `json:"tls,omitempty"`
TLS *sharedApi.TLS `json:"tls,omitempty"`
// Pod defines base template for pods
*schedulerPodApiv1alpha1.Pod
@ -102,7 +103,7 @@ func (s *ArangoMLExtensionSpecDeployment) GetService() *ArangoMLExtensionSpecDep
return s.Service
}
func (s *ArangoMLExtensionSpecDeployment) GetTLS() *ArangoMLExtensionSpecDeploymentTLS {
func (s *ArangoMLExtensionSpecDeployment) GetTLS() *sharedApi.TLS {
if s == nil {
return nil
}

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -32,6 +32,7 @@ type ArangoMLExtensionSpecDeploymentService struct {
// +doc/enum: NodePort|service will be exposed on one port of every node, in addition to 'ClusterIP' type
// +doc/enum: LoadBalancer|service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type
// +doc/enum: ExternalName|service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved
// +doc/enum: None|service is not created
// +doc/default: ClusterIP
// +doc/link: Kubernetes Documentation|https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
Type *core.ServiceType `json:"type,omitempty"`

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -40,5 +40,5 @@ type ArangoMLExtensionStatus struct {
ArangoDB *ArangoMLExtensionStatusArangoDBRef `json:"arangoDB,omitempty"`
// Reconciliation keeps the information about reconciliation process. For internal use.
Reconciliation *ArangoMLExtensionStatusReconciliation `json:"reconciliation"`
Reconciliation *ArangoMLExtensionStatusReconciliation `json:"reconciliation,omitempty"`
}

View file

@ -382,7 +382,7 @@ func (in *ArangoMLExtensionSpecDeployment) DeepCopyInto(out *ArangoMLExtensionSp
}
if in.TLS != nil {
in, out := &in.TLS, &out.TLS
*out = new(ArangoMLExtensionSpecDeploymentTLS)
*out = new(sharedv1.TLS)
(*in).DeepCopyInto(*out)
}
if in.Pod != nil {
@ -439,32 +439,6 @@ func (in *ArangoMLExtensionSpecDeploymentService) DeepCopy() *ArangoMLExtensionS
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoMLExtensionSpecDeploymentTLS) DeepCopyInto(out *ArangoMLExtensionSpecDeploymentTLS) {
*out = *in
if in.Enabled != nil {
in, out := &in.Enabled, &out.Enabled
*out = new(bool)
**out = **in
}
if in.AltNames != nil {
in, out := &in.AltNames, &out.AltNames
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoMLExtensionSpecDeploymentTLS.
func (in *ArangoMLExtensionSpecDeploymentTLS) DeepCopy() *ArangoMLExtensionSpecDeploymentTLS {
if in == nil {
return nil
}
out := new(ArangoMLExtensionSpecDeploymentTLS)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoMLExtensionSpecMetadataService) DeepCopyInto(out *ArangoMLExtensionSpecMetadataService) {
*out = *in

View file

@ -23,17 +23,17 @@ package v1beta1
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
const (
ReadyCondition api.ConditionType = "Ready"
SpecValidCondition api.ConditionType = "SpecValid"
ExtensionFoundCondition api.ConditionType = "ExtensionFound"
ExtensionStorageFoundCondition api.ConditionType = "StorageFound"
ExtensionDeploymentFoundCondition api.ConditionType = "DeploymentFound"
ExtensionBootstrapCompletedCondition api.ConditionType = "BootstrapCompleted"
ExtensionMetadataServiceValidCondition api.ConditionType = "MetadataServiceValid"
ExtensionServiceAccountReadyCondition api.ConditionType = "ServiceAccountReady"
ExtensionStatefulSetReadyCondition api.ConditionType = "ExtensionDeploymentReady"
ExtensionTLSEnabledCondition api.ConditionType = "TLSEnabled"
LicenseValidCondition api.ConditionType = "LicenseValid"
CronJobSyncedCondition api.ConditionType = "CronJobSynced"
BatchJobSyncedCondition api.ConditionType = "BatchJobSynced"
ReadyCondition api.ConditionType = "Ready"
SpecValidCondition api.ConditionType = "SpecValid"
ExtensionFoundCondition api.ConditionType = "ExtensionFound"
StorageFoundCondition api.ConditionType = "StorageFound"
DeploymentFoundCondition api.ConditionType = "DeploymentFound"
BootstrapCompletedCondition api.ConditionType = "BootstrapCompleted"
MetadataServiceValidCondition api.ConditionType = "MetadataServiceValid"
ServiceAccountReadyCondition api.ConditionType = "ServiceAccountReady"
StatefulSetReadyCondition api.ConditionType = "StatefulSetReady"
TLSEnabledCondition api.ConditionType = "TLSEnabled"
LicenseValidCondition api.ConditionType = "LicenseValid"
CronJobSyncedCondition api.ConditionType = "CronJobSynced"
BatchJobSyncedCondition api.ConditionType = "BatchJobSynced"
)

View file

@ -24,6 +24,7 @@ import (
schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container"
schedulerPodApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod"
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
)
@ -42,7 +43,7 @@ type ArangoMLExtensionSpecDeployment struct {
Service *ArangoMLExtensionSpecDeploymentService `json:"service,omitempty"`
// TLS defined TLS Settings for extension
TLS *ArangoMLExtensionSpecDeploymentTLS `json:"tls,omitempty"`
TLS *sharedApi.TLS `json:"tls,omitempty"`
// Pod defines base template for pods
*schedulerPodApi.Pod
@ -102,7 +103,7 @@ func (s *ArangoMLExtensionSpecDeployment) GetService() *ArangoMLExtensionSpecDep
return s.Service
}
func (s *ArangoMLExtensionSpecDeployment) GetTLS() *ArangoMLExtensionSpecDeploymentTLS {
func (s *ArangoMLExtensionSpecDeployment) GetTLS() *sharedApi.TLS {
if s == nil {
return nil
}

View file

@ -32,6 +32,7 @@ type ArangoMLExtensionSpecDeploymentService struct {
// +doc/enum: NodePort|service will be exposed on one port of every node, in addition to 'ClusterIP' type
// +doc/enum: LoadBalancer|service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type
// +doc/enum: ExternalName|service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved
// +doc/enum: None|service is not created
// +doc/default: ClusterIP
// +doc/link: Kubernetes Documentation|https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
Type *core.ServiceType `json:"type,omitempty"`

View file

@ -40,5 +40,5 @@ type ArangoMLExtensionStatus struct {
ArangoDB *ArangoMLExtensionStatusArangoDBRef `json:"arangoDB,omitempty"`
// Reconciliation keeps the information about reconciliation process. For internal use.
Reconciliation *ArangoMLExtensionStatusReconciliation `json:"reconciliation"`
Reconciliation *ArangoMLExtensionStatusReconciliation `json:"reconciliation,omitempty"`
}

View file

@ -151,7 +151,7 @@ func (in *ArangoMLExtensionSpecDeployment) DeepCopyInto(out *ArangoMLExtensionSp
}
if in.TLS != nil {
in, out := &in.TLS, &out.TLS
*out = new(ArangoMLExtensionSpecDeploymentTLS)
*out = new(v1.TLS)
(*in).DeepCopyInto(*out)
}
if in.Pod != nil {
@ -208,32 +208,6 @@ func (in *ArangoMLExtensionSpecDeploymentService) DeepCopy() *ArangoMLExtensionS
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoMLExtensionSpecDeploymentTLS) DeepCopyInto(out *ArangoMLExtensionSpecDeploymentTLS) {
*out = *in
if in.Enabled != nil {
in, out := &in.Enabled, &out.Enabled
*out = new(bool)
**out = **in
}
if in.AltNames != nil {
in, out := &in.AltNames, &out.AltNames
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoMLExtensionSpecDeploymentTLS.
func (in *ArangoMLExtensionSpecDeploymentTLS) DeepCopy() *ArangoMLExtensionSpecDeploymentTLS {
if in == nil {
return nil
}
out := new(ArangoMLExtensionSpecDeploymentTLS)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoMLExtensionSpecMetadataService) DeepCopyInto(out *ArangoMLExtensionSpecMetadataService) {
*out = *in

View file

@ -18,9 +18,9 @@
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1beta1
package v1
type ArangoMLExtensionSpecDeploymentTLS struct {
type TLS struct {
// Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings
Enabled *bool `json:"enabled,omitempty"`
@ -28,7 +28,7 @@ type ArangoMLExtensionSpecDeploymentTLS struct {
AltNames []string `json:"altNames,omitempty"`
}
func (a *ArangoMLExtensionSpecDeploymentTLS) IsEnabled() bool {
func (a *TLS) IsEnabled() bool {
if a == nil || a.Enabled == nil {
return true
}
@ -36,7 +36,7 @@ func (a *ArangoMLExtensionSpecDeploymentTLS) IsEnabled() bool {
return *a.Enabled
}
func (a *ArangoMLExtensionSpecDeploymentTLS) GetAltNames() []string {
func (a *TLS) GetAltNames() []string {
if a == nil || a.AltNames == nil {
return nil
}

View file

@ -136,3 +136,29 @@ func (in *ServiceAccountRole) DeepCopy() *ServiceAccountRole {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TLS) DeepCopyInto(out *TLS) {
*out = *in
if in.Enabled != nil {
in, out := &in.Enabled, &out.Enabled
*out = new(bool)
**out = **in
}
if in.AltNames != nil {
in, out := &in.AltNames, &out.AltNames
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLS.
func (in *TLS) DeepCopy() *TLS {
if in == nil {
return nil
}
out := new(TLS)
in.DeepCopyInto(out)
return out
}

View file

@ -35,6 +35,10 @@ var (
resourceNameRE = regexp.MustCompile(`^([0-9\-\.a-z])+$`)
)
const (
ServiceTypeNone core.ServiceType = "None"
)
// ValidateResourceName validates a kubernetes resource name.
// If not valid, an error is returned.
// See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
@ -146,7 +150,8 @@ func ValidateServiceType(st core.ServiceType) error {
case core.ServiceTypeClusterIP,
core.ServiceTypeNodePort,
core.ServiceTypeLoadBalancer,
core.ServiceTypeExternalName:
core.ServiceTypeExternalName,
ServiceTypeNone:
return nil
}
return errors.Errorf("Unsupported service type %s", st)

View file

@ -3,6 +3,39 @@ v1alpha1:
properties:
spec:
properties:
deployment:
description: Deployment specifies how the GAE will be deployed into cluster
properties:
port:
description: Port defines on which port the container will be listening for connections
format: int32
type: integer
service:
description: Service defines how components will be exposed
properties:
type:
description: Type determines how the Service is exposed
enum:
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
- None
type: string
type: object
tls:
description: TLS defined TLS Settings
properties:
altNames:
description: AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
items:
type: string
type: array
enabled:
description: Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings
type: boolean
type: object
type: object
deploymentName:
description: DeploymentName define deployment name used in the object. Immutable
type: string

View file

@ -856,6 +856,7 @@ v1alpha1:
- NodePort
- LoadBalancer
- ExternalName
- None
type: string
type: object
serviceAccountName:
@ -13944,10 +13945,12 @@ v1beta1:
tls:
properties:
altNames:
description: AltNames define TLS AltNames used when TLS on the ArangoDB is enabled
items:
type: string
type: array
enabled:
description: Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings
type: boolean
type: object
tolerations:

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -52,10 +52,14 @@ const (
LabelValueArangoActive = "true"
// LabelKeyArangoMLStatefulSet is the key of the label used to define k8s StatefulSet for ML Extension
LabelKeyArangoMLStatefulSet = "ml.arangodb.com/statefulset"
// LabelKeyAnalyticsGAEStatefulSet is the key of the label used to define k8s StatefulSet for Analytics GAE
LabelKeyAnalyticsGAEStatefulSet = "analytics.arangodb.com/statefulset"
// AppName is the value for the "app" label
AppName = "arangodb"
// AppArangoML is the value for the "app" label
AppArangoML = "arangoml"
// AppAnalytics is the value for the "app" label
AppAnalytics = "analytics"
)
// AddOwnerRefToObject adds given owner reference to given object