Skip to content

Commit

Permalink
[CE-403] Add helm charts for deploy cello master
Browse files Browse the repository at this point in the history
User can deploy cello master service through helm charts.

Change-Id: If24460e1563256115e6a1366f4fe02a907a2c72c
Signed-off-by: Haitao Yue <hightall@me.com>
  • Loading branch information
hightall committed Jul 3, 2018
1 parent beab111 commit 0a86b97
Show file tree
Hide file tree
Showing 16 changed files with 518 additions and 0 deletions.
19 changes: 19 additions & 0 deletions thirdparty/helm/cello-master/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
description: Cello is a Block As a service in hyperledger.
name: cello-master
version: 0.1.0
keywords:
- Hyperledger
- BAAS
- Cello
home: https://www.hyperledger.org/projects/cello
icon: https://wiki.hyperledger.org/_media/projects/hyperledger_cello_logo_color.png
sources:
- https://github.com/hyperledger/cello
maintainers:
- name: Haitao Yue
email: hightall@me.com
- name: Baohua Yang
email: yangbaohua@gmail.com
- name: Tong Li
email: litong01@us.ibm.com
6 changes: 6 additions & 0 deletions thirdparty/helm/cello-master/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: minio
repository: https://kubernetes-charts.storage.googleapis.com
version: 1.3.4
digest: sha256:ab84dd6eeb6fe4e4984aa3f2a1f3add97e18127d1b3948caa4ea538ab7751f4b
generated: 2018-07-03T10:25:26.957459+08:00
4 changes: 4 additions & 0 deletions thirdparty/helm/cello-master/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies:
- name: minio
repository: "https://kubernetes-charts.storage.googleapis.com"
version: 1.3.4
15 changes: 15 additions & 0 deletions thirdparty/helm/cello-master/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export OPERATOR_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "cello-master.fullname" . }} -o jsonpath="{.spec.ports[1].nodePort}")
export USER_DASHBOARD_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "cello-master.fullname" . }} -o jsonpath="{.spec.ports[2].nodePort}")
{{- end }}

2. Local storage paths:
mongo: {{ .Values.mongo.storePath }}
nfs: {{ .Values.nfs.storePath }}
minio: {{ .Values.minio.persistence.storePath }}

