@@ -5,7 +5,7 @@ The ArangoDB Replication Operator creates and maintains ArangoDB
5
5
This replication specification is a ` CustomResource ` following
6
6
a ` CustomResourceDefinition ` created by the operator.
7
7
8
- Example minimal replication definition:
8
+ Example minimal replication definition for 2 ArangoDB cluster with sync in the same Kubernetes cluster :
9
9
10
10
``` yaml
11
11
apiVersion : " replication.database.arangodb.com/v1alpha"
@@ -15,17 +15,46 @@ metadata:
15
15
spec :
16
16
source :
17
17
deploymentName : cluster-a
18
+ auth :
19
+ keyfileSecretName : cluster-a-sync-auth
18
20
destination :
19
21
deploymentName : cluster-b
20
- auth :
21
- clientAuthSecretName : client-auth-cert
22
22
` ` `
23
23
24
24
This definition results in:
25
25
26
26
- the arangosync ` SyncMaster` in deployment `cluster-b` is called to configure a synchronization
27
- from `cluster-a` to `cluster-b`, using the client authentication certificate stored in
28
- ` Secret` ` client-auth-cert` .
27
+ from the syncmasters in `cluster-a` to the syncmasters in `cluster-b`,
28
+ using the client authentication certificate stored in `Secret` `cluster-a-sync-auth`.
29
+ To access `cluster-a`, the JWT secret found in the deployment of `cluster-a` is used.
30
+ To access `cluster-b`, the JWT secret found in the deployment of `cluster-b` is used.
31
+
32
+ Example replication definition for replicating from a source that is outside the current Kubernetes cluster
33
+ to a destination that is in the same Kubernetes cluster :
34
+
35
+ ` ` ` yaml
36
+ apiVersion: "replication.database.arangodb.com/v1alpha"
37
+ kind: "ArangoDeploymentReplication"
38
+ metadata:
39
+ name: "replication-from-a-to-b"
40
+ spec:
41
+ source:
42
+ endpoint: ["https://163.172.149.229:31888", "https://51.15.225.110:31888", "https://51.15.229.133:31888"]
43
+ auth:
44
+ keyfileSecretName: cluster-a-sync-auth
45
+ tls:
46
+ caSecretName: cluster-a-sync-ca
47
+ destination:
48
+ deploymentName: cluster-b
49
+ ` ` `
50
+
51
+ This definition results in :
52
+
53
+ - the arangosync `SyncMaster` in deployment `cluster-b` is called to configure a synchronization
54
+ from the syncmasters located at the given list of endpoint URL's to the syncmasters `cluster-b`,
55
+ using the client authentication certificate stored in `Secret` `cluster-a-sync-auth`.
56
+ To access `cluster-a`, the keyfile (containing a client authentication certificate) is used.
57
+ To access `cluster-b`, the JWT secret found in the deployment of `cluster-b` is used.
29
58
30
59
# # Specification reference
31
60
@@ -38,13 +67,7 @@ with sync enabled.
38
67
39
68
This cluster configured as the replication source.
40
69
41
- # ## `spec.source.deploymentNamespace: string`
42
-
43
- This setting specifies the Kubernetes namespace of an `ArangoDeployment` resource specified in `spec.source.deploymentName`.
44
-
45
- If this setting is empty, the namespace of the `ArangoDeploymentReplication` is used.
46
-
47
- # ## `spec.source.masterEndpoints: []string`
70
+ # ## `spec.source.endpoint: []string`
48
71
49
72
This setting specifies zero or more master endpoint URL's of the source cluster.
50
73
@@ -53,12 +76,23 @@ that is reachable from the Kubernetes cluster the `ArangoDeploymentReplication`
53
76
54
77
Specifying this setting and `spec.source.deploymentName` at the same time is not allowed.
55
78
56
- # ## `spec.source.auth.jwtSecretName : string`
79
+ # ## `spec.source.auth.keyfileSecretName : string`
57
80
58
- This setting specifies the name of a `Secret` containing a JWT `token ` used to authenticate
81
+ This setting specifies the name of a `Secret` containing a client authentication certificate called `tls.keyfile ` used to authenticate
59
82
with the SyncMaster at the specified source.
60
83
61
- This setting is required, unless `spec.source.deploymentName` has been set.
84
+ If `spec.source.auth.userSecretName` has not been set,
85
+ the client authentication certificate found in the secret with this name is also used to configure
86
+ the synchronization and fetch the synchronization status.
87
+
88
+ This setting is required.
89
+
90
+ # ## `spec.source.auth.userSecretName: string`
91
+
92
+ This setting specifies the name of a `Secret` containing a `username` & `password` used to authenticate
93
+ with the SyncMaster at the specified source in order to configure synchronization and fetch synchronization status.
94
+
95
+ The user identified by the username must have write access in the `_system` database of the source ArangoDB cluster.
62
96
63
97
# ## `spec.source.tls.caSecretName: string`
64
98
@@ -74,13 +108,7 @@ with sync enabled.
74
108
75
109
This cluster configured as the replication destination.
76
110
77
- # ## `spec.destination.deploymentNamespace: string`
78
-
79
- This setting specifies the Kubernetes namespace of an `ArangoDeployment` resource specified in `spec.destination.deploymentName`.
80
-
81
- If this setting is empty, the namespace of the `ArangoDeploymentReplication` is used.
82
-
83
- # ## `spec.destination.masterEndpoints: []string`
111
+ # ## `spec.destination.endpoint: []string`
84
112
85
113
This setting specifies zero or more master endpoint URL's of the destination cluster.
86
114
@@ -89,12 +117,27 @@ that is reachable from the Kubernetes cluster the `ArangoDeploymentReplication`
89
117
90
118
Specifying this setting and `spec.destination.deploymentName` at the same time is not allowed.
91
119
92
- # ## `spec.destination.auth.jwtSecretName : string`
120
+ # ## `spec.destination.auth.keyfileSecretName : string`
93
121
94
- This setting specifies the name of a `Secret` containing a JWT `token ` used to authenticate
122
+ This setting specifies the name of a `Secret` containing a client authentication certificate called `tls.keyfile ` used to authenticate
95
123
with the SyncMaster at the specified destination.
96
124
97
- This setting is required, unless `spec.destination.deploymentName` has been set.
125
+ If `spec.destination.auth.userSecretName` has not been set,
126
+ the client authentication certificate found in the secret with this name is also used to configure
127
+ the synchronization and fetch the synchronization status.
128
+
129
+ This setting is required, unless `spec.destination.deploymentName` or `spec.destination.auth.userSecretName` has been set.
130
+
131
+ Specifying this setting and `spec.destination.userSecretName` at the same time is not allowed.
132
+
133
+ # ## `spec.destination.auth.userSecretName: string`
134
+
135
+ This setting specifies the name of a `Secret` containing a `username` & `password` used to authenticate
136
+ with the SyncMaster at the specified destination in order to configure synchronization and fetch synchronization status.
137
+
138
+ The user identified by the username must have write access in the `_system` database of the destination ArangoDB cluster.
139
+
140
+ Specifying this setting and `spec.destination.keyfileSecretName` at the same time is not allowed.
98
141
99
142
# ## `spec.destination.tls.caSecretName: string`
100
143
@@ -103,8 +146,62 @@ the TLS connection created by the SyncMaster at the specified destination.
103
146
104
147
This setting is required, unless `spec.destination.deploymentName` has been set.
105
148
106
- # ## `spec.auth.clientAuthSecretName: string`
149
+ # # Authentication details
150
+
151
+ The authentication settings in a `ArangoDeploymentReplication` resource are used for two distinct purposes.
152
+
153
+ The first use is the authentication of the syncmasters at the destination with the syncmasters at the source.
154
+ This is always done using a client authentication certificate which is found in a `tls.keyfile` field
155
+ in a secret identified by `spec.source.auth.keyfileSecretName`.
156
+
157
+ The second use is the authentication of the ArangoDB Replication operator with the syncmasters at the source
158
+ or destination. These connections are made to configure synchronization, stop configuration and fetch the status
159
+ of the configuration.
160
+ The method used for this authentication is derived as follows (where `X` is either `source` or `destination`) :
161
+
162
+ - If `spec.X.userSecretName` is set, the username + password found in the `Secret` identified by this name is used.
163
+ - If `spec.X.keyfileSecretName` is set, the client authentication certificate (keyfile) found in the `Secret` identifier by this name is used.
164
+ - If `spec.X.deploymentName` is set, the JWT secret found in the deployment is used.
165
+
166
+ # # Creating client authentication certificate keyfiles
167
+
168
+ The client authentication certificates needed for the `Secrets` identified by `spec.source.auth.keyfileSecretName` & `spec.destination.auth.keyfileSecretName`
169
+ are normal ArangoDB keyfiles that can be created by the `arangosync create client-auth keyfile` command.
170
+ In order to do so, you must have access to the client authentication CA of the source/destination.
171
+
172
+ If the client authentication CA at the source/destination also contains a private key (`ca.key`), the ArangoDeployment operator
173
+ can be used to create such a keyfile for you, without the need to have `arangosync` installed locally.
174
+ Read the following paragraphs for instructions on how to do that.
175
+
176
+ # # Creating and using access packages
177
+
178
+ An access package is a YAML file that contains :
179
+
180
+ - A client authentication certificate, wrapped in a `Secret` in a `tls.keyfile` data field.
181
+ - A TLS certificate authority public key, wrapped in a `Secret` in a `ca.crt` data field.
182
+
183
+ The format of the access package is such that it can be inserted into a Kubernetes cluster using the standard `kubectl` tool.
184
+
185
+ To create an access package that can be used to authenticate with the ArangoDB SyncMasters of an `ArangoDeployment`,
186
+ add a name of a non-existing `Secret` to the `spec.sync.externalAccess.accessPackageSecretNames` field of the `ArangoDeployment`.
187
+ In response, a `Secret` is created in that Kubernetes cluster, with the given name, that contains a `accessPackage.yaml` data field
188
+ that contains a Kubernetes resource specification that can be inserted into the other Kubernetes cluster.
189
+
190
+ The process for creating and using an access package for authentication at the source cluster is as follows :
191
+
192
+ - Edit the `ArangoDeployment` resource of the source cluster, set `spec.sync.externalAccess.accessPackageSecretNames` to `["my-access-package"]`
193
+ - Wait for the `ArangoDeployment` operator to create a `Secret` named `my-access-package`.
194
+ - Extract the access package from the Kubernetes source cluster using :
195
+
196
+ ` ` ` bash
197
+ kubectl get secret my-access-package --template='{{index .data "accessPackage.yaml"}}' | base64 -D > accessPackage.yaml
198
+ ` ` `
199
+
200
+ - Insert the secrets found in the access package in the Kubernetes destination cluster using :
201
+
202
+ ` ` ` bash
203
+ kubectl apply -f accessPackage.yaml
204
+ ` ` `
107
205
108
- This setting specifies the name of a `Secret` containing a client authentication certificate,
109
- used to authenticate the SyncMaster in the destination cluster with the SyncMaster in the
110
- source cluster.
206
+ As a result, the destination Kubernetes cluster will have 2 additional `Secrets`. One contains a client authentication certificate
207
+ formatted as a keyfile. Another contains the public key of the TLS CA certificate of the source cluster.
0 commit comments