Commit 757af81c authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Initial chart for nomad (api).

parent 849bce98
charts/
\ No newline at end of file
# 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
.vscode/
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: nomad
version: 0.1.0
dependencies:
- name: rabbitmq
repository: https://kubernetes-charts.storage.googleapis.com/
version: 4.0.1
- name: mongodb
repository: https://kubernetes-charts.storage.googleapis.com/
version: 4.9.1
- name: elasticsearch
repository: https://kubernetes-charts.storage.googleapis.com/
version: 1.15.0
- name: postgresql
repository: https://kubernetes-charts.storage.googleapis.com/
version: 3.1.1
digest: sha256:c6c65e79414429b8b2ecdba6fa2f13628614a0be3c5fff8947c79270a00386fb
generated: 2018-12-12T14:02:40.726497+01:00
dependencies:
- name: rabbitmq
version: "4.0.1"
repository: "https://kubernetes-charts.storage.googleapis.com/"
- name: mongodb
version: "4.9.1"
repository: "https://kubernetes-charts.storage.googleapis.com/"
- name: elasticsearch
version: "1.15.0"
repository: "https://kubernetes-charts.storage.googleapis.com/"
- name: postgresql
version: "3.1.1"
repository: "https://kubernetes-charts.storage.googleapis.com/"
\ No newline at end of file
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "nomad.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 "nomad.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 "nomad.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "nomad.fullname" . }}-api
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-api
helm.sh/chart: {{ include "nomad.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.api.replicas }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-api
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-api
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ include "nomad.name" . }}-api
image: "{{ .Values.images.nomad.name }}:{{ .Values.images.nomad.tag }}"
volumeMounts:
- mountPath: /app/.volumes/fs
name: files-volume
env:
- name: NOMAD_SERVICE
value: "api"
- name: NOMAD_LOGSTASH_HOST
value: {{ .Values.logstash.host }}
- name: NOMAD_LOGSTASH_TCPPORT
value: {{ .Values.logstash.port }}
- name: NOMAD_CONSOLE_LOGLEVEL
value: {{ .Values.api.console_loglevel }}
- name: NOMAD_LOGSTASH_LEVEL
value: {{ .Values.api.logstash_loglevel }}
- name: NOMAD_API_PORT
value: {{ .Values.api.port }}
- name: NOMAD_API_SECRET
value: {{ .Values.api.secret }}
imagePullSecrets:
- name: {{ .Values.images.secret }}
volumes:
- name: files-volume
hostPath:
path: {{ .Values.volumes.files }}
type: Directory
apiVersion: v1
kind: Service
metadata:
name: {{ include "nomad.fullname" . }}-api
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-api
helm.sh/chart: {{ include "nomad.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.api.service_type }}
ports:
- port: {{ .Values.api.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "nomad.name" . }}-api
app.kubernetes.io/instance: {{ .Release.Name }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "nomad.fullname" . }}-worker
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-worker
helm.sh/chart: {{ include "nomad.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.worker.replicas }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-worker
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-worker
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ include "nomad.name" . }}-worker
image: "{{ .Values.images.nomad.name }}:{{ .Values.images.nomad.tag }}"
volumeMounts:
- mountPath: /app/.volumes/fs
name: files-volume
env:
- name: NOMAD_SERVICE
value: "worker"
- name: NOMAD_LOGSTASH_HOST
value: {{ .Values.logstash.host }}
- name: NOMAD_LOGSTASH_TCPPORT
value: {{ .Values.logstash.port }}
- name: NOMAD_CONSOLE_LOGLEVEL
value: {{ .Values.worker.console_loglevel }}
- name: NOMAD_LOGSTASH_LEVEL
value: {{ .Values.worker.logstash_loglevel }}
imagePullSecrets:
- name: {{ .Values.images.secret }}
volumes:
- name: files-volume
hostPath:
path: {{ .Values.volumes.files }}
type: Directory
## Default values for nomad@FAIRDI
## Everything concerning the container images to be used
images:
## The kubernetes docker-registry secret that can be used to access the registry
# with the container image in it.
# It can be created via:
# kubectl create secret docker-registry gitlab-mpcdf --docker-server=gitlab-registry.mpcdf.mpg.de --docker-username=<your-user-name > --docker-password=<yourpass> --docker-email=<email>
secret: gitlab-mpcdf
## The nomad image with all nomad relavant python code. Used by api and worker service.
nomad:
## The docker container image name without tag
name: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair
## The docker container image tag
tag: latest
pullPolicy: IfNotPresent
## Everthing concerning the nomad api
api:
replicas: 1
port: 8000
console_loglevel: INFO
logstash_loglevel: INFO
service_type: ClusterIP
## Secret used as cryptographic seed
secret: "defaultApiSecret"
## Everthing concerning the nomad worker
worker:
replicas: 2
console_loglevel: INFO
logstash_loglevel: INFO
rabbitmq:
image.pullSecrets: nil
rbacEnabled: false
rabbitmq:
username: rabbitmq
password: rabbitmq
erlangCookie: SWQOKODSQALRPCLNMEQG
persistence.enabled: false
securityContext.enabled: false
mongodb:
image.pullSecrets: nil
usePassword: false
persistence.enabled: true
securityContext.enabled: false
elasticsearch:
client.replicas: 2
master.replicas: 1
data.replicas: 1
cluster.env: {MINIMUM_MASTER_NODES=""1"}
postgresql:
postgresqlUsername: "postgres"
postgresqlPassword: "nomad"
postgresqlDatabase: "nomad"
securityContext.enabled: false
logstash:
port: 5000
host: "enc-preprocessing-nomad.esc"
## Everthing concerning the data that is used by the service
volumes:
files: /nomad/nomadlab/nomad-FAIRDI/files
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment