Skip to content

Commit 931c9bb

Browse files
committed
Merge branch 'master' into documentation/kube-dc2dc-tutorial
2 parents d5f445b + ee52f80 commit 931c9bb

40 files changed

+484
-212
lines changed

docs/Manual/Deployment/Kubernetes/DeploymentReplicationResource.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ metadata:
3939
name: "replication-from-a-to-b"
4040
spec:
4141
source:
42-
endpoint: ["https://163.172.149.229:31888", "https://51.15.225.110:31888", "https://51.15.229.133:31888"]
42+
masterEndpoint: ["https://163.172.149.229:31888", "https://51.15.225.110:31888", "https://51.15.229.133:31888"]
4343
auth:
4444
keyfileSecretName: cluster-a-sync-auth
4545
tls:
@@ -67,7 +67,7 @@ with sync enabled.
6767

6868
This cluster configured as the replication source.
6969

70-
### `spec.source.endpoint: []string`
70+
### `spec.source.masterEndpoint: []string`
7171

7272
This setting specifies zero or more master endpoint URL's of the source cluster.
7373

@@ -108,7 +108,7 @@ with sync enabled.
108108

109109
This cluster configured as the replication destination.
110110

111-
### `spec.destination.endpoint: []string`
111+
### `spec.destination.masterEndpoint: []string`
112112

113113
This setting specifies zero or more master endpoint URL's of the destination cluster.
114114

docs/Manual/Deployment/Kubernetes/DeploymentResource.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ Possible values are:
107107

108108
This setting cannot be changed after the cluster has been created.
109109

110+
### `spec.downtimeAllowed: bool`
111+
112+
This setting is used to allow automatic reconciliation actions that yield
113+
some downtime of the ArangoDB deployment.
114+
When this setting is set to `false` (the default), no automatic action that
115+
may result in downtime is allowed.
116+
If the need for such an action is detected, an event is added to the `ArangoDeployment`.
117+
118+
Once this setting is set to `true`, the automatic action is executed.
119+
120+
Operations that may result in downtime are:
121+
122+
- Rotating TLS CA certificate
123+
124+
Note: It is still possible that there is some downtime when the Kubernetes
125+
cluster is down, or in a bad state, irrespective of the value of this setting.
126+
110127
### `spec.rocksdb.encryption.keySecretName`
111128

