Skip to content

Commit 676493f

Browse files
authored
Merge pull request #238 from arangodb/feature/helm-chart
Adding helm charts for deploying the operators
2 parents 23b0283 + 588aca0 commit 676493f

File tree

16 files changed

+597
-45
lines changed

16 files changed

+597
-45
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ it is intended to be.
3434
| Minikube | 1.10 | >= 3.3.13 | Runs | Not intended |
3535
| Docker for Mac Edge | 1.10 | >= 3.3.13 | Runs | Not intended |
3636

37-
## Installation of latest release
37+
## Installation of latest release using Helm
38+
39+
```bash
40+
# The following will install the operator for `ArangoDeployment` &
41+
# `ArangoDeplomentReplication` resources.
42+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.2.2/kube-arangodb.tgz
43+
# To use `ArangoLocalStorage`, also run
44+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.2.2/kube-arangodb-storage.tgz
45+
```
46+
47+
## Installation of latest release using Kubectl
3848

3949
```bash
4050
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.2.2/manifests/crd.yaml
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Using the ArangoDB Kubernetes Operator with Helm
2+
3+
[`Helm`](https://www.helm.sh/) is a package manager for Kubernetes, which enables
4+
you to install various packages (include the ArangoDB Kubernetes Operator)
5+
into your Kubernetes cluster.
6+
7+
The benefit of `helm` (in the context of the ArangoDB Kubernetes Operator)
8+
is that it allows for a lot of flexibility in how you install the operator.
9+
For example you can install the operator in a namespace other than
10+
`default`.
11+
12+
## Charts
13+
14+
The ArangoDB Kubernetes Operator is contained in two `helm` charts:
15+
16+
- `kube-arangodb` which contains the operator for the `ArangoDeployment`
17+
and `ArangoDeploymentReplication` resource types.
18+
- `kube-arangodb-storage` which contains the operator for the `ArangoLocalStorage`
19+
resource type.
20+
21+
The `kube-arangodb-storage` only has to be installed if your Kubernetes cluster
22+
does not already provide `StorageClasses` that use locally attached SSDs.
23+
24+
## Configurable values for ArangoDB Kubernetes Operator
25+
26+
The following values can be configured when installing the
27+
ArangoDB Kubernetes Operator with `helm`.
28+
29+
Values are passed to `helm` using an `--set=<key>=<value>` argument passed
30+
to the `helm install` or `helm upgrade` command.
31+
32+
### Values applicable to both charts
33+
34+
| Key | Type | Description
35+
|-------------------|--------|-----|
36+
| Image | string | Override the docker image used by the operators
37+
| ImagePullPolicy | string | Override the image pull policy used by the operators. See [Updating Images](https://kubernetes.io/docs/concepts/containers/images/#updating-images) for details.
38+
| RBAC.Create | bool | Set to `true` (default) to create roles & role bindings.
39+
40+
### Values applicable to the `kube-arangodb` chart
41+
42+
| Key | Type | Description
43+
|-------------------|--------|-----|
44+
| Deployment.Create | bool | Set to `true` (default) to deploy the `ArangoDeployment` operator
45+
| Deployment.User.ServiceAccountName | string | Name of the `ServiceAccount` that is the subject of the `RoleBinding` of users of the `ArangoDeployment` operator
46+
| Deployment.Operator.ServiceAccountName | string | Name of the `ServiceAccount` used to run the `ArangoDeployment` operator
47+
| Deployment.Operator.ServiceType | string | Type of `Service` created for the dashboard of the `ArangoDeployment` operator
48+
| Deployment.AllowChaos | bool | Set to `true` to allow the introduction of chaos. **Only use for testing, never for production!** Defaults to `false`.
49+
| DeploymentReplication.Create | bool | Set to `true` (default) to deploy the `ArangoDeploymentReplication` operator
50+
| DeploymentReplication.User.ServiceAccountName | string | Name of the `ServiceAccount` that is the subject of the `RoleBinding` of users of the `ArangoDeploymentReplication` operator
51+
| DeploymentReplication.Operator.ServiceAccountName | string | Name of the `ServiceAccount` used to run the `ArangoDeploymentReplication` operator
52+
| DeploymentReplication.Operator.ServiceType | string | Type of `Service` created for the dashboard of the `ArangoDeploymentReplication` operator
53+
54+
### Values applicable to the `kube-arangodb-storage` chart
55+
56+
| Key | Type | Description
57+
|-------------------|--------|-----|
58+
| Storage.User.ServiceAccountName | string | Name of the `ServiceAccount` that is the subject of the `RoleBinding` of users of the `ArangoLocalStorage` operator
59+
| Storage.Operator.ServiceAccountName | string | Name of the `ServiceAccount` used to run the `ArangoLocalStorage` operator
60+
| Storage.Operator.ServiceType | string | Type of `Service` created for the dashboard of the `ArangoLocalStorage` operator
61+
62+
## Alternate namespaces
63+
64+
The `kube-arangodb` chart supports deployment into a non-default namespace.
65+
66+
To install the `kube-arangodb` chart is a non-default namespace, use the `--namespace`
67+
argument like this.
68+
69+
```bash
70+
helm install --namespace=mynamespace kube-arangodb.tgz
71+
```
72+
73+
Note that since the operators claim exclusive access to a namespace, you can
74+
install the `kube-arangodb` chart in a namespace once.
75+
You can install the `kube-arangodb` chart in multiple namespaces. To do so, run:
76+
77+
```bash
78+
helm install --namespace=namespace1 kube-arangodb.tgz
79+
helm install --namespace=namespace2 kube-arangodb.tgz
80+
```
81+
82+
The `kube-arangodb-storage` chart is always installed in the `kube-system` namespace.
83+
84+
## Common problems
85+
86+
### Error: no available release name found
87+
88+
This error is given by `helm install ...` in some cases where it has
89+
insufficient permissions to install charts.
90+
91+
For various ways to work around this problem go to [this Stackoverflow article](https://stackoverflow.com/questions/43499971/helm-error-no-available-release-name-found).

docs/Manual/Deployment/Kubernetes/Usage.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,38 @@
55
The ArangoDB Kubernetes Operator needs to be installed in your Kubernetes
66
cluster first.
77

8-
To do so, run (replace `<version>` with the version of the operator that you want to install):
8+
If you have `Helm` available, we recommend installation using `Helm`.
9+
10+
### Installation with Helm
11+
12+
To install the ArangoDB Kubernetes Operator with [`helm`](https://www.helm.sh/),
13+
run (replace `<version>` with the version of the operator that you want to install):
14+
15+
```bash
16+
export URLPREFIX=https://github.com/arangodb/kube-arangodb/releases/download/<version>
17+
helm install $URLPREFIX/kube-arangodb.tgz
18+
```
19+
20+
This installs operators for the `ArangoDeployment` and `ArangoDeploymentReplication`
21+
resource types.
22+
23+
If you want to avoid the installation of the operator for the `ArangoDeploymentReplication`
24+
resource type, add `--set=DeploymentReplication.Create=false` to the `helm install`
25+
command.
26+
27+
To use `ArangoLocalStorage` resources, also run:
28+
29+
```bash
30+
helm install $URLPREFIX/kube-arangodb-storage.tgz
31+
```
32+
33+
For more information on installing with `Helm` and how to customize an installation,
34+
see [Using the ArangoDB Kubernetes Operator with Helm](./Helm.md).
35+
36+
### Installation with Kubectl
37+
38+
To install the ArangoDB Kubernetes Operator without `Helm`,
39+
run (replace `<version>` with the version of the operator that you want to install):
940

1041
```bash
1142
export URLPREFIX=https://raw.githubusercontent.com/arangodb/kube-arangodb/<version>/manifests
@@ -60,6 +91,14 @@ If you want to keep your data, make sure to create a backup before removing the
6091
To remove the entire ArangoDB Kubernetes Operator, remove all
6192
clusters first and then remove the operator by running:
6293

