Skip to content

Commit

Permalink
Add helm charts
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase committed Sep 14, 2024
1 parent 5073e15 commit b42f0d0
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 73 deletions.
72 changes: 72 additions & 0 deletions helm/charts/propdoc-backend/templates/deployment-celery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "propdoc-backend.fullname" . }}
labels:
{{- include "propdoc-backend.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "propdoc-backend.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "propdoc-backend.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "propdoc-backend.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- with .Values.extraEnvCelery}}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- 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 }}
4 changes: 4 additions & 0 deletions helm/charts/propdoc-backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
4 changes: 4 additions & 0 deletions helm/charts/propdoc-frontend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- with .Values.extraEnv}}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
4 changes: 4 additions & 0 deletions helm/charts/propdoc-ml/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- with .Values.extraEnv}}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
10 changes: 5 additions & 5 deletions helm/charts/propdoc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ dependencies:
name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 20.1.0
- condition: postgresql.enabled
name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 15.5.29
- condition: ml.enabled
name: propdoc-ml
repository: oci://cr.yandex/crpc50gkvq2bp251sfgb
version: 0.1.0
- condition: qdrant.enabled
name: qdrant
repository: "https://qdrant.github.io/qdrant-helm"
version: 1.11.3
version: 1.11.3
- condition: traefik.enabled
name: traefik
repository: "https://traefik.github.io/charts"
version: 22.1.0
98 changes: 30 additions & 68 deletions helm/charts/propdoc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,108 +7,79 @@ propdoc-frontend:
enabled: true
extraEnv:
- name: API_URL
value: https://propdoc-api.banzai-predict.site
- name: KEYCLOAK_CLIENT_ID
value: webapp
- name: KEYCLOAK_AUTHORITY
value: https://propdoc-auth.banzai-predict.site/realms/propdoc-mrkt
value: http://api.test.example.com
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: traefik
hosts:
- host: ${HOST}
- host: test.example.com
paths:
- path: /
pathType: Prefix

propdoc-ml:
config:
MODEL_URL: https://propdoc-model-storage.obs.ru-moscow-1.hc.sbercloud.ru/models.zip
service:
port: 8080
port: 8000
enabled: true
extraEnv:
- name: LLM_SOURCE
value: ollama
- name: OLLAMA_HOST
value: http://ollama:11434
- name: MODEL_NAME
value: llama3.1
value: openai
- name: QDRANT_HOST
value: http://qdrant:6333
value: http://qdrant.propdoc.svc.cluster.local:6333
- name: OPENAI_API_KEY
value: placeholder

propdoc-backend:
enabled: true
config:
SERVER_PORT: 8080

RMQ_FEEDBACK_QUEUE: feedback-queue
RMQ_BEHAVIOR_QUEUE: behavior-queue
RMQ_FEEDBACK_POST_QUEUE: feedback-post-queue
RMQ_FEEDBACK_RESPONSE_QUEUE: feedback-response-queue
DB_HOST: propdoc-model-behavior-postgresql
DB_NAME: model-behavior
DB_PORT: "5432"
DB_USERNAME: app
DB_PASSWORD: password

RMQ_HOST: rabbitmq.rabbitmq
RMQ_PORT: 5672
RMQ_USERNAME: user
RMQ_PASSWORD: pass
MODEL_URL: "propdoc-ml-service.propdoc-ml-service:8080/v1"

SERVER_PORT: 5000
service:
port: 8080

port: 5000
postgresql:
primary:
persistence:
enabled: true
size: 2Gi
size: 8Gi
auth:
database: model-behavior
password: "password"
username: "app"

database: propdoc
password: placeholder
username: propdoc
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: traefik
hosts:
- host: api.${HOST}
- host: api.test.example.com
paths:
- path: /
pathType: Prefix
extraEnv:
- name: DATABASE_URL
value: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql:5432/${POSTGRES_DB}
value: postgresql://propdoc:[email protected]:5432/propdoc
- name: CELERY_BROKER_URL
value: redis://:${REDIS_PASSWORD}@redis:6379/0
value: redis://:placeholder@redis.propdoc.svc.cluster.local:6379/0
- name: CELERY_RESULT_BACKEND
value: redis://:${REDIS_PASSWORD}@redis:6379/0
value: redis://:placeholder@redis.propdoc.svc.cluster.local:6379/0

propdoc-model-interceptor:
config:
SERVER_PORT: 8080
RMQ_HOST: rabbitmq.rabbitmq
RMQ_PORT: 5672
RMQ_USERNAME: user
RMQ_PASSWORD: pass
RMQ_ROUTING_KEY: behavior-queue
MODEL_URL: "propdoc-ml-service.propdoc-ml-service:8080/v1"
service:
port: 8080
propdoc-celery-worker:
enabled: true
extraEnv:
- name: DATABASE_URL
value: postgresql://propdoc:[email protected]:5432/propdoc
- name: CELERY_BROKER_URL
value: redis://:[email protected]:6379/0
- name: CELERY_RESULT_BACKEND
value: redis://:[email protected]:6379/0
- name: HOST
value: http://ml.propdoc.svc.cluster.local:8000/invoke

redis:
enabled: true
auth:
enabled: true
password: ${REDIS_PASSWORD}
password: placeholder

# New charts to add
traefik:
enabled: true
ports:
Expand All @@ -120,19 +91,10 @@ traefik:
enabled: true
port: 8080

postgresql:
enabled: true
auth:
username: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
database: ${POSTGRES_DB}
primary:
persistence:
enabled: true
size: 8Gi

qdrant:
enabled: true
service:
port: 6333
persistence:
enabled: true
size: 8Gi

0 comments on commit b42f0d0

Please sign in to comment.