Skip to content

Commit 6f30390

Browse files
author
lamai93
committed
Merge remote-tracking branch 'origin/master' into feature/arangodbexporter
2 parents 5eaa54a + 1a986ea commit 6f30390

22 files changed

+303
-56
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Change Log
22

3-
## [0.3.10](---) (XXXX-XX-XX)
3+
## [0.3.10](---) (2019-04-04)
44
- Added Pod Disruption Budgets for all server groups in production mode.
55
- Added Priority Class Name to be specified per server group.
6+
- Forward resource requirements to k8s.
7+
- Automatic creation of randomized root password on demand.
8+
- Volume resizing (only enlarge).
9+
- Allow to disable liveness probes, increase timeouts in defaults.
10+
- Handle case of all coordinators gone better.
11+
- Added `MY_NODE_NAME` and `NODE_NAME` env vars for all pods.
12+
- Internal communications with ArangoDB more secure through tokens which
13+
are limited to certain API paths.
14+
- Rolling upgrade waits till all shards are in sync before proceeding to
15+
next dbserver, even if it takes longer than 15 min.
16+
- Improve installation and upgrade instructions in README.
617

718
## [0.3.9](https://github.com/arangodb/kube-arangodb/tree/0.3.9) (2019-02-28)
819
[Full Changelog](https://github.com/arangodb/kube-arangodb/compare/0.3.8...0.3.9)

MAINTAINERS.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,35 @@
22

33
## Running tests
44

5-
To run the entire test set, run:
5+
To run the entire test set, first set the following environment variables:
6+
7+
- `DOCKERNAMESPACE` to your docker hub account
8+
- `VERBOSE` to `1` (default is empty)
9+
- `LONG` to `1` (default is empty, which skips lots of tests)
10+
- `ARANGODB` to the name of a community image you want to test,
11+
default is `arangodb/arangodb:latest`
12+
- `ENTERPRISEIMAGE` to the name of an enterprise image, you want to
13+
test, if not set, some tests are skipped
14+
- `ARANGO_LICENSE_KEY` to the enterpise license key
15+
- `KUBECONFIG` to the path to some k8s configuration with
16+
credentials, this indicates which cluster to use
617

718
```bash
8-
export DOCKERNAMESPACE=<your docker hub account>
919
make clean
1020
make build
1121
make run-tests
1222
```
1323

24+
To run only a single test, set `TESTOPTIONS` to something like
25+
`-test.run=TestRocksDBEncryptionSingle` where
26+
`TestRocksDBEncryptionSingle` is the name of the test.
27+
1428
## Preparing a release
1529

1630
To prepare for a release, do the following:
1731

1832
- Make sure all tests are OK.
33+
- To run a complete set of tests, see above.
1934
- Update the CHANGELOG manually, since the automatic CHANGELOG
2035
generation is switched off (did not work in many cases).
2136

README.md

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,79 @@ it is intended to be.
3737
| Docker for Mac Edge | 1.10 | >= 3.3.13 | Runs | Not intended | |
3838
| Scaleway Kubernetes | 1.10 | >= 3.3.13 | ? | No | |
3939

40-
## Installation of latest release using Helm
40+
## WARNING
4141

4242
**WARNING**: There is a problem with rolling upgrades in version 0.3.8.
4343
**DO NOT USE 0.3.8 FOR ROLLING UPGRADES.** If you are still using 0.3.8,
4444
then upgrade to 0.3.9 of the operator first before running any rolling
4545
upgrade.
4646

47+
## Installation of latest release using Kubectl
48+
49+
```bash
50+
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.10/manifests/arango-crd.yaml
51+
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.10/manifests/arango-deployment.yaml
52+
# To use `ArangoLocalStorage`, also run
53+
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.10/manifests/arango-storage.yaml
54+
# To use `ArangoDeploymentReplication`, also run
55+
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.10/manifests/arango-deployment-replication.yaml
56+
```
57+
58+
This procedure can also be used for upgrades and will not harm any
59+
running ArangoDB deployments.
60+
61+
## Installation of latest release using Helm
62+
63+
Only use this procedure for a new install of the operator. See below for
64+
upgrades.
65+
4766
```bash
4867
# The following will install the custom resources required by the operators.
49-
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.9/kube-arangodb-crd.tgz
68+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.10/kube-arangodb-crd.tgz
5069
# The following will install the operator for `ArangoDeployment` &
5170
# `ArangoDeploymentReplication` resources.
52-
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.9/kube-arangodb.tgz
71+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.10/kube-arangodb.tgz
5372
# To use `ArangoLocalStorage`, also run
54-
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.9/kube-arangodb-storage.tgz
73+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.10/kube-arangodb-storage.tgz
5574
```
5675

57-
## Installation of latest release using Kubectl
76+
## Upgrading the operator using Helm
77+
78+
To upgrade the operator to the latest version with Helm, you have to
79+
delete the previous deployment and then install the latest. **HOWEVER**:
80+
You *must not delete* the deployment of the custom resource definitions
81+
(CRDs), or your ArangoDB deployments will be deleted!
82+
83+
Therefore, you have to use `helm list` to find the deployments for the
84+
operator (`kube-arangodb`) and of the storage operator
85+
(`kube-arangodb-storage`) and use `helm delete` to delete them using the
86+
automatically generated deployment names. Here is an example of a `helm
87+
list` output:
88+
89+
```
90+
% helm list
91+
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
92+
intent-camel 1 Mon Apr 8 11:37:52 2019 DEPLOYED kube-arangodb-storage-0.3.10-preview default
93+
steely-mule 1 Sun Mar 31 21:11:07 2019 DEPLOYED kube-arangodb-crd-0.3.9 default
94+
vetoed-ladybird 1 Mon Apr 8 11:36:58 2019 DEPLOYED kube-arangodb-0.3.10-preview default
95+
```
96+
97+
So here, you would have to do
5898

5999
```bash
60-
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.9/manifests/arango-crd.yaml
61-
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.9/manifests/arango-deployment.yaml
100+
helm delete intent-camel
101+
helm delete vetoed-ladybird
102+
```
103+
104+
but **not delete `steely-mule`**. Then you could install the new version
105+
with `helm install` as normal:
106+
107+
```bash
108+
# The following will install the operator for `ArangoDeployment` &
109+
# `ArangoDeploymentReplication` resources.
110+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.10/kube-arangodb.tgz
62111
# To use `ArangoLocalStorage`, also run
63-
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.9/manifests/arango-storage.yaml
64-
# To use `ArangoDeploymentReplication`, also run
65-
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.9/manifests/arango-deployment-replication.yaml
112+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.10/kube-arangodb-storage.tgz
66113
```
67114

68115
## Building

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.9+git
1+
0.3.10+git

deps/github.com/arangodb/go-driver/jwt/jwt.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,29 @@ func CreateArangodJwtAuthorizationHeader(jwtSecret, serverID string) (string, er
5454

5555
return "bearer " + signedToken, nil
5656
}
57+
58+
// CreateArangodJwtAuthorizationHeaderAllowedPaths calculates a JWT authorization header, for authorization
59+
// of a request to an arangod server, based on the given secret.
60+
// If the secret is empty, nothing is done.
61+
// Use the result of this function as input for driver.RawAuthentication.
62+
// Additionally allowed paths can be specified
63+
func CreateArangodJwtAuthorizationHeaderAllowedPaths(jwtSecret, serverID string, paths []string) (string, error) {
64+
if jwtSecret == "" || serverID == "" {
65+
return "", nil
66+
}
67+
// Create a new token object, specifying signing method and the claims
68+
// you would like it to contain.
69+
token := jg.NewWithClaims(jg.SigningMethodHS256, jg.MapClaims{
70+
"iss": issArangod,
71+
"server_id": serverID,
72+
"allowed_paths": paths,
73+
})
74+
75+
// Sign and get the complete encoded token as a string using the secret
76+
signedToken, err := token.SignedString([]byte(jwtSecret))
77+
if err != nil {
78+
return "", driver.WithStack(err)
79+
}
80+
81+
return "bearer " + signedToken, nil
82+
}

manifests/arango-deployment-replication.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ spec:
103103
containers:
104104
- name: operator
105105
imagePullPolicy: IfNotPresent
106-
image: arangodb/kube-arangodb@sha256:3db337b992d0535b3caba590d70b089f27b812a77274a0a1b9f290b93caf7ff9
106+
image: arangodb/kube-arangodb@sha256:bc17d77ca6c8f134a065db4f5dcbc07b84feb74ae10dd6666e822334f9ff9680
107107
args:
108108
- --operator.deployment-replication
109109
env:

manifests/arango-deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ rules:
3535
- apiGroups: ["apps"]
3636
resources: ["deployments", "replicasets"]
3737
verbs: ["get"]
38+
- apiGroups: ["policy"]
39+
resources: ["poddisruptionbudgets"]
40+
verbs: ["get", "create", "delete"]
3841
- apiGroups: ["storage.k8s.io"]
3942
resources: ["storageclasses"]
4043
verbs: ["get", "list"]
@@ -103,7 +106,7 @@ spec:
103106
containers:
104107
- name: operator
105108
imagePullPolicy: IfNotPresent
106-
image: arangodb/kube-arangodb@sha256:3db337b992d0535b3caba590d70b089f27b812a77274a0a1b9f290b93caf7ff9
109+
image: arangodb/kube-arangodb@sha256:bc17d77ca6c8f134a065db4f5dcbc07b84feb74ae10dd6666e822334f9ff9680
107110
args:
108111
- --operator.deployment
109112
- --chaos.allowed=false

manifests/arango-storage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ spec:
141141
containers:
142142
- name: operator
143143
imagePullPolicy: IfNotPresent
144-
image: arangodb/kube-arangodb@sha256:3db337b992d0535b3caba590d70b089f27b812a77274a0a1b9f290b93caf7ff9
144+
image: arangodb/kube-arangodb@sha256:bc17d77ca6c8f134a065db4f5dcbc07b84feb74ae10dd6666e822334f9ff9680
145145
args:
146146
- --operator.storage
147147
env:

manifests/arango-test.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ rules:
1111
resources: ["nodes"]
1212
verbs: ["list"]
1313
- apiGroups: [""]
14-
resources: ["pods", "services", "persistentvolumes", "persistentvolumeclaims", "secrets", "serviceaccounts"]
14+
resources: ["pods", "services", "persistentvolumes", "persistentvolumeclaims", "secrets", "serviceaccounts", "pods/log"]
1515
verbs: ["*"]
1616
- apiGroups: ["apps"]
17-
resources: ["daemonsets"]
17+
resources: ["daemonsets", "deployments"]
18+
verbs: ["*"]
19+
- apiGroups: ["scheduling.k8s.io"]
20+
resources: ["priorityclasses"]
1821
verbs: ["*"]
1922

2023
---

pkg/deployment/context_impl.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,13 @@ func (d *Deployment) GetExpectedPodArguments(apiObject metav1.Object, deplSpec a
380380
agents api.MemberStatusList, id string, version driver.Version) []string {
381381
return d.resources.GetExpectedPodArguments(apiObject, deplSpec, group, agents, id, version)
382382
}
383+
384+
// GetShardSyncStatus returns true if all shards are in sync
385+
func (d *Deployment) GetShardSyncStatus() bool {
386+
return d.resources.GetShardSyncStatus()
387+
}
388+
389+
// InvalidateSyncStatus resets the sync state to false and triggers an inspection
390+
func (d *Deployment) InvalidateSyncStatus() {
391+
d.resources.InvalidateSyncStatus()
392+
}

0 commit comments

Comments
 (0)