Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[incubator/orientdb] Initial commit for OrientDB chart (#9900)
Browse files Browse the repository at this point in the history
* [incubator/orientdb] Initial commit for OrientDB chart

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Added maintainers to chart

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Trying to fix circle-ci lint fail

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] y u no lint??

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb]   error    no new line character at the end of file  (new-line-at-end-of-file)

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] will this nightmare ever end??

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Using the github username...

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Support regular and headless services

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Updates for Hazelcast and service name

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Using Orient 3.0.13; parameterized helm test

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Using readiness and liveness probes. Disable testing in case it causes helm e2e to fail

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Control jvm env vars

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>

* [incubator/orientdb] Bumping chart and app versions

Signed-off-by: Eli Kasik <soujiro32167@gmail.com>
  • Loading branch information
Eli Kasik authored and k8s-ci-robot committed Mar 4, 2019
1 parent 16879ca commit 4667709
Show file tree
Hide file tree
Showing 14 changed files with 562 additions and 0 deletions.
21 changes: 21 additions & 0 deletions incubator/orientdb/.helmignore
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
13 changes: 13 additions & 0 deletions incubator/orientdb/Chart.yaml
@@ -0,0 +1,13 @@
apiVersion: v1
name: orientdb
home: https://orientdb.com
description: A Helm chart for Distributed OrientDB
version: 0.1.2
icon: https://orientdb.com/wp-content/uploads/cropped-favicon-orientdb-192x192.png
maintainers:
- name: b-yond-infinite-network
email: sommeliers@b-yond.com
url: https://www.b-yond.com
- name: soujiro32167
email: eli.kasik@b-yond.com
appVersion: 3.0.13
40 changes: 40 additions & 0 deletions incubator/orientdb/README.md
@@ -0,0 +1,40 @@
# Infinity OrientDB helm chart

Orient DB helm chart

## Installation:

`helm install . --name <RELEASE-NAME> --namespace <NAMESPACE> --set rootpassword=<PASSWORD>`

If rootPassword is not set, a random one will be used.

## Scaling:

Get the name of your statefulset:

`kubectl get statefulsets -n <NAMESPACE>`

Then scale it:

`kubectl scale <STATEFULSET-NAME> --replicas=<DESIRED-SIZE>`

This scaling is possible due to the hazelcast plugin used for node discovery. For more information check the config file under config/hazelcast.xml and at http://docs.hazelcast.org/docs/3.0/manual/html/ch12s02.html

## Testing:

`helm test <RELEASE-NAME> --cleanup --timeout 1000`

## Accessing the UI

`kubectl port-forward <POD-NAME> 2480:2480 -n <NAMESPACE>`

Note: POD-NAME is any pod from the statefulset.

## Editing the hazelcast configuration

The hazelcast configuration can be edited at runtime by editing the config.yaml file in the templates of the orient. As of right now only the hazelcast file can be edited dynamically

## Maintainers