112129
This setting specifies the name of a kubernetes `Secret` that contains

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ import (
3939
"k8s.io/api/core/v1"
4040
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4141
"k8s.io/client-go/kubernetes"
42-
"k8s.io/client-go/kubernetes/scheme"
4342
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
4443
"k8s.io/client-go/tools/record"
4544

4645
"github.com/arangodb/kube-arangodb/pkg/client"
46+
scheme "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme"
4747
"github.com/arangodb/kube-arangodb/pkg/logging"
4848
"github.com/arangodb/kube-arangodb/pkg/operator"
4949
"github.com/arangodb/kube-arangodb/pkg/server"

pkg/apis/deployment/v1alpha/deployment_spec.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ type DeploymentSpec struct {
5050
StorageEngine *StorageEngine `json:"storageEngine,omitempty"`
5151
Image *string `json:"image,omitempty"`
5252
ImagePullPolicy *v1.PullPolicy `json:"imagePullPolicy,omitempty"`
53+
DowntimeAllowed *bool `json:"downtimeAllowed,omitempty"`
5354

5455
ExternalAccess ExternalAccessSpec `json:"externalAccess"`
5556
RocksDB RocksDBSpec `json:"rocksdb"`
@@ -92,6 +93,11 @@ func (s DeploymentSpec) GetImagePullPolicy() v1.PullPolicy {
9293
return util.PullPolicyOrDefault(s.ImagePullPolicy)
9394
}
9495

96+
// IsDowntimeAllowed returns the value of downtimeAllowed.
97+
func (s DeploymentSpec) IsDowntimeAllowed() bool {
98+
return util.BoolOrDefault(s.DowntimeAllowed)
99+
}
100+
95101
// IsAuthenticated returns true when authentication is enabled
96102
func (s DeploymentSpec) IsAuthenticated() bool {
97103
return s.Authentication.IsAuthenticated()
@@ -171,6 +177,9 @@ func (s *DeploymentSpec) SetDefaultsFrom(source DeploymentSpec) {
171177
if s.ImagePullPolicy == nil {
172178
s.ImagePullPolicy = util.NewPullPolicyOrNil(source.ImagePullPolicy)
173179
}
180+
if s.DowntimeAllowed == nil {
181+
s.DowntimeAllowed = util.NewBoolOrNil(source.DowntimeAllowed)
182+
}
174183
s.ExternalAccess.SetDefaultsFrom(source.ExternalAccess)
175184
s.RocksDB.SetDefaultsFrom(source.RocksDB)
176185
s.Authentication.SetDefaultsFrom(source.Authentication)

pkg/apis/deployment/v1alpha/plan.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ const (
5151
ActionTypeRenewTLSCACertificate ActionType = "RenewTLSCACertificate"
5252
)
5353

54+
const (
55+
// MemberIDPreviousAction is used for Action.MemberID when the MemberID
56+
// should be derived from the previous action.
57+
MemberIDPreviousAction = "@previous"
58+
)
59+
5460
// Action represents a single action to be taken to update a deployment.
5561
type Action struct {
5662
// ID of this action (unique for every action)

pkg/apis/deployment/v1alpha/server_group_spec.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,5 @@ func (s ServerGroupSpec) ResetImmutableFields(group ServerGroup, fieldPrefix str
191191
resetFields = append(resetFields, fieldPrefix+".count")
192192
}
193193
}
194-
if s.GetStorageClassName() != target.GetStorageClassName() {
195-
target.StorageClassName = util.NewStringOrNil(s.StorageClassName)
196-
resetFields = append(resetFields, fieldPrefix+".storageClassName")
197-
}
198194
return resetFields
199195
}

pkg/apis/deployment/v1alpha/sync_external_access_spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
type SyncExternalAccessSpec struct {
3636
ExternalAccessSpec
3737
MasterEndpoint []string `json:"masterEndpoint,omitempty"`
38-
AccessPackageSecretNames []string `json:accessPackageSecretNames,omitempty"`
38+
AccessPackageSecretNames []string `json:"accessPackageSecretNames,omitempty"`
3939
}
4040

4141
// GetMasterEndpoint returns the value of masterEndpoint.

pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,15 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) {
253253
**out = **in
254254
}
255255
}
256+
if in.DowntimeAllowed != nil {
257+
in, out := &in.DowntimeAllowed, &out.DowntimeAllowed
258+
if *in == nil {
259+
*out = nil
260+
} else {
261+
*out = new(bool)
262+
**out = **in
263+
}
264+
}
256265
in.ExternalAccess.DeepCopyInto(&out.ExternalAccess)
257266
in.RocksDB.DeepCopyInto(&out.RocksDB)
258267
in.Authentication.DeepCopyInto(&out.Authentication)

pkg/apis/replication/v1alpha/endpoint_spec.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ type EndpointSpec struct {
3636
// DeploymentName holds the name of an ArangoDeployment resource.
3737
// If set this provides default values for masterEndpoint, auth & tls.
3838
DeploymentName *string `json:"deploymentName,omitempty"`
39-
// Endpoint holds a list of URLs used to reach the syncmaster(s).
40-
Endpoint []string `json:"endpoint,omitempty"`
39+
// MasterEndpoint holds a list of URLs used to reach the syncmaster(s).
40+
MasterEndpoint []string `json:"masterEndpoint,omitempty"`
4141
// Authentication holds settings needed to authentication at the syncmaster.
4242
Authentication EndpointAuthenticationSpec `json:"auth"`
4343
// TLS holds settings needed to verify the TLS connection to the syncmaster.
@@ -60,13 +60,13 @@ func (s EndpointSpec) Validate(isSourceEndpoint bool) error {
6060
if err := k8sutil.ValidateOptionalResourceName(s.GetDeploymentName()); err != nil {
6161
return maskAny(err)
6262
}
63-
for _, ep := range s.Endpoint {
63+
for _, ep := range s.MasterEndpoint {
6464
if _, err := url.Parse(ep); err != nil {
6565
return maskAny(errors.Wrapf(ValidationError, "Invalid master endpoint '%s': %s", ep, err))
6666
}
6767
}
6868
hasDeploymentName := s.HasDeploymentName()
69-
if !hasDeploymentName && len(s.Endpoint) == 0 {
69+
if !hasDeploymentName && len(s.MasterEndpoint) == 0 {
7070
return maskAny(errors.Wrapf(ValidationError, "Provide a deploy name or at least one master endpoint"))
7171
}
7272
if err := s.Authentication.Validate(isSourceEndpoint || !hasDeploymentName); err != nil {

pkg/apis/replication/v1alpha/zz_generated.deepcopy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ func (in *EndpointSpec) DeepCopyInto(out *EndpointSpec) {
240240
**out = **in
241241
}
242242
}
243-
if in.Endpoint != nil {
244-
in, out := &in.Endpoint, &out.Endpoint
243+
if in.MasterEndpoint != nil {
244+
in, out := &in.MasterEndpoint, &out.MasterEndpoint
245245
*out = make([]string, len(*in))
246246
copy(*out, *in)
247247
}

0 commit comments

Comments
 (0)