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

[Docs] Add docs for DeploymentSpec (#1363)

This commit is contained in:
Nikita Vaniasin 2023-07-25 10:52:51 +02:00 committed by GitHub
parent 7bc9dc3b84
commit ba6dcc0961
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 645 additions and 227 deletions

View file

@ -538,31 +538,42 @@ Links:
AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L160)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L163)
### .spec.annotations: map[string]string
Annotations specified the annotations added to Pods in this group.
Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVCs, PDBs).
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L143)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L126)
### .spec.annotationsIgnoreList: []string
AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L145)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L129)
### .spec.annotationsMode: string
AnnotationsMode Define annotations mode which should be use while overriding annotations
AnnotationsMode defines annotations mode which should be use while overriding annotations.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L147)
Possible Values:
* disabled (default) - Disable annotations/labels override. Default if there is no annotations/labels set in ArangoDeployment
* append - Add new annotations/labels without affecting old ones
* replace - Replace existing annotations/labels
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L135)
### .spec.architecture: []string
Architecture definition of supported architectures
Architecture defines the list of supported architectures.
First element on the list is marked as default architecture.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L208)
Links:
* [Architecture Change](/docs/design/arch_change.md)
Default Value: ['amd64']
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L258)
### .spec.auth.jwtSecretName: string
@ -599,13 +610,20 @@ Required only of domain is not set to default (cluster.local)
Default Value: cluster.local
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L196)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L237)
### .spec.communicationMethod: string
CommunicationMethod define communication method used in deployment
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L199)
Possible Values:
* headless (default) - Define old communication mechanism, based on headless service.
* dns - Define ClusterIP Service DNS based communication.
* short-dns - Define ClusterIP Service DNS based communication. Use namespaced short DNS (used in migration)
* headless-dns - Define Headless Service DNS based communication.
* ip - Define ClusterIP Service IP based communication.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L245)
### .spec.coordinators.affinity: core.PodAffinity
@ -1679,55 +1697,81 @@ Links:
### .spec.disableIPv6: bool
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L134)
DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers.
This setting cannot be changed after the deployment has been created.
Default Value: false
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L109)
### .spec.downtimeAllowed: bool
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L133)
DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment.
When this setting is set to false, no automatic action that may result in downtime is allowed.
If the need for such an action is detected, an event is added to the ArangoDeployment.
Once this setting is set to true, the automatic action is executed.
Operations that may result in downtime are:
- Rotating TLS CA certificate
Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting.
Default Value: false
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L104)
### .spec.environment: string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L122)
Environment setting specifies the type of environment in which the deployment is created.
Possible Values:
* Development (default) - This value optimizes the deployment for development use. It is possible to run a deployment on a small number of nodes (e.g. minikube).
* Production - This value optimizes the deployment for production use. It puts required affinity constraints on all pods to avoid Agents & DB-Servers from running on the same machine.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L65)
### .spec.externalAccess.advertisedEndpoint: string
AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L45)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L55)
### .spec.externalAccess.loadBalancerIP: string
Optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L38)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L45)
### .spec.externalAccess.loadBalancerSourceRanges: []string
LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type
If specified and supported by the platform, this will restrict traffic through the cloud-provider
load-balancer will be restricted to the specified client IPs. This field will be ignored if the
cloud-provider does not support the feature.
More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
+docs/link: Cloud Provider Firewall|https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L43)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L52)
### .spec.externalAccess.managedServiceNames: []string
ManagedServiceNames keeps names of services which are not managed by KubeArangoDB.
It is only relevant when type of service is `managed`.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L48)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L59)
### .spec.externalAccess.nodePort: int
Optional port used in case of Auto or NodePort type.
NodePort define optional port used in case of Auto or NodePort type.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L36)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L42)
### .spec.externalAccess.type: string
Type of external access
Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster.
+ doc/enum: Auto|Create a Service of type LoadBalancer and fallback to a Service or type NodePort when the LoadBalancer is not assigned an IP address.
+ doc/enum: None|limit access to application running inside the Kubernetes cluster.
+ doc/enum: LoadBalancer|Create a Service of type LoadBalancer for the ArangoDB deployment.
+ doc/enum: NodePort|Create a Service of type NodePort for the ArangoDB deployment.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L34)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L39)
### .spec.features.foxx.queues: bool
@ -1886,7 +1930,12 @@ Links:
### .spec.image: string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L124)
Image specifies the docker image to use for all ArangoDB servers.
In a development environment this setting defaults to arangodb/arangodb:latest.
For production environments this is a required setting without a default value.
It is highly recommend to use explicit version (not latest) for production environments.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L78)
### .spec.imageDiscoveryMode: string
@ -1896,33 +1945,50 @@ Possible Values:
* kubelet (default) - Use sha256 of the discovered image in the pods
* direct - Use image provided in the spec.image directly in the pods
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L131)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L94)
### .spec.imagePullPolicy: string
### .spec.imagePullPolicy: core.PullPolicy
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L125)
ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers.
Links:
* [Documentation of core.PullPolicy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy)
Possible Values:
* Always (default) - Means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.
* Never - Means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present
* IfNotPresent - Means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L86)
### .spec.imagePullSecrets: []string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L126)
ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L89)
### .spec.labels: map[string]string
Labels specified the labels added to Pods in this group.
Labels specifies the labels added to Pods in this group.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L149)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L138)
### .spec.labelsIgnoreList: []string
LabelsIgnoreList list regexp or plain definitions which labels should be ignored
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L151)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L141)
### .spec.labelsMode: string
LabelsMode Define labels mode which should be use while overriding labels
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L153)
Possible Values:
* disabled (default) - Disable annotations/labels override. Default if there is no annotations/labels set in ArangoDeployment
* append - Add new annotations/labels without affecting old ones
* replace - Replace existing annotations/labels
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L147)
### .spec.license.secretName: string
@ -1939,7 +2005,17 @@ Links:
### .spec.memberPropagationMode: string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L183)
MemberPropagationMode defines how changes to pod spec should be propogated.
Changes to a pods configuration require a restart of that pod in almost all cases.
Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator.
The propagation of the configuration changes can be deferred to the next restart, either triggered manually by the user or by another operation like an upgrade.
This reduces the number of restarts for upgrading both the server and the operator from two to one.
Possible Values:
* always (default) - Restart the member as soon as a configuration change is discovered
* on-restart - Wait until the next restart to change the member configuration
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L220)
### .spec.metrics.authentication.jwtTokenSecretName: string
@ -1999,11 +2075,19 @@ Possible Values:
This field is **immutable**: Change of the ArangoDeployment Mode is not possible after creation.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L120)
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L60)
### .spec.networkAttachedVolumes: bool
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L140)
NetworkAttachedVolumes
If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation).
Furthermore, the pod will simply be redeployed on a different node, rather than cleaned and retired and replaced by a new member.
You must only set this option to true if your persistent volumes are “movable” in the sense that they can be mounted from a different k8s node, like in the case of network attached volumes.
If your persistent volumes are tied to a specific pod, you must leave this option on false.
Default Value: true
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L123)
### .spec.rebalancer.enabled: bool
@ -2030,11 +2114,22 @@ Count Enable Shard Count machanism
### .spec.restoreEncryptionSecret: string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L157)
RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L160)
### .spec.restoreFrom: string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L155)
RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from.
After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key.
It will contain some of the following fields:
- `requestedFrom`: name of the ArangoBackup used to restore from.
- `message`: optional message explaining why the restore failed.
- `state`: state indicating if the restore was successful or not. Possible values: Restoring, Restored, RestoreFailed
If the restoreFrom key is removed from the spec, the restore key is deleted as well.
A new restore attempt is made if and only if either in the status restore is not set or if spec.restoreFrom and status.requestedFrom are different.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L157)
### .spec.rocksdb.encryption.keySecretName: string
@ -2574,7 +2669,14 @@ Links:
### .spec.storageEngine: string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L123)
StorageEngine specifies the type of storage engine used for all servers in the cluster.
This setting cannot be changed after the cluster has been created.
Possible Values:
* RocksDB (default) - To use the RocksDB storage engine.
* MMFiles - To use the MMFiles storage engine. Deprecated.
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L72)
### .spec.sync.auth.clientCASecretName: string
@ -2596,29 +2698,30 @@ Links:
AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L45)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L55)
### .spec.sync.externalAccess.loadBalancerIP: string
Optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L38)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L45)
### .spec.sync.externalAccess.loadBalancerSourceRanges: []string
LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type
If specified and supported by the platform, this will restrict traffic through the cloud-provider
load-balancer will be restricted to the specified client IPs. This field will be ignored if the
cloud-provider does not support the feature.
More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
+docs/link: Cloud Provider Firewall|https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L43)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L52)
### .spec.sync.externalAccess.managedServiceNames: []string
ManagedServiceNames keeps names of services which are not managed by KubeArangoDB.
It is only relevant when type of service is `managed`.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L48)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L59)
### .spec.sync.externalAccess.masterEndpoint: []string
@ -2626,15 +2729,19 @@ It is only relevant when type of service is `managed`.
### .spec.sync.externalAccess.nodePort: int
Optional port used in case of Auto or NodePort type.
NodePort define optional port used in case of Auto or NodePort type.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L36)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L42)
### .spec.sync.externalAccess.type: string
Type of external access
Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster.
+ doc/enum: Auto|Create a Service of type LoadBalancer and fallback to a Service or type NodePort when the LoadBalancer is not assigned an IP address.
+ doc/enum: None|limit access to application running inside the Kubernetes cluster.
+ doc/enum: LoadBalancer|Create a Service of type LoadBalancer for the ArangoDB deployment.
+ doc/enum: NodePort|Create a Service of type NodePort for the ArangoDB deployment.
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L34)
[Code Reference](/pkg/apis/deployment/v1/external_access_spec.go#L39)
### .spec.sync.image: string
@ -3752,7 +3859,10 @@ MaintenanceGracePeriod action timeout
### .spec.timezone: string
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L210)
Timezone if specified, will set a timezone for deployment.
Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London`
[Code Reference](/pkg/apis/deployment/v1/deployment_spec.go#L262)
### .spec.tls.altNames: []string

View file

@ -29,6 +29,13 @@ import (
"github.com/arangodb/kube-arangodb/pkg/apis/shared"
)
// ArangoDeploymentArchitecture defines the list of supported architectures.
// Possible values are:
// - `amd64`: Use processors with the x86-64 architecture.
// - `arm64`: Use processors with the 64-bit ARM architecture.
// The setting expects a list of strings, but you should only specify a single list item for the architecture, except when you want to migrate from one architecture to the other.
// The first list item defines the new default architecture for the deployment that you want to migrate to.
// To use the ARM architecture, you need to enable it in the operator first using --set "operator.architectures={amd64,arm64}". See Installation with Helm.
type ArangoDeploymentArchitecture []ArangoDeploymentArchitectureType
func (a ArangoDeploymentArchitecture) GetDefault() ArangoDeploymentArchitectureType {

View file

@ -0,0 +1,83 @@
//
// DISCLAIMER
//
// Copyright 2023 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 v1
import core "k8s.io/api/core/v1"
// DeploymentCommunicationMethod define communication method used for inter-cluster communication
type DeploymentCommunicationMethod string
const (
// DefaultDeploymentCommunicationMethod define default communication method.
DefaultDeploymentCommunicationMethod = DeploymentCommunicationMethodHeadlessService
// DeploymentCommunicationMethodHeadlessService define old communication mechanism, based on headless service.
DeploymentCommunicationMethodHeadlessService DeploymentCommunicationMethod = "headless"
// DeploymentCommunicationMethodDNS define ClusterIP Service DNS based communication.
DeploymentCommunicationMethodDNS DeploymentCommunicationMethod = "dns"
// DeploymentCommunicationMethodShortDNS define ClusterIP Service DNS based communication. Use namespaced short DNS (used in migration)
DeploymentCommunicationMethodShortDNS DeploymentCommunicationMethod = "short-dns"
// DeploymentCommunicationMethodHeadlessDNS define Headless Service DNS based communication.
DeploymentCommunicationMethodHeadlessDNS DeploymentCommunicationMethod = "headless-dns"
// DeploymentCommunicationMethodIP define ClusterIP Service IP based communication.
DeploymentCommunicationMethodIP DeploymentCommunicationMethod = "ip"
)
// Get returns communication method from pointer. If pointer is nil default is returned.
func (d *DeploymentCommunicationMethod) Get() DeploymentCommunicationMethod {
if d == nil {
return DefaultDeploymentCommunicationMethod
}
switch v := *d; v {
case DeploymentCommunicationMethodHeadlessService, DeploymentCommunicationMethodDNS, DeploymentCommunicationMethodIP, DeploymentCommunicationMethodShortDNS, DeploymentCommunicationMethodHeadlessDNS:
return v
default:
return DefaultDeploymentCommunicationMethod
}
}
// ServiceType returns Service Type for communication method
func (d *DeploymentCommunicationMethod) ServiceType() core.ServiceType {
switch d.Get() {
default:
return core.ServiceTypeClusterIP
}
}
// ServiceClusterIP returns Service ClusterIP for communication method
func (d *DeploymentCommunicationMethod) ServiceClusterIP() string {
switch d.Get() {
case DeploymentCommunicationMethodHeadlessDNS:
return core.ClusterIPNone
default:
return ""
}
}
// String returns string representation of method.
func (d DeploymentCommunicationMethod) String() string {
return string(d)
}
// New returns pointer.
func (d DeploymentCommunicationMethod) New() *DeploymentCommunicationMethod {
return &d
}

View file

@ -49,66 +49,6 @@ func validatePullPolicy(v core.PullPolicy) error {
}
}
// DeploymentCommunicationMethod define communication method used for inter-cluster communication
type DeploymentCommunicationMethod string
// Get returns communication method from pointer. If pointer is nil default is returned.
func (d *DeploymentCommunicationMethod) Get() DeploymentCommunicationMethod {
if d == nil {
return DefaultDeploymentCommunicationMethod
}
switch v := *d; v {
case DeploymentCommunicationMethodHeadlessService, DeploymentCommunicationMethodDNS, DeploymentCommunicationMethodIP, DeploymentCommunicationMethodShortDNS, DeploymentCommunicationMethodHeadlessDNS:
return v
default:
return DefaultDeploymentCommunicationMethod
}
}
// ServiceType returns Service Type for communication method
func (d *DeploymentCommunicationMethod) ServiceType() core.ServiceType {
switch d.Get() {
default:
return core.ServiceTypeClusterIP
}
}
// ServiceClusterIP returns Service ClusterIP for communication method
func (d *DeploymentCommunicationMethod) ServiceClusterIP() string {
switch d.Get() {
case DeploymentCommunicationMethodHeadlessDNS:
return core.ClusterIPNone
default:
return ""
}
}
// String returns string representation of method.
func (d DeploymentCommunicationMethod) String() string {
return string(d)
}
// New returns pointer.
func (d DeploymentCommunicationMethod) New() *DeploymentCommunicationMethod {
return &d
}
const (
// DefaultDeploymentCommunicationMethod define default communication method.
DefaultDeploymentCommunicationMethod = DeploymentCommunicationMethodHeadlessService
// DeploymentCommunicationMethodHeadlessService define old communication mechanism, based on headless service.
DeploymentCommunicationMethodHeadlessService DeploymentCommunicationMethod = "headless"
// DeploymentCommunicationMethodDNS define ClusterIP Service DNS based communication.
DeploymentCommunicationMethodDNS DeploymentCommunicationMethod = "dns"
// DeploymentCommunicationMethodShortDNS define ClusterIP Service DNS based communication. Use namespaced short DNS (used in migration)
DeploymentCommunicationMethodShortDNS DeploymentCommunicationMethod = "short-dns"
// DeploymentCommunicationMethodHeadlessDNS define Headless Service DNS based communication.
DeploymentCommunicationMethodHeadlessDNS DeploymentCommunicationMethod = "headless-dns"
// DeploymentCommunicationMethodIP define ClusterIP Service IP based communication.
DeploymentCommunicationMethodIP DeploymentCommunicationMethod = "ip"
)
// DeploymentSpec contains the spec part of a ArangoDeployment resource.
type DeploymentSpec struct {
@ -119,75 +59,176 @@ type DeploymentSpec struct {
// +doc/immutable: Change of the ArangoDeployment Mode is not possible after creation.
Mode *DeploymentMode `json:"mode,omitempty"`
Environment *Environment `json:"environment,omitempty"`
StorageEngine *StorageEngine `json:"storageEngine,omitempty"`
Image *string `json:"image,omitempty"`
ImagePullPolicy *core.PullPolicy `json:"imagePullPolicy,omitempty"`
ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
// Environment setting specifies the type of environment in which the deployment is created.
// +doc/enum: Development|This value optimizes the deployment for development use. It is possible to run a deployment on a small number of nodes (e.g. minikube).
// +doc/enum: Production|This value optimizes the deployment for production use. It puts required affinity constraints on all pods to avoid Agents & DB-Servers from running on the same machine.
Environment *Environment `json:"environment,omitempty"`
// StorageEngine specifies the type of storage engine used for all servers in the cluster.
// +doc/enum: RocksDB|To use the RocksDB storage engine.
// +doc/enum: MMFiles|To use the MMFiles storage engine. Deprecated.
// This setting cannot be changed after the cluster has been created.
// +doc/default: RocksDB
StorageEngine *StorageEngine `json:"storageEngine,omitempty"`
// Image specifies the docker image to use for all ArangoDB servers.
// In a development environment this setting defaults to arangodb/arangodb:latest.
// For production environments this is a required setting without a default value.
// It is highly recommend to use explicit version (not latest) for production environments.
Image *string `json:"image,omitempty"`
// ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers.
// +doc/type: core.PullPolicy
// +doc/enum: Always|Means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.
// +doc/enum: Never|Means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present
// +doc/enum: IfNotPresent|Means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.
// +doc/link: Documentation of core.PullPolicy|https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
ImagePullPolicy *core.PullPolicy `json:"imagePullPolicy,omitempty"`
// ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers.
ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
// ImageDiscoveryMode specifies the image discovery mode.
// +doc/enum: kubelet|Use sha256 of the discovered image in the pods
// +doc/enum: direct|Use image provided in the spec.image directly in the pods
ImageDiscoveryMode *DeploymentImageDiscoveryModeSpec `json:"imageDiscoveryMode,omitempty"`
// DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment.
// When this setting is set to false, no automatic action that may result in downtime is allowed.
// If the need for such an action is detected, an event is added to the ArangoDeployment.
// Once this setting is set to true, the automatic action is executed.
// Operations that may result in downtime are:
// - Rotating TLS CA certificate
// Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting.
// +doc/default: false
DowntimeAllowed *bool `json:"downtimeAllowed,omitempty"`
DisableIPv6 *bool `json:"disableIPv6,omitempty"`
// DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers.
// This setting cannot be changed after the deployment has been created.
// +doc/default: false
DisableIPv6 *bool `json:"disableIPv6,omitempty"`
// Upgrade allows to configure upgrade-related options
Upgrade *DeploymentUpgradeSpec `json:"upgrade,omitempty"`
// Features allows to configure feature flags
Features *DeploymentFeatures `json:"features,omitempty"`
// NetworkAttachedVolumes
// If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation).
// Furthermore, the pod will simply be redeployed on a different node, rather than cleaned and retired and replaced by a new member.
// You must only set this option to true if your persistent volumes are “movable” in the sense that they can be mounted from a different k8s node, like in the case of network attached volumes.
// If your persistent volumes are tied to a specific pod, you must leave this option on false.
// +doc/default: true
NetworkAttachedVolumes *bool `json:"networkAttachedVolumes,omitempty"`
// Annotations specified the annotations added to Pods in this group.
// Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVCs, PDBs).
Annotations map[string]string `json:"annotations,omitempty"`
// AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored
AnnotationsIgnoreList []string `json:"annotationsIgnoreList,omitempty"`
// AnnotationsMode Define annotations mode which should be use while overriding annotations
// AnnotationsMode defines annotations mode which should be use while overriding annotations.
// +doc/enum: disabled|Disable annotations/labels override. Default if there is no annotations/labels set in ArangoDeployment
// +doc/enum: append|Add new annotations/labels without affecting old ones
// +doc/enum: replace|Replace existing annotations/labels
AnnotationsMode *LabelsMode `json:"annotationsMode,omitempty"`
// Labels specified the labels added to Pods in this group.
// Labels specifies the labels added to Pods in this group.
Labels map[string]string `json:"labels,omitempty"`
// LabelsIgnoreList list regexp or plain definitions which labels should be ignored
LabelsIgnoreList []string `json:"labelsIgnoreList,omitempty"`
// LabelsMode Define labels mode which should be use while overriding labels
// +doc/enum: disabled|Disable annotations/labels override. Default if there is no annotations/labels set in ArangoDeployment
// +doc/enum: append|Add new annotations/labels without affecting old ones
// +doc/enum: replace|Replace existing annotations/labels
LabelsMode *LabelsMode `json:"labelsMode,omitempty"`
// RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from.
// After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key.
// It will contain some of the following fields:
// - `requestedFrom`: name of the ArangoBackup used to restore from.
// - `message`: optional message explaining why the restore failed.
// - `state`: state indicating if the restore was successful or not. Possible values: Restoring, Restored, RestoreFailed
// If the restoreFrom key is removed from the spec, the restore key is deleted as well.
// A new restore attempt is made if and only if either in the status restore is not set or if spec.restoreFrom and status.requestedFrom are different.
RestoreFrom *string `json:"restoreFrom,omitempty"`
// RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore
RestoreEncryptionSecret *string `json:"restoreEncryptionSecret,omitempty"`
// AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed
AllowUnsafeUpgrade *bool `json:"allowUnsafeUpgrade,omitempty"`
// ExternalAccess holds configuration for the external access provided for the deployment.
ExternalAccess ExternalAccessSpec `json:"externalAccess"`
RocksDB RocksDBSpec `json:"rocksdb"`
Authentication AuthenticationSpec `json:"auth"`
TLS TLSSpec `json:"tls"`
Sync SyncSpec `json:"sync"`
License LicenseSpec `json:"license"`
Metrics MetricsSpec `json:"metrics"`
Lifecycle LifecycleSpec `json:"lifecycle,omitempty"`
// RocksDB holds rocksdb-specific configuration settings
RocksDB RocksDBSpec `json:"rocksdb"`
// Authentication holds authentication configuration settings
Authentication AuthenticationSpec `json:"auth"`
// TLS holds TLS configuration settings
TLS TLSSpec `json:"tls"`
// Sync holds Deployment-to-Deployment synchronization configuration settings
Sync SyncSpec `json:"sync"`
// License holds license settings
License LicenseSpec `json:"license"`
// Metrics holds metrics configuration settings
Metrics MetricsSpec `json:"metrics"`
// Lifecycle holds lifecycle configuration settings
Lifecycle LifecycleSpec `json:"lifecycle,omitempty"`
// ServerIDGroupSpec contains the specification for Image Discovery image.
ID *ServerIDGroupSpec `json:"id,omitempty"`
// Database holds information about database state, like maintenance mode
Database *DatabaseSpec `json:"database,omitempty"`
Single ServerGroupSpec `json:"single"`
Agents ServerGroupSpec `json:"agents"`
DBServers ServerGroupSpec `json:"dbservers"`
Coordinators ServerGroupSpec `json:"coordinators"`
SyncMasters ServerGroupSpec `json:"syncmasters"`
SyncWorkers ServerGroupSpec `json:"syncworkers"`
// Single contains specification for servers running in deployment mode `Single` or `ActiveFailover`.
Single ServerGroupSpec `json:"single"`
// Agents contains specification for Agency pods running in deployment mode `Cluster` or `ActiveFailover`.
Agents ServerGroupSpec `json:"agents"`
// DBServers contains specification for DBServer pods running in deployment mode `Cluster` or `ActiveFailover`.
DBServers ServerGroupSpec `json:"dbservers"`
// Coordinators contains specification for Coordinator pods running in deployment mode `Cluster` or `ActiveFailover`.
Coordinators ServerGroupSpec `json:"coordinators"`
// SyncMasters contains specification for Syncmaster pods running in deployment mode `Cluster`.
SyncMasters ServerGroupSpec `json:"syncmasters"`
// SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`.
SyncWorkers ServerGroupSpec `json:"syncworkers"`
// MemberPropagationMode defines how changes to pod spec should be propogated.
// Changes to a pods configuration require a restart of that pod in almost all cases.
// Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator.
// The propagation of the configuration changes can be deferred to the next restart, either triggered manually by the user or by another operation like an upgrade.
// This reduces the number of restarts for upgrading both the server and the operator from two to one.
// +doc/enum: always|Restart the member as soon as a configuration change is discovered
// +doc/enum: on-restart|Wait until the next restart to change the member configuration
MemberPropagationMode *DeploymentMemberPropagationMode `json:"memberPropagationMode,omitempty"`
// ChaosSpec can be used for chaos-monkey testing of your ArangoDeployment
Chaos ChaosSpec `json:"chaos"`
// Recovery specifies configuration related to cluster recovery.
Recovery *ArangoDeploymentRecoverySpec `json:"recovery,omitempty"`
// Bootstrap contains information for cluster bootstrapping
Bootstrap BootstrapSpec `json:"bootstrap,omitempty"`
// Timeouts object allows to configure various time-outs
Timeouts *Timeouts `json:"timeouts,omitempty"`
// ClusterDomain define domain used in the kubernetes cluster.
@ -196,17 +237,28 @@ type DeploymentSpec struct {
ClusterDomain *string `json:"ClusterDomain,omitempty"`
// CommunicationMethod define communication method used in deployment
// +doc/enum: headless|Define old communication mechanism, based on headless service.
// +doc/enum: dns|Define ClusterIP Service DNS based communication.
// +doc/enum: short-dns|Define ClusterIP Service DNS based communication. Use namespaced short DNS (used in migration)
// +doc/enum: headless-dns|Define Headless Service DNS based communication.
// +doc/enum: ip|Define ClusterIP Service IP based communication.
CommunicationMethod *DeploymentCommunicationMethod `json:"communicationMethod,omitempty"`
// Topology define topology adjustment details, Enterprise only
Topology *TopologySpec `json:"topology,omitempty"`
// Rebalancer define the rebalancer specification
// Rebalancer defines the rebalancer specification
Rebalancer *ArangoDeploymentRebalancerSpec `json:"rebalancer,omitempty"`
// Architecture definition of supported architectures
// Architecture defines the list of supported architectures.
// First element on the list is marked as default architecture.
// +doc/link: Architecture Change|/docs/design/arch_change.md
// +doc/type: []string
// +doc/default: ['amd64']
Architecture ArangoDeploymentArchitecture `json:"architecture,omitempty"`
// Timezone if specified, will set a timezone for deployment.
// Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London`
Timezone *string `json:"timezone,omitempty"`
}
@ -295,7 +347,7 @@ func (s DeploymentSpec) IsDisableIPv6() bool {
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false
func (s DeploymentSpec) IsNetworkAttachedVolumes() bool {
return util.TypeOrDefault[bool](s.NetworkAttachedVolumes, false)
return util.TypeOrDefault[bool](s.NetworkAttachedVolumes, true)
}
// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6

View file

@ -30,19 +30,30 @@ import (
// ExternalAccessSpec holds configuration for the external access provided for the deployment.
type ExternalAccessSpec struct {
// Type of external access
// Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster.
// + doc/enum: Auto|Create a Service of type LoadBalancer and fallback to a Service or type NodePort when the LoadBalancer is not assigned an IP address.
// + doc/enum: None|limit access to application running inside the Kubernetes cluster.
// + doc/enum: LoadBalancer|Create a Service of type LoadBalancer for the ArangoDB deployment.
// + doc/enum: NodePort|Create a Service of type NodePort for the ArangoDB deployment.
Type *ExternalAccessType `json:"type,omitempty"`
// Optional port used in case of Auto or NodePort type.
// NodePort define optional port used in case of Auto or NodePort type.
NodePort *int `json:"nodePort,omitempty"`
// Optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
// LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
LoadBalancerIP *string `json:"loadBalancerIP,omitempty"`
// LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type
// If specified and supported by the platform, this will restrict traffic through the cloud-provider
// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
// cloud-provider does not support the feature.
// More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
// +docs/link: Cloud Provider Firewall|https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
// AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint
AdvertisedEndpoint *string `json:"advertisedEndpoint,omitempty"`
// ManagedServiceNames keeps names of services which are not managed by KubeArangoDB.
// It is only relevant when type of service is `managed`.
ManagedServiceNames []string `json:"managedServiceNames,omitempty"`

View file

@ -31,6 +31,7 @@ type StorageEngine string
const (
// StorageEngineMMFiles yields a cluster using the mmfiles storage engine
// deprecated
StorageEngineMMFiles StorageEngine = "MMFiles"
// StorageEngineRocksDB yields a cluster using the rocksdb storage engine
StorageEngineRocksDB StorageEngine = "RocksDB"

View file

@ -29,6 +29,13 @@ import (
"github.com/arangodb/kube-arangodb/pkg/apis/shared"
)
// ArangoDeploymentArchitecture defines the list of supported architectures.
// Possible values are:
// - `amd64`: Use processors with the x86-64 architecture.
// - `arm64`: Use processors with the 64-bit ARM architecture.
// The setting expects a list of strings, but you should only specify a single list item for the architecture, except when you want to migrate from one architecture to the other.
// The first list item defines the new default architecture for the deployment that you want to migrate to.
// To use the ARM architecture, you need to enable it in the operator first using --set "operator.architectures={amd64,arm64}". See Installation with Helm.
type ArangoDeploymentArchitecture []ArangoDeploymentArchitectureType
func (a ArangoDeploymentArchitecture) GetDefault() ArangoDeploymentArchitectureType {

View file

@ -0,0 +1,83 @@
//
// DISCLAIMER
//
// Copyright 2023 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 v2alpha1
import core "k8s.io/api/core/v1"
// DeploymentCommunicationMethod define communication method used for inter-cluster communication
type DeploymentCommunicationMethod string
const (
// DefaultDeploymentCommunicationMethod define default communication method.
DefaultDeploymentCommunicationMethod = DeploymentCommunicationMethodHeadlessService
// DeploymentCommunicationMethodHeadlessService define old communication mechanism, based on headless service.
DeploymentCommunicationMethodHeadlessService DeploymentCommunicationMethod = "headless"
// DeploymentCommunicationMethodDNS define ClusterIP Service DNS based communication.
DeploymentCommunicationMethodDNS DeploymentCommunicationMethod = "dns"
// DeploymentCommunicationMethodShortDNS define ClusterIP Service DNS based communication. Use namespaced short DNS (used in migration)
DeploymentCommunicationMethodShortDNS DeploymentCommunicationMethod = "short-dns"
// DeploymentCommunicationMethodHeadlessDNS define Headless Service DNS based communication.
DeploymentCommunicationMethodHeadlessDNS DeploymentCommunicationMethod = "headless-dns"
// DeploymentCommunicationMethodIP define ClusterIP Service IP based communication.
DeploymentCommunicationMethodIP DeploymentCommunicationMethod = "ip"
)
// Get returns communication method from pointer. If pointer is nil default is returned.
func (d *DeploymentCommunicationMethod) Get() DeploymentCommunicationMethod {
if d == nil {
return DefaultDeploymentCommunicationMethod
}
switch v := *d; v {
case DeploymentCommunicationMethodHeadlessService, DeploymentCommunicationMethodDNS, DeploymentCommunicationMethodIP, DeploymentCommunicationMethodShortDNS, DeploymentCommunicationMethodHeadlessDNS:
return v
default:
return DefaultDeploymentCommunicationMethod
}
}
// ServiceType returns Service Type for communication method
func (d *DeploymentCommunicationMethod) ServiceType() core.ServiceType {
switch d.Get() {
default:
return core.ServiceTypeClusterIP
}
}
// ServiceClusterIP returns Service ClusterIP for communication method
func (d *DeploymentCommunicationMethod) ServiceClusterIP() string {
switch d.Get() {
case DeploymentCommunicationMethodHeadlessDNS:
return core.ClusterIPNone
default:
return ""
}
}
// String returns string representation of method.
func (d DeploymentCommunicationMethod) String() string {
return string(d)
}
// New returns pointer.
func (d DeploymentCommunicationMethod) New() *DeploymentCommunicationMethod {
return &d
}

View file

@ -49,66 +49,6 @@ func validatePullPolicy(v core.PullPolicy) error {
}
}
// DeploymentCommunicationMethod define communication method used for inter-cluster communication
type DeploymentCommunicationMethod string
// Get returns communication method from pointer. If pointer is nil default is returned.
func (d *DeploymentCommunicationMethod) Get() DeploymentCommunicationMethod {
if d == nil {
return DefaultDeploymentCommunicationMethod
}
switch v := *d; v {
case DeploymentCommunicationMethodHeadlessService, DeploymentCommunicationMethodDNS, DeploymentCommunicationMethodIP, DeploymentCommunicationMethodShortDNS, DeploymentCommunicationMethodHeadlessDNS:
return v
default:
return DefaultDeploymentCommunicationMethod
}
}
// ServiceType returns Service Type for communication method
func (d *DeploymentCommunicationMethod) ServiceType() core.ServiceType {
switch d.Get() {
default:
return core.ServiceTypeClusterIP
}
}
// ServiceClusterIP returns Service ClusterIP for communication method
func (d *DeploymentCommunicationMethod) ServiceClusterIP() string {
switch d.Get() {
case DeploymentCommunicationMethodHeadlessDNS:
return core.ClusterIPNone
default:
return ""
}
}
// String returns string representation of method.
func (d DeploymentCommunicationMethod) String() string {
return string(d)
}
// New returns pointer.
func (d DeploymentCommunicationMethod) New() *DeploymentCommunicationMethod {
return &d
}
const (
// DefaultDeploymentCommunicationMethod define default communication method.
DefaultDeploymentCommunicationMethod = DeploymentCommunicationMethodHeadlessService
// DeploymentCommunicationMethodHeadlessService define old communication mechanism, based on headless service.
DeploymentCommunicationMethodHeadlessService DeploymentCommunicationMethod = "headless"
// DeploymentCommunicationMethodDNS define ClusterIP Service DNS based communication.
DeploymentCommunicationMethodDNS DeploymentCommunicationMethod = "dns"
// DeploymentCommunicationMethodShortDNS define ClusterIP Service DNS based communication. Use namespaced short DNS (used in migration)
DeploymentCommunicationMethodShortDNS DeploymentCommunicationMethod = "short-dns"
// DeploymentCommunicationMethodHeadlessDNS define Headless Service DNS based communication.
DeploymentCommunicationMethodHeadlessDNS DeploymentCommunicationMethod = "headless-dns"
// DeploymentCommunicationMethodIP define ClusterIP Service IP based communication.
DeploymentCommunicationMethodIP DeploymentCommunicationMethod = "ip"
)
// DeploymentSpec contains the spec part of a ArangoDeployment resource.
type DeploymentSpec struct {
@ -119,75 +59,176 @@ type DeploymentSpec struct {
// +doc/immutable: Change of the ArangoDeployment Mode is not possible after creation.
Mode *DeploymentMode `json:"mode,omitempty"`
Environment *Environment `json:"environment,omitempty"`
StorageEngine *StorageEngine `json:"storageEngine,omitempty"`
Image *string `json:"image,omitempty"`
ImagePullPolicy *core.PullPolicy `json:"imagePullPolicy,omitempty"`
ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
// Environment setting specifies the type of environment in which the deployment is created.
// +doc/enum: Development|This value optimizes the deployment for development use. It is possible to run a deployment on a small number of nodes (e.g. minikube).
// +doc/enum: Production|This value optimizes the deployment for production use. It puts required affinity constraints on all pods to avoid Agents & DB-Servers from running on the same machine.
Environment *Environment `json:"environment,omitempty"`
// StorageEngine specifies the type of storage engine used for all servers in the cluster.
// +doc/enum: RocksDB|To use the RocksDB storage engine.
// +doc/enum: MMFiles|To use the MMFiles storage engine. Deprecated.
// This setting cannot be changed after the cluster has been created.
// +doc/default: RocksDB
StorageEngine *StorageEngine `json:"storageEngine,omitempty"`
// Image specifies the docker image to use for all ArangoDB servers.
// In a development environment this setting defaults to arangodb/arangodb:latest.
// For production environments this is a required setting without a default value.
// It is highly recommend to use explicit version (not latest) for production environments.
Image *string `json:"image,omitempty"`
// ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers.
// +doc/type: core.PullPolicy
// +doc/enum: Always|Means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.
// +doc/enum: Never|Means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present
// +doc/enum: IfNotPresent|Means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.
// +doc/link: Documentation of core.PullPolicy|https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
ImagePullPolicy *core.PullPolicy `json:"imagePullPolicy,omitempty"`
// ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers.
ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
// ImageDiscoveryMode specifies the image discovery mode.
// +doc/enum: kubelet|Use sha256 of the discovered image in the pods
// +doc/enum: direct|Use image provided in the spec.image directly in the pods
ImageDiscoveryMode *DeploymentImageDiscoveryModeSpec `json:"imageDiscoveryMode,omitempty"`
// DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment.
// When this setting is set to false, no automatic action that may result in downtime is allowed.
// If the need for such an action is detected, an event is added to the ArangoDeployment.
// Once this setting is set to true, the automatic action is executed.
// Operations that may result in downtime are:
// - Rotating TLS CA certificate
// Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting.
// +doc/default: false
DowntimeAllowed *bool `json:"downtimeAllowed,omitempty"`
DisableIPv6 *bool `json:"disableIPv6,omitempty"`
// DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers.
// This setting cannot be changed after the deployment has been created.
// +doc/default: false
DisableIPv6 *bool `json:"disableIPv6,omitempty"`
// Upgrade allows to configure upgrade-related options
Upgrade *DeploymentUpgradeSpec `json:"upgrade,omitempty"`
// Features allows to configure feature flags
Features *DeploymentFeatures `json:"features,omitempty"`
// NetworkAttachedVolumes
// If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation).
// Furthermore, the pod will simply be redeployed on a different node, rather than cleaned and retired and replaced by a new member.
// You must only set this option to true if your persistent volumes are “movable” in the sense that they can be mounted from a different k8s node, like in the case of network attached volumes.
// If your persistent volumes are tied to a specific pod, you must leave this option on false.
// +doc/default: true
NetworkAttachedVolumes *bool `json:"networkAttachedVolumes,omitempty"`
// Annotations specified the annotations added to Pods in this group.
// Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVCs, PDBs).
Annotations map[string]string `json:"annotations,omitempty"`
// AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored
AnnotationsIgnoreList []string `json:"annotationsIgnoreList,omitempty"`
// AnnotationsMode Define annotations mode which should be use while overriding annotations
// AnnotationsMode defines annotations mode which should be use while overriding annotations.
// +doc/enum: disabled|Disable annotations/labels override. Default if there is no annotations/labels set in ArangoDeployment
// +doc/enum: append|Add new annotations/labels without affecting old ones
// +doc/enum: replace|Replace existing annotations/labels
AnnotationsMode *LabelsMode `json:"annotationsMode,omitempty"`
// Labels specified the labels added to Pods in this group.
// Labels specifies the labels added to Pods in this group.
Labels map[string]string `json:"labels,omitempty"`
// LabelsIgnoreList list regexp or plain definitions which labels should be ignored
LabelsIgnoreList []string `json:"labelsIgnoreList,omitempty"`
// LabelsMode Define labels mode which should be use while overriding labels
// +doc/enum: disabled|Disable annotations/labels override. Default if there is no annotations/labels set in ArangoDeployment
// +doc/enum: append|Add new annotations/labels without affecting old ones
// +doc/enum: replace|Replace existing annotations/labels
LabelsMode *LabelsMode `json:"labelsMode,omitempty"`
// RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from.
// After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key.
// It will contain some of the following fields:
// - `requestedFrom`: name of the ArangoBackup used to restore from.
// - `message`: optional message explaining why the restore failed.
// - `state`: state indicating if the restore was successful or not. Possible values: Restoring, Restored, RestoreFailed
// If the restoreFrom key is removed from the spec, the restore key is deleted as well.
// A new restore attempt is made if and only if either in the status restore is not set or if spec.restoreFrom and status.requestedFrom are different.
RestoreFrom *string `json:"restoreFrom,omitempty"`
// RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore
RestoreEncryptionSecret *string `json:"restoreEncryptionSecret,omitempty"`
// AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed
AllowUnsafeUpgrade *bool `json:"allowUnsafeUpgrade,omitempty"`
// ExternalAccess holds configuration for the external access provided for the deployment.
ExternalAccess ExternalAccessSpec `json:"externalAccess"`
RocksDB RocksDBSpec `json:"rocksdb"`
Authentication AuthenticationSpec `json:"auth"`
TLS TLSSpec `json:"tls"`
Sync SyncSpec `json:"sync"`
License LicenseSpec `json:"license"`
Metrics MetricsSpec `json:"metrics"`
Lifecycle LifecycleSpec `json:"lifecycle,omitempty"`
// RocksDB holds rocksdb-specific configuration settings
RocksDB RocksDBSpec `json:"rocksdb"`
// Authentication holds authentication configuration settings
Authentication AuthenticationSpec `json:"auth"`
// TLS holds TLS configuration settings
TLS TLSSpec `json:"tls"`
// Sync holds Deployment-to-Deployment synchronization configuration settings
Sync SyncSpec `json:"sync"`
// License holds license settings
License LicenseSpec `json:"license"`
// Metrics holds metrics configuration settings
Metrics MetricsSpec `json:"metrics"`
// Lifecycle holds lifecycle configuration settings
Lifecycle LifecycleSpec `json:"lifecycle,omitempty"`
// ServerIDGroupSpec contains the specification for Image Discovery image.
ID *ServerIDGroupSpec `json:"id,omitempty"`
// Database holds information about database state, like maintenance mode
Database *DatabaseSpec `json:"database,omitempty"`
Single ServerGroupSpec `json:"single"`
Agents ServerGroupSpec `json:"agents"`
DBServers ServerGroupSpec `json:"dbservers"`
Coordinators ServerGroupSpec `json:"coordinators"`
SyncMasters ServerGroupSpec `json:"syncmasters"`
SyncWorkers ServerGroupSpec `json:"syncworkers"`
// Single contains specification for servers running in deployment mode `Single` or `ActiveFailover`.
Single ServerGroupSpec `json:"single"`
// Agents contains specification for Agency pods running in deployment mode `Cluster` or `ActiveFailover`.
Agents ServerGroupSpec `json:"agents"`
// DBServers contains specification for DBServer pods running in deployment mode `Cluster` or `ActiveFailover`.
DBServers ServerGroupSpec `json:"dbservers"`
// Coordinators contains specification for Coordinator pods running in deployment mode `Cluster` or `ActiveFailover`.
Coordinators ServerGroupSpec `json:"coordinators"`
// SyncMasters contains specification for Syncmaster pods running in deployment mode `Cluster`.
SyncMasters ServerGroupSpec `json:"syncmasters"`
// SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`.
SyncWorkers ServerGroupSpec `json:"syncworkers"`
// MemberPropagationMode defines how changes to pod spec should be propogated.
// Changes to a pods configuration require a restart of that pod in almost all cases.
// Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator.
// The propagation of the configuration changes can be deferred to the next restart, either triggered manually by the user or by another operation like an upgrade.
// This reduces the number of restarts for upgrading both the server and the operator from two to one.
// +doc/enum: always|Restart the member as soon as a configuration change is discovered
// +doc/enum: on-restart|Wait until the next restart to change the member configuration
MemberPropagationMode *DeploymentMemberPropagationMode `json:"memberPropagationMode,omitempty"`
// ChaosSpec can be used for chaos-monkey testing of your ArangoDeployment
Chaos ChaosSpec `json:"chaos"`
// Recovery specifies configuration related to cluster recovery.
Recovery *ArangoDeploymentRecoverySpec `json:"recovery,omitempty"`
// Bootstrap contains information for cluster bootstrapping
Bootstrap BootstrapSpec `json:"bootstrap,omitempty"`
// Timeouts object allows to configure various time-outs
Timeouts *Timeouts `json:"timeouts,omitempty"`
// ClusterDomain define domain used in the kubernetes cluster.
@ -196,17 +237,28 @@ type DeploymentSpec struct {
ClusterDomain *string `json:"ClusterDomain,omitempty"`
// CommunicationMethod define communication method used in deployment
// +doc/enum: headless|Define old communication mechanism, based on headless service.
// +doc/enum: dns|Define ClusterIP Service DNS based communication.
// +doc/enum: short-dns|Define ClusterIP Service DNS based communication. Use namespaced short DNS (used in migration)
// +doc/enum: headless-dns|Define Headless Service DNS based communication.
// +doc/enum: ip|Define ClusterIP Service IP based communication.
CommunicationMethod *DeploymentCommunicationMethod `json:"communicationMethod,omitempty"`
// Topology define topology adjustment details, Enterprise only
Topology *TopologySpec `json:"topology,omitempty"`
// Rebalancer define the rebalancer specification
// Rebalancer defines the rebalancer specification
Rebalancer *ArangoDeploymentRebalancerSpec `json:"rebalancer,omitempty"`
// Architecture definition of supported architectures
// Architecture defines the list of supported architectures.
// First element on the list is marked as default architecture.
// +doc/link: Architecture Change|/docs/design/arch_change.md
// +doc/type: []string
// +doc/default: ['amd64']
Architecture ArangoDeploymentArchitecture `json:"architecture,omitempty"`
// Timezone if specified, will set a timezone for deployment.
// Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London`
Timezone *string `json:"timezone,omitempty"`
}
@ -295,7 +347,7 @@ func (s DeploymentSpec) IsDisableIPv6() bool {
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false
func (s DeploymentSpec) IsNetworkAttachedVolumes() bool {
return util.TypeOrDefault[bool](s.NetworkAttachedVolumes, false)
return util.TypeOrDefault[bool](s.NetworkAttachedVolumes, true)
}
// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6

View file

@ -30,19 +30,30 @@ import (
// ExternalAccessSpec holds configuration for the external access provided for the deployment.
type ExternalAccessSpec struct {
// Type of external access
// Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster.
// + doc/enum: Auto|Create a Service of type LoadBalancer and fallback to a Service or type NodePort when the LoadBalancer is not assigned an IP address.
// + doc/enum: None|limit access to application running inside the Kubernetes cluster.
// + doc/enum: LoadBalancer|Create a Service of type LoadBalancer for the ArangoDB deployment.
// + doc/enum: NodePort|Create a Service of type NodePort for the ArangoDB deployment.
Type *ExternalAccessType `json:"type,omitempty"`
// Optional port used in case of Auto or NodePort type.
// NodePort define optional port used in case of Auto or NodePort type.
NodePort *int `json:"nodePort,omitempty"`
// Optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
// LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
LoadBalancerIP *string `json:"loadBalancerIP,omitempty"`
// LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type
// If specified and supported by the platform, this will restrict traffic through the cloud-provider
// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
// cloud-provider does not support the feature.
// More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
// +docs/link: Cloud Provider Firewall|https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
// AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint
AdvertisedEndpoint *string `json:"advertisedEndpoint,omitempty"`
// ManagedServiceNames keeps names of services which are not managed by KubeArangoDB.
// It is only relevant when type of service is `managed`.
ManagedServiceNames []string `json:"managedServiceNames,omitempty"`

View file

@ -31,6 +31,7 @@ type StorageEngine string
const (
// StorageEngineMMFiles yields a cluster using the mmfiles storage engine
// deprecated
StorageEngineMMFiles StorageEngine = "MMFiles"
// StorageEngineRocksDB yields a cluster using the rocksdb storage engine
StorageEngineRocksDB StorageEngine = "RocksDB"