Product Engineering Team (AKA The Sommeliers) @ [B-yond](https://www.b-yond.com)
E: <sommeliers@b-yond.com>
15 changes: 15 additions & 0 deletions incubator/orientdb/config/default-distributed-db-config.json
@@ -0,0 +1,15 @@
{
"autoDeploy": {{ .Values.distributed.autoDeploy }},
"executionMode": "{{ .Values.distributed.executionMode }}",
"readQuorum": {{ .Values.distributed.readQuorum }},
"writeQuorum": "{{ .Values.distributed.writeQuorum }}",
"readYourWrites": {{ .Values.distributed.readYourWrites }},
"newNodeStrategy": "{{ .Values.distributed.newNodeStrategy }}",
"servers": { "*": "master" },
"clusters": {
"internal": {},
"*": {
"servers": ["<NEW_NODE>"]
}
}
}
53 changes: 53 additions & 0 deletions incubator/orientdb/config/hazelcast.xml
@@ -0,0 +1,53 @@
{{- $self := . -}}
{{- $fullname := include "orientdb.fullname" . -}}
<?xml version="1.0" encoding="UTF-8"?>
<!-- ~ Copyright (c) 2008-2012, Hazel Bilisim Ltd. All Rights Reserved. ~
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may
not use this file except in compliance with the License. ~ You may obtain
a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~
~ Unless required by applicable law or agreed to in writing, software ~ distributed
under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for
the specific language governing permissions and ~ limitations under the License. -->

<hazelcast
xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.3.xsd"
xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<group>
<name>{{ .Values.hazelcast.groupName }}</name>
<password>{{ .Values.hazelcast.groupPassword }}</password>
</group>
<properties>
<property name="hazelcast.phone.home.enabled">false</property>
<property name="hazelcast.mancenter.enabled">false</property>
<property name="hazelcast.memcache.enabled">false</property>
<property name="hazelcast.rest.enabled">false</property>
<property name="hazelcast.wait.seconds.before.join">5</property>
<property name="hazelcast.operation.thread.count">1</property>
<property name="hazelcast.io.thread.count">1</property>
<property name="hazelcast.operation.generic.thread.count">1</property>
<property name="hazelcast.client.event.thread.count">1</property>
<property name="hazelcast.event.thread.count">1</property>
<property name="hazelcast.heartbeat.interval.seconds">5</property>
<property name="hazelcast.max.no.heartbeat.seconds">30</property>
<property name="hazelcast.merge.next.run.delay.seconds">15</property>
</properties>
<network>
<port auto-increment="true">2434</port>
<join>
<multicast enabled="false">
<multicast-group>235.1.1.1</multicast-group>
<multicast-port>2434</multicast-port>
</multicast>
<!-- TODO: Use K8s hazelcast plugin: https://github.com/orientechnologies/orientdb-docker -->
<tcp-ip enabled="true">
{{- range $i, $e := until ( .Values.replicaCount | int ) }}
<member>{{ $fullname }}-{{$i}}.{{ $fullname }}-headless.{{ $self.Release.Namespace }}.svc.cluster.local</member>
{{- end }}
</tcp-ip>
</join>
</network>
<executor-service>
<pool-size>16</pool-size>
</executor-service>
</hazelcast>
14 changes: 14 additions & 0 deletions incubator/orientdb/templates/NOTES.txt
@@ -0,0 +1,14 @@
1. Get your 'root' user password by running:
printf $(kubectl get secret --namespace {{ .Release.Namespace }} {{ .Release.Name }}-secret -o jsonpath="{.data.root-password}" | base64 --decode);echo

2. Access the UI using the following command
kubectl port-forward --namespace {{ .Release.Namespace }} {{ template "orientdb.fullname" . }}-0 2480:2480

{{- if .Values.persistence.enabled }}
{{- else }}
#################################################################################
###### WARNING: Persistence is disabled!!! You will lose your data when #####
###### the Orient Cluster is terminated. #####
#################################################################################
{{- end }}

34 changes: 34 additions & 0 deletions incubator/orientdb/templates/_helpers.tpl
@@ -0,0 +1,34 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "orientdb.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "orientdb.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}



{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "orientdb.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
11 changes: 11 additions & 0 deletions incubator/orientdb/templates/config.yaml
@@ -0,0 +1,11 @@
{{- $self := . -}}

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "orientdb.fullname" . }}-configmap
data:
{{ range $path, $bytes := .Files.Glob "config/*" }}
{{ base $path }}: |-
{{ tpl ($self.Files.Get $path) $self | indent 4 }}
{{ end }}
39 changes: 39 additions & 0 deletions incubator/orientdb/templates/ingress.yaml
@@ -0,0 +1,39 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "orientdb.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "orientdb.fullname" . }}
labels:
app: {{ template "orientdb.name" . }}
chart: {{ template "orientdb.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions incubator/orientdb/templates/secret.yaml
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "orientdb.fullname" . }}-secret
labels:
app: {{ template "orientdb.name" . }}
chart: {{ template "orientdb.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ if .Values.rootPassword }}
root-password: {{ .Values.rootPassword | b64enc | quote }}
{{ else }}
root-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}
58 changes: 58 additions & 0 deletions incubator/orientdb/templates/service.yaml
@@ -0,0 +1,58 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "orientdb.fullname" . }}-headless
labels:
app: {{ template "orientdb.name" . }}
chart: {{ template "orientdb.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: ClusterIP
ports:
- port: {{ .Values.service.orientHttp }}
targetPort: http
name: http
- port: {{ .Values.service.hazelcast }}
targetPort: hazelcast
name: hazelcast
- port: {{ .Values.service.orientBinary }}
targetPort: binary
name: binary
- port: {{ .Values.service.gremlinWebsocket }}
targetPort: gremlin
name: gremlin

# headless service
clusterIP: None
selector:
app: {{ template "orientdb.name" . }}
release: {{ .Release.Name }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "orientdb.fullname" . }}-svc
labels:
app: {{ template "orientdb.name" . }}
chart: {{ template "orientdb.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.orientHttp }}
targetPort: http
name: http
- port: {{ .Values.service.hazelcast }}
targetPort: hazelcast
name: hazelcast
- port: {{ .Values.service.orientBinary }}
targetPort: binary
name: binary
- port: {{ .Values.service.gremlinWebsocket }}
targetPort: gremlin
name: gremlin
selector:
app: {{ template "orientdb.name" . }}
release: {{ .Release.Name }}

0 comments on commit 4667709

Please sign in to comment.