94+
```bash
95+
helm delete <release-name-of-kube-arangodb-chart>
96+
# If `ArangoLocalStorage` operator is installed
97+
helm delete <release-name-of-kube-arangodb-storage-chart>
98+
```
99+
100+
or when you used `kubectl` to install the operator, run:
101+
63102
```bash
64103
kubectl delete deployment arango-deployment-operator
65104
# If `ArangoLocalStorage` operator is installed
@@ -73,3 +112,4 @@ kubectl delete deployment arango-deployment-replication-operator
73112
- [Driver configuration](./DriverConfiguration.md)
74113
- [Scaling](./Scaling.md)
75114
- [Upgrading](./Upgrading.md)
115+
- [Using the ArangoDB Kubernetes Operator with Helm](./Helm.md)

manifests/templates/deployment-replication/deployment-replication.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ .DeploymentReplication.FilterStart }}
12

23
apiVersion: extensions/v1beta1
34
kind: Deployment
@@ -14,6 +15,7 @@ spec:
1415
name: {{ .DeploymentReplication.OperatorDeploymentName }}
1516
app: arango-deployment-replication-operator
1617
spec:
18+
serviceAccountName: {{ .DeploymentReplication.Operator.ServiceAccountName }}
1719
containers:
1820
- name: operator
1921
imagePullPolicy: {{ .ImagePullPolicy }}
@@ -59,3 +61,5 @@ spec:
5961
operator: "Exists"
6062
effect: "NoExecute"
6163
tolerationSeconds: 5
64+
65+
{{ .DeploymentReplication.FilterEnd }}

manifests/templates/deployment-replication/rbac.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{{- if .RBAC -}}
1+
{{ .DeploymentReplication.FilterStart }}
2+
{{ .RBACFilterStart }}
3+
24
## Cluster role granting access to ArangoDeploymentReplication resources.
35
apiVersion: rbac.authorization.k8s.io/v1beta1
46
kind: ClusterRole
@@ -72,4 +74,5 @@ subjects:
7274
name: {{ .DeploymentReplication.Operator.ServiceAccountName }}
7375
namespace: {{ .DeploymentReplication.Operator.Namespace }}
7476

75-
{{- end -}}
77+
{{ .RBACFilterEnd }}
78+
{{ .DeploymentReplication.FilterEnd }}

manifests/templates/deployment-replication/service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{ .DeploymentReplication.FilterStart }}
2+
13
apiVersion: v1
24
kind: Service
35
metadata:
@@ -17,3 +19,5 @@ spec:
1719
app: arango-deployment-replication-operator
1820
role: leader
1921
type: {{ .DeploymentReplication.Operator.ServiceType }}
22+
23+
{{ .DeploymentReplication.FilterEnd }}

manifests/templates/deployment/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ .Deployment.FilterStart }}
12

23
apiVersion: extensions/v1beta1
34
kind: Deployment
@@ -14,6 +15,7 @@ spec:
1415
name: {{ .Deployment.OperatorDeploymentName }}
1516
app: arango-deployment-operator
1617
spec:
18+
serviceAccountName: {{ .Deployment.Operator.ServiceAccountName }}
1719
containers:
1820
- name: operator
1921
imagePullPolicy: {{ .ImagePullPolicy }}
@@ -60,3 +62,5 @@ spec:
6062
operator: "Exists"
6163
effect: "NoExecute"
6264
tolerationSeconds: 5
65+
66+
{{ .Deployment.FilterEnd }}

manifests/templates/deployment/rbac.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{{- if .RBAC -}}
1+
{{ .Deployment.FilterStart }}
2+
{{ .RBACFilterStart }}
3+
24
## Cluster role granting access to ArangoDeployment resources.
35
apiVersion: rbac.authorization.k8s.io/v1beta1
46
kind: ClusterRole
@@ -72,4 +74,5 @@ subjects:
7274
name: {{ .Deployment.Operator.ServiceAccountName }}
7375
namespace: {{ .Deployment.Operator.Namespace }}
7476

75-
{{- end -}}
77+
{{ .RBACFilterEnd }}
78+
{{ .Deployment.FilterEnd }}

manifests/templates/deployment/service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{ .Deployment.FilterStart }}
2+
13
apiVersion: v1
24
kind: Service
35
metadata:
@@ -17,3 +19,5 @@ spec:
1719
app: arango-deployment-operator
1820
role: leader
1921
type: {{ .Deployment.Operator.ServiceType }}
22+
23+
{{ .Deployment.FilterEnd }}

manifests/templates/storage/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{ .Storage.FilterStart }}
2+
13
## Service accounts
24
apiVersion: v1
35
kind: ServiceAccount
@@ -68,3 +70,5 @@ spec:
6870
operator: "Exists"
6971
effect: "NoExecute"
7072
tolerationSeconds: 5
73+
74+
{{ .Storage.FilterEnd }}

0 commit comments

Comments
 (0)