3. Ingress Path:
{{- if .Values.minio.ingress.enabled }}
path: {{ .Values.minio.ingress.path }}
{{- end }}
27 changes: 27 additions & 0 deletions thirdparty/helm/cello-master/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "cello-master.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).
*/}}
{{- define "cello-master.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "nfs-provisioner.provisionerName" -}}
{{- if .Values.nfs.storageClass -}}
{{- printf .Values.nfs.storageClass -}}
{{- else -}}
cluster.local/{{ template "nfs-provisioner.fullname" . -}}
{{- end -}}
{{- end -}}
125 changes: 125 additions & 0 deletions thirdparty/helm/cello-master/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "cello-master.fullname" . }}
labels:
app: {{ template "cello-master.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "cello-master.name" . }}
release: {{ .Release.Name }}
spec:
initContainers:
- name: init-nfs-files
image: "{{ .Values.operatorDashboardImage.repository }}:{{ .Values.operatorDashboardImage.tag }}"
volumeMounts:
- name: operator-nfs
mountPath: "/opt/data"
command: ["rsync"]
args: ["-av", "--delete", "/app/agent/docker/_compose_files/", "/opt/data/"]
containers:
# - name: "{{ .Chart.Name }}-nfs"
# image: "{{ .Values.nfsImage.repository }}:{{ .Values.nfsImage.tag }}"
# imagePullPolicy: {{ .Values.image.pullPolicy }}
# ports:
# - name: nfs
# containerPort: 2049
# protocol: TCP
# - name: mountd
# containerPort: 20048
# protocol: TCP
# - name: rpcbind-tcp
# containerPort: 111
# protocol: TCP
# - name: rpcbind-udp
# containerPort: 111
# protocol: UDP
# args:
# - "-provisioner={{ template "nfs-provisioner.provisionerName" . }}"
# volumeMounts:
# - name: operator-nfs
# mountPath: "/export"
- name: "{{ .Chart.Name }}-mongo"
image: "{{ .Values.mongoImage.repository }}:{{ .Values.mongoImage.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: operator-mongo
mountPath: "/data/db"
- name: "{{ .Chart.Name }}-engine"
image: "{{ .Values.engineImage.repository }}:{{ .Values.engineImage.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: MONGO_URL
value: "mongodb://127.0.0.1:27017"
- name: MONGO_HOST
value: "127.0.0.1"
- name: MONGO_DB
value: "dev"
- name: MONGODB_PORT
value: "27017"
- name: DEBUG
value: "False"
- name: "{{ .Chart.Name }}-operator"
image: "{{ .Values.operatorDashboardImage.repository }}:{{ .Values.operatorDashboardImage.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: MONGO_URL
value: "mongodb://127.0.0.1:27017"
- name: MONGODB_HOST
value: "127.0.0.1"
- name: MONGODB_DB
value: "dashboard"
- name: MONGODB_PORT
value: "27017"
- name: DEBUG
value: "{{ .Values.operator.debug }}"
- name: STATIC_FOLDER
value: "static"
- name: TEMPLATE_FOLDER
value: "templates"
- name: ENABLE_EMAIL_ACTIVE
value: "True"
- name: "{{ .Chart.Name }}-user-dashboard"
image: "{{ .Values.userDashboardImage.repository }}:{{ .Values.userDashboardImage.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: NODE_ENV
value: "production"
- name: RESTFUL_SERVER
value: "127.0.0.1:8080"
- name: ENABLE_EMAIL_ACTIVE
value: "{{ .Values.userDashboard.enableEmailActive }}"
- name: MONGO_HOST
value: "{{ .Values.userDashboard.mongo.host }}"
- name: MONGO_PORT
value: "{{ .Values.userDashboard.mongo.port }}"
- name: MONGO_DB
value: "{{ .Values.userDashboard.mongo.database }}"
- name: WEBROOT
value: "{{ .Values.userDashboard.webRoot }}"
- name: FABRIC_CFG_PATH
value: "/etc/hyperledger/fabric"
volumeMounts:
- name: user-dashboard
mountPath: "/opt/data"
- name: minio
mountPath: "/opt/minio"
volumes:
- name: operator-nfs
persistentVolumeClaim:
claimName: "{{ template "cello-master.fullname" . }}-nfs"
- name: operator-mongo
persistentVolumeClaim:
claimName: "{{ template "cello-master.fullname" . }}-mongo"
- name: user-dashboard
persistentVolumeClaim:
claimName: "{{ template "cello-master.fullname" . }}-user-dashboard"
- name: minio
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-minio"
32 changes: 32 additions & 0 deletions thirdparty/helm/cello-master/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "cello-master.fullname" . -}}
{{- $servicePort := .Values.service.externalPort -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "cello-master.fullname" . }}
labels:
app: {{ template "cello-master.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
18 changes: 18 additions & 0 deletions thirdparty/helm/cello-master/templates/minio-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: "{{ template "cello-master.fullname" . }}-minio"
labels:
type: local
spec:
{{- if (eq "-" .Values.minio.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.minio.persistence.storageClass }}"
{{- end }}
capacity:
storage: {{ .Values.minio.persistence.size }}
accessModes:
- ReadWriteOnce
hostPath:
path: {{ .Values.minio.persistence.storePath }}
22 changes: 22 additions & 0 deletions thirdparty/helm/cello-master/templates/mongo-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: "{{ template "cello-master.fullname" . }}-mongo"
labels:
type: local
spec:
{{- if .Values.autoStorageClass }}
storageClassName: "{{ template "cello-master.fullname" . }}-mongo"
{{- else }}
{{- if (eq "-" .Values.mongo.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.mongo.storageClass }}"
{{- end }}
{{- end }}
capacity:
storage: {{ .Values.mongo.size }}
accessModes:
- ReadWriteOnce
hostPath:
path: {{ .Values.mongo.storePath }}
19 changes: 19 additions & 0 deletions thirdparty/helm/cello-master/templates/mongo-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "{{ template "cello-master.fullname" . }}-mongo"
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.autoStorageClass }}
storageClassName: "{{ template "cello-master.fullname" . }}-mongo"
{{- else }}
{{- if (eq "-" .Values.mongo.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.mongo.storageClass }}"
{{- end }}
{{- end }}
resources:
requests:
storage: {{ .Values.mongo.size }}
22 changes: 22 additions & 0 deletions thirdparty/helm/cello-master/templates/nfs-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: "{{ template "cello-master.fullname" . }}-nfs"
labels:
type: local
spec:
{{- if .Values.autoStorageClass }}
storageClassName: "{{ template "cello-master.fullname" . }}-nfs"
{{- else }}
{{- if (eq "-" .Values.nfs.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.nfs.storageClass }}"
{{- end }}
{{- end }}
capacity:
storage: {{ .Values.nfs.size }}
accessModes:
- ReadWriteOnce
hostPath:
path: {{ .Values.nfs.storePath }}
19 changes: 19 additions & 0 deletions thirdparty/helm/cello-master/templates/nfs-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "{{ template "cello-master.fullname" . }}-nfs"
spec:
{{- if .Values.autoStorageClass }}
storageClassName: "{{ template "cello-master.fullname" . }}-nfs"
{{- else }}
{{- if (eq "-" .Values.nfs.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.nfs.storageClass }}"
{{- end }}
{{- end }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.nfs.size }}
55 changes: 55 additions & 0 deletions thirdparty/helm/cello-master/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "cello-master.fullname" . }}
labels:
app: {{ template "cello-master.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 80
targetPort: 80
protocol: TCP
name: engine
- port: 8080
targetPort: 8080
protocol: TCP
name: operator
- port: 8081
targetPort: 8081
protocol: TCP
name: user
# - port: {{ .Values.nfs.nfsPort }}
# targetPort: nfs
# protocol: TCP
# name: nfs
#{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.nfs.nfsNodePort))) }}
# nodePort: {{ .Values.nfs.nfsNodePort }}
#{{- end }}
# - port: {{ .Values.nfs.mountdPort }}
# targetPort: mountd
# protocol: TCP
# name: mountd
#{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.nfs.mountdNodePort))) }}
# nodePort: {{ .Values.nfs.mountdNodePort }}
#{{- end }}
# - port: {{ .Values.nfs.rpcbindPort }}
# targetPort: rpcbind-tcp
# protocol: TCP
# name: rpcbind-tcp
#{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.nfs.rpcbindNodePort))) }}
# nodePort: {{ .Values.nfs.rpcbindNodePort }}
#{{- end }}
# - port: {{ .Values.nfs.rpcbindPort }}
# targetPort: rpcbind-udp
# protocol: UDP
# name: rpcbind-udp
#{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.nfs.rpcbindNodePort))) }}
# nodePort: {{ .Values.nfs.rpcbindNodePort }}
#{{- end }}
selector:
app: {{ template "cello-master.name" . }}
release: {{ .Release.Name }}
Loading

0 comments on commit 0a86b97

Please sign in to comment.