Skip to content

Commit

Permalink
add 0.3.0 version with cluster mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Александр Григоров committed Nov 22, 2018
1 parent 2dfb0f5 commit 96748b1
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 71 deletions.
15 changes: 14 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,23 @@ Create exist persistent volume:
kubectl apply -f pvc-exist.yaml

Install via helm:
helm upgrade --install eventstore eventstore --set ingress.enabled=true --set ingress.hosts[0]=eventstore.<domainname> --set persistence.enabled=true
helm upgrade --install eventstore eventstore --set ingress.enabled=true --set ingress.hosts[0]=eventstore.<domainname> --set persistence.enabled=true --set fullnameOverride=eventstore

access to Eventstore Web UI: http://eventstore.<domainname> with default login and password (admin/changeit)

My default:
persistence = false
ingress = false
cluster = false

if you need enable ingress:
```
helm upgrade -i eventstore eventstore --set fullnameOverride=eventstore --set image.tag=release-4.1.1-hotfix1 --set ingress.enabled=true --set ingress.hosts[0]=eventstore.test.<domainname> --namespace=test
```

if you need cluster eventstore with UI:
```
helm upgrade -i eventstore eventstore --set fullnameOverride=eventstore --set cluster.enabled=true --set image.tag=release-4.1.1-hotfix1 --set ingress.enabled=true --set ingress.hosts[0]=eventstore.test.<domainname> --namespace=test
```

Cluster Status: http://eventstore.test.<domainname>/web/index.html#/clusterstatus
Empty file modified eventstore/.helmignore
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions eventstore/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v1
description: A Helm chart for Kubernetes EventStore.
name: eventstore
home: https://eventstore.org/
version: 0.1.0
appVersion: 4.1.0
version: 0.3.0
appVersion: 4.1.1-hotfix1
keywords:
- eventstore
sources:
Expand Down
9 changes: 9 additions & 0 deletions eventstore/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ Expand the name of the chart.
{{/*
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 "eventstore.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 -}}
65 changes: 0 additions & 65 deletions eventstore/templates/deployment.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions eventstore/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.cluster.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -9,6 +10,7 @@ metadata:
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
clusterIP: None
ports:
- name: http
port: {{ default "2113" .Values.service.HTTPInterfacePort }}
Expand All @@ -21,3 +23,28 @@ spec:
selector:
app: {{ template "eventstore.name" . }}
release: {{ .Release.Name }}
{{- else -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "eventstore.fullname" . }}
labels:
app: {{ template "eventstore.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: {{ default "2113" .Values.service.HTTPInterfacePort }}
targetPort: http
protocol: TCP
- name: tcp
port: {{ default "1113" .Values.service.TCPInterfacePort }}
targetPort: tcp
protocol: TCP
selector:
app: {{ template "eventstore.name" . }}
release: {{ .Release.Name }}
{{- end -}}
189 changes: 189 additions & 0 deletions eventstore/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{{- if .Values.cluster.enabled -}}
{{- $replicaCount := .Values.cluster.replicaCount -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "eventstore.fullname" . }}
labels:
app: {{ template "eventstore.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: {{ template "eventstore.name" . }}
release: {{ .Release.Name }}
serviceName: {{ template "eventstore.fullname" . }}
replicas: {{ $replicaCount }}
template:
metadata:
labels:
app: {{ template "eventstore.name" . }}
release: {{ .Release.Name }}
spec:
terminationGracePeriodSeconds: 10
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: EVENTSTORE_INT_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: EVENTSTORE_EXT_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: EVENTSTORE_CLUSTER_DNS
value: {{ template "eventstore.name" . }}
- name: EVENTSTORE_INT_TCP_PORT
value: "1111"
- name: EVENTSTORE_EXT_TCP_PORT
value: "1113"
- name: EVENTSTORE_INT_HTTP_PORT
value: "2111"
- name: EVENTSTORE_EXT_HTTP_PORT
value: "2113"
- name: EVENTSTORE_CLUSTER_SIZE
value: {{ .Values.cluster.replicaCount | quote }}
- name: EVENTSTORE_CLUSTER_GOSSIP_PORT
value: "2111"
- name: EVENTSTORE_GOSSIP_ALLOWED_DIFFERENCE_MS
value: "600000"
- name: EVENTSTORE_INT_HTTP_PREFIXES
value: "http://*:2111/"
- name: EVENTSTORE_EXT_HTTP_PREFIXES
value: "http://*:2113/"
{{- range $key, $value := .Values.envs }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
ports:
- name: http
containerPort: {{ default "2113" .Values.service.HTTPInterfacePort }}
- name: tcp
containerPort: {{ default "1113" .Values.service.TCPInterfacePort }}
- name: tcp-int
containerPort: 1111
- name: http-int
containerPort: 2111
volumeMounts:
- name: data
mountPath: /var/lib/eventstore
livenessProbe:
httpGet:
path: /stats
port: {{ .Values.service.HTTPInterfacePort }}
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 15
readinessProbe:
httpGet:
path: /stats
port: {{ .Values.service.HTTPInterfacePort }}
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 15
resources:
{{ toYaml .Values.resources | indent 12 }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "eventstore.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- else -}}
{{- $replicaCount := .Values.replicaCount -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "eventstore.fullname" . }}
labels:
app: {{ template "eventstore.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: {{ template "eventstore.name" . }}
release: {{ .Release.Name }}
serviceName: {{ template "eventstore.fullname" . }}
replicas: {{ $replicaCount }}
template:
metadata:
labels:
app: {{ template "eventstore.name" . }}
release: {{ .Release.Name }}
spec:
terminationGracePeriodSeconds: 10
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- range $key, $value := .Values.envs }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
ports:
- name: http
containerPort: {{ default "2113" .Values.service.HTTPInterfacePort }}
- name: tcp
containerPort: {{ default "1113" .Values.service.TCPInterfacePort }}
volumeMounts:
- name: data
mountPath: /var/lib/eventstore
livenessProbe:
httpGet:
path: /stats
port: {{ .Values.service.HTTPInterfacePort }}
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 15
readinessProbe:
httpGet:
path: /stats
port: {{ .Values.service.HTTPInterfacePort }}
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 15
resources:
{{ toYaml .Values.resources | indent 12 }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "eventstore.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- end -}}
15 changes: 12 additions & 3 deletions eventstore/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
replicaCount: 1
image:
repository: eventstore/eventstore
tag: latest
tag: release-4.1.1-hotfix1
pullPolicy: IfNotPresent
service:
name: eventstore
type: ClusterIP
HTTPInterfacePort: 2113
TCPInterfacePort: 1113

cluster:
enabled: false
replicaCount: 3

ingress:
enabled: false
# Used to create an Ingress record.
hosts:
- eventstore-red.k8s-test.digital.bank
- eventstore.test.example.com
annotations:
kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
Expand Down Expand Up @@ -50,4 +55,8 @@ persistence:
size: 8Gi
nodeSelector: {}
tolerations: []
affinity: {}
affinity: {}
envs:
EVENTSTORE_START_STANDARD_PROJECTIONS: True
EVENTSTORE_RUN_PROJECTIONS: "All"
EVENTSTORE_MEM_DB: True

0 comments on commit 96748b1

Please sign in to comment.