Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiP] [Feature] ArangoDB Bootstrap #1576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ SOURCES := $(shell $(SOURCES_QUERY))
NON_EE_SOURCES_QUERY := $(SOURCES_QUERY) ! -name '*.enterprise.go'
NON_EE_SOURCES := $(shell $(NON_EE_SOURCES_QUERY))

YAML_EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated/clientset pkg/generated/informers pkg/generated/listers chart/kube-arangodb/templates chart/kube-arangodb-crd/templates chart/arangodb-ingress-proxy/templates
YAML_EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated/clientset pkg/generated/informers pkg/generated/listers chart/kube-arangodb/templates chart/kube-arangodb-crd/templates chart/arangodb-ingress-proxy/templates chart/arangodb-bootstrap/templates
YAML_EXCLUDE_FILES :=
YAML_QUERY := find ./ -type f -name '*.yaml' $(foreach EXCLUDE_DIR,$(YAML_EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(YAML_EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)")
YAMLS := $(shell $(YAML_QUERY))
Expand Down Expand Up @@ -573,6 +573,13 @@ $(eval $(call manifest-generator, all, kube-arangodb, \
--set "operator.features.k8sToK8sClusterSync=true" \
--set "operator.features.backup=true"))

.PHONY: chart-bootstrap
chart-bootstrap: export CHART_NAME := arangodb-bootstrap
chart-bootstrap: helm
@mkdir -p "$(ROOTDIR)/bin/charts"
@$(HELM_PACKAGE_CMD)
manifests: chart-bootstrap

.PHONY: chart-crd
chart-crd: export CHART_NAME := kube-arangodb-crd
chart-crd: helm
Expand Down
5 changes: 5 additions & 0 deletions chart/arangodb-bootstrap/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# do not switch to V2 yet - we still need to support Helm 2
apiVersion: v1
name: arangodb-bootstrap
version: 1.2.36
description: "ArangoDB Kubernetes Bootstrap Job"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
Copyright 2024 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.
Expand Down
206 changes: 206 additions & 0 deletions chart/arangodb-bootstrap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# Introduction

Kubernetes ArangoDB Bootstrap Helper.

# Chart Details

Chart will bootstrap ArangoDeployment with predefined Users, Databases, Collections and Permissions.

# Prerequisites

ArangoDeployment as the destination. Bootstrap will ensure that ArangoDeployment is Ready before starting deployment

# Installing the Chart

Chart can be installed in two methods:
- With all Operators in single Helm Release
- One Helm Release per Operator

Possible Operators:
- `ArangoDeployment` - enabled by default
- `ArangoDeploymentReplications` - enabled by default
- `ArangoLocalStorage` - disabled by default
- `ArangoBackup` - disabled by default
- `ArangoJob` - disabled by default
- `ArangoClusterSynchronization` - disabled by default

To install Operators in mode "One per Helm Release" we can use:

```
helm install --name arango-deployment kube-arangodb.tar.gz \
--set operator.features.deployment=true \
--set operator.features.deploymentReplications=false \
--set operator.features.storage=false \
--set operator.features.backup=false \
--set operator.features.apps=false \
--set operator.features.k8sToK8sClusterSync=false
```


# Configuration

### `operator.image`

Image used for the ArangoDB Operator.

Default: `arangodb/kube-arangodb:latest`

### `operator.imagePullPolicy`

Image pull policy for Operator images.

Default: `IfNotPresent`

### `operator.imagePullSecrets`

List of the Image Pull Secrets for Operator images.

Default: `[]string`

### `operator.scope`

Scope on which Operator will be configured.

Default: `legacy`

Supported modes:
- `legacy` - mode with limited cluster scope access
- `namespaced` - mode with namespace access only

### `operator.service.type`

Type of the Operator service.

Default: `ClusterIP`

### `operator.annotations`

Annotations passed to the Operator Deployment definition.

Default: `[]string`

### `operator.resources.limits.cpu`

CPU limits for operator pods.

Default: `1`

### `operator.resources.limits.memory`

Memory limits for operator pods.

Default: `256Mi`

### `operator.resources.requested.cpu`

Requested CPI by Operator pods.

Default: `250m`

### `operator.resources.requested.memory`

Requested memory for operator pods.

Default: `256Mi`

### `operator.nodeSelector`

NodeSelector for Deployment pods.

Default: `{}`

### `operator.tolerations`

Tolerations for Deployment pods.

There is built in configuration (can not be changed):
```yaml
tolerations:
- key: "node.kubernetes.io/unreachable"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 5
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 5
```

which can be extended by additional entries e.g.:
```yaml
tolerations:
- key: devops
operator: Exists
effect: NoSchedule
```
Default (empty): `[]`

### `operator.securityContext.runAsUser`

Controls which user ID the containers are run with.

Default: `1000`

### `operator.replicaCount`

Replication count for Operator deployment.

Default: `2`

### `operator.updateStrategy`

Update strategy for operator pod.

Default: `Recreate`

### `operator.features.deployment`

Define if ArangoDeployment Operator should be enabled.

Default: `true`

### `operator.features.deploymentReplications`

Define if ArangoDeploymentReplications Operator should be enabled.

Default: `true`

### `operator.features.storage`

Define if ArangoLocalStorage Operator should be enabled.

Default: `false`

### `operator.features.backup`

Define if ArangoBackup Operator should be enabled.

Default: `false`

### `operator.features.apps`

Define if ArangoJob Operator should be enabled.

Default: `false`

### `operator.features.k8sToK8sClusterSync`

Define if ArangoClusterSynchronization Operator should be enabled.

Default: `false`

### `rbac.enabled`

Define if RBAC should be enabled.

Default: `true`

### `operator.architectures`

List of supported architectures.

Default: `[]string{"amd64"}`

# Limitations

N/A
Loading