Commit aaa08c13 authored by Zivi's avatar Zivi
Browse files

moved charts here

parent a6dec6b0
# Histhub hlem charts
## Local development
Run:
```
helm package *
helm repo index .
helm serve
```
Then you can add your local charts:
```
helm repo add local http://localhost:8879
```
## Service
To deploy in prod you will need an HTTP server. Then do the following:
### Packaging
Run
```
helm package .
```
to package all files.
### Create index
Run
```
helm repo index
```
to create `index.yaml`
### Upload
Upload the directory to your webserver
### Add repo
Add repo using:
```
helm repo add myrepo <URL>
```
# 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: acme-issuer
version: 0.1.0
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "acme-issuer.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 "acme-issuer.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 "acme-issuer.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "acme-issuer.labels" -}}
app.kubernetes.io/name: {{ include "acme-issuer.name" . }}
helm.sh/chart: {{ include "acme-issuer.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- range .Values.issuer }}
---
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: letsencrypt-{{ .name }}
spec:
acme:
# The ACME server URL
server: {{ .server }}
# Email address used for ACME registration
email: {{ .email }}
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-{{ .name }}
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
class: nginx
{{- end }}
# 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: data
version: 0.1.0
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "data.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 "data.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 "data.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "data.labels" -}}
app.kubernetes.io/name: {{ include "data.name" . }}
helm.sh/chart: {{ include "data.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- range .Values.deployments }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .name }}
annotations:
kompose.cmd: kompose convert
kompose.version: 1.13.0 (84fa826)
labels:
app.kubernetes.io/name: {{ .name }}
helm.sh/chart: {{ $.Chart.Name }}
app.kubernetes.io/instance: {{ .name }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
io.kompose.service: {{ .name }}
spec:
replicas: {{ .replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .name }}
app.kubernetes.io/instance: {{ .name }}
helm.sh/chart: {{ $.Chart.Name }}
io.kompose.service: {{ .name }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ .name }}
io.kompose.service: {{ .name }}
app.kubernetes.io/instance: {{ .name }}
helm.sh/chart: {{ $.Chart.Name }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
spec:
{{- with $.Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .name }}
image: {{ .image.repository }}:{{ .image.tag | default "latest" }}
imagePullPolicy: {{ .image.pullPolicy }}
command:
- "node"
- "dist/index.js"
- "--kafka:schema-registry=http://{{ $.Values.schemaRegistry.name }}:{{ $.Values.schemaRegistry.port }}"
- "--kafka:broker={{ $.Values.kafkaBootstrap.name }}:{{ $.Values.kafkaBootstrap.port }}"
resources:
{{- toYaml .resources | nindent 12 }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- range .Values.jobs }}
---
apiVersion: batch/v1
kind: Job
metadata:
labels:
io.kompose.service: {{ .name }}
name: {{ .name }}
spec:
template:
spec:
containers:
- name: {{ .name }}
image: {{ .image.repository }}:{{ .image.tag | default "latest" }}
command:
- "node"
- "dist/index.js"
- "--kafka:schema-registry=http://{{ $.Values.schemaRegistry.name }}:{{ $.Values.schemaRegistry.port }}"
- "--kafka:broker={{ $.Values.kafkaBootstrap.name }}:{{ $.Values.kafkaBootstrap.port }}"
{{- if .buildSitemap }}
- "--buildSitemap=true"
env:
- name: buildSitemap
value: "true"
{{- end }}
resources: {{- toYaml .resources | nindent 10 }}
restartPolicy: {{ .restartPolicy | default "Never" }}
{{- with $.Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
backoffLimit: {{ .backoffLimit | default 2 }}
{{- if .cronjob }}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
labels:
io.kompose.service: {{ .name }}
name: {{ .name }}
spec:
schedule: {{ .cronjob.schedule }}
jobTemplate:
spec:
template:
spec:
containers:
- name: {{ .name }}
image: {{ .image.repository }}:{{ .image.tag | default "latest" }}
command:
- "node"
- "dist/index.js"
- "--kafka:schema-registry=http://{{ $.Values.schemaRegistry.name }}:{{ $.Values.schemaRegistry.port }}"
- "--kafka:broker={{ $.Values.kafkaBootstrap.name }}:{{ $.Values.kafkaBootstrap.port }}"
{{- if .buildSitemap }}
- "--buildSitemap=true"
env:
- name: buildSitemap
value: "true"
{{- end }}
resources: {{- toYaml .resources | nindent 14 }}
restartPolicy: {{ .restartPolicy | default "Never" }}
{{- with $.Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.affinity }}
affinity:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.tolerations }}
tolerations:
{{- toYaml . | nindent 12 }}
{{- end }}
backoffLimit: {{ .backoffLimit | default 1 }}
{{- end }}
{{- end }}
imagePullSecrets:
- name: dodis
kafkaBootstrap:
name: "geolinker-kafka-bootstrap"
port: 9092
schemaRegistry:
name: "kafka-schema-registry"
port: 8081
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: doks.digitalocean.com/node-pool
operator: In
values:
- jobs
jobs:
# - name: csv-link-producer
# image:
# repository: source.dodis.ch:4577/histhub/csv-link-producer
# resources:
# limits:
# memory: "128Mi"
# cpu: 0.1
# - name: csv-link-producer-urls
# image:
# repository: source.dodis.ch:4577/histhub/csv-link-producer-url
# resources:
# limits:
# memory: "128Mi"
# cpu: 0.1
# - name: dodis
# image:
# repository: source.dodis.ch:4577/histhub/dodis
# buildSitemap: true
# resources:
# limits:
# memory: "128Mi"
# cpu: 0.2
# cronjob:
# schedule: "59 23 * * 2"
# - name: fundmuenzen
# image:
# repository: source.dodis.ch:4577/histhub/fundmuenzen
# resources:
# limits:
# memory: "256Mi"
# cpu: 0.1
# cronjob:
# schedule: "59 23 * * 3"
# - name: geonames-dump-producer
# image:
# repository: source.dodis.ch:4577/histhub/geonames-dump-producer
# resources:
# limits:
# memory: "1Gi"
# cpu: 1
# requests:
# memory: "512Mi"
# cpu: 0.4
# cronjob:
# schedule: "59 23 10 * *"
- name: ortsnamen
image:
repository: source.dodis.ch:4577/histhub/ortsnamen
resources:
limits:
memory: "256Mi"
cpu: 0.2
cronjob:
schedule: "59 23 * * 4"
- name: wikidata-dump-producer
image:
repository: source.dodis.ch:4577/histhub/wikidata-dump-producer
resources:
limits:
memory: "2Gi"
cpu: 1
requests:
memory: "512Mi"
cpu: 0.4
# - name: ethz
# image:
# repository: source.dodis.ch:4577/histhub/ethz
# cronjob:
# schedule: "59 23 * * 6"
deployments: {}
# - name: wikidata-live-feed
# image:
# repository: source.dodis.ch:4577/histhub/wikidata-live-feed
# resources:
# limits:
# cpu: 0.2
# memory: "256Mi"
# requests:
# memory: "128Mi"
# 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: elasticsearch-proxy
version: 0.1.0
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "elasticsearch-proxy.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 "elasticsearch-proxy.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 "elasticsearch-proxy.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "elasticsearch-proxy.labels" -}}
app.kubernetes.io/name: {{ include "elasticsearch-proxy.name" . }}
helm.sh/chart: {{ include "elasticsearch-proxy.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "elasticsearch-proxy.fullname" . }}-nginx-conf
data:
nginx.conf: |
{{ .Values.nginxConf | indent 4 }}
allow.conf: |
{{ .Values.allowConf | indent 4 }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "elasticsearch-proxy.fullname" . }}
annotations:
kompose.cmd: kompose convert
labels:
io.kompose.service: {{ include "elasticsearch-proxy.fullname" . }}
{{ include "elasticsearch-proxy.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "elasticsearch-proxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "elasticsearch-proxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
io.kompose.service: elasticsearchproxy
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- mountPath: /etc/nginx
readOnly: true
name: nginx-conf
ports:
- containerPort: 9200
protocol: TCP
- containerPort: 9300
protocol: TCP
readinessProbe:
httpGet:
path: /ping
port: 9200
periodSeconds: 30
timeoutSeconds: 30
successThreshold: 1
failureThreshold: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: nginx-conf
configMap:
name: {{ include "elasticsearch-proxy.fullname" . }}-nginx-conf
items:
- key: nginx.conf
path: nginx.conf