Skip to content

Commit

Permalink
Add helm chart for taxonium backend (#615)
Browse files Browse the repository at this point in the history
* update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add ingress and svc

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update ingress.yaml

* Update ingress.yaml

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
theosanderson and pre-commit-ci[bot] authored Oct 6, 2024
1 parent 9c2ed5c commit e8bff46
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 1 deletion.
4 changes: 4 additions & 0 deletions helm_charts/taxonium-backend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v2
name: taxonium-backend
description: A Helm chart for the Taxonium backend
version: 0.1.0
55 changes: 55 additions & 0 deletions helm_charts/taxonium-backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-taxonium-backend
labels:
app: {{ .Release.Name }}-taxonium-backend
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}-taxonium-backend
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: {{ .Values.maxSurge | default "25%" }}
maxUnavailable: {{ .Values.maxUnavailable | default "25%" }}
template:
metadata:
labels:
app: {{ .Release.Name }}-taxonium-backend
annotations:
kubectl.kubernetes.io/restartedAt: {{ now | date "2006-01-02T15:04:05Z" | quote }}
spec:
containers:
- name: taxonium-backend
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: DATA_URL
value: {{ .Values.dataUrl }}
- name: CONFIG_JSON
value: {{ .Values.configJson }}
- name: MAXMEM
value: {{ .Values.maxmem | quote }}
ports:
- containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
33 changes: 33 additions & 0 deletions helm_charts/taxonium-backend/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-taxonium-backend
labels:
app: {{ .Release.Name }}-taxonium-backend
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
rules:
- host: {{ .Values.hostname | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-taxonium-backend
port:
number: {{ .Values.service.port }}
{{- with .Values.ingress.tls }}
tls:
- hosts:
- {{ $.Values.hostname | quote }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions helm_charts/taxonium-backend/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-taxonium-backend
labels:
app: {{ .Release.Name }}-taxonium-backend
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 80
protocol: TCP
selector:
app: {{ .Release.Name }}-taxonium-backend
44 changes: 44 additions & 0 deletions helm_charts/taxonium-backend/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
replicaCount: 1

image:
repository: theosanderson/taxonium_backend
tag: master
pullPolicy: Always

maxSurge: "25%"
maxUnavailable: "25%"

dataUrl: "https://cov2tree.nyc3.cdn.digitaloceanspaces.com/latest_public.jsonl.gz"
configJson: "config_public.json"
maxmem: "7000"

livenessProbe:
initialDelaySeconds: 120
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3

readinessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3

resources:
requests:
cpu: "1"
memory: 6500Mi

ingress:
enabled: true
className: ""
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
2 changes: 1 addition & 1 deletion taxonium_component/src/components/Key.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const Key = ({
</h3>

{!collapsed &&
((colorRamps && colorByField in colorRamps) ? (
(colorRamps && colorByField in colorRamps ? (
<ColorRamp ramp={colorRamps[colorByField]} />
) : (
<KeyContent
Expand Down

0 comments on commit e8bff46

Please sign in to comment.