1
0
forked from github/onyx

ADd slackbot to helm

This commit is contained in:
Weves
2025-06-17 16:21:34 -07:00
committed by Chris Weaver
parent f8621f7ea9
commit 4c9dc14e65
14 changed files with 91 additions and 42 deletions

View File

@@ -63,30 +63,11 @@ Additional steps for user auth and https if you do want to use Docker Compose fo
## Kubernetes:
Depending on your deployment needs Kubernetes may be more suitable. The yamls provided will work out of the box but the
intent is for you to customize the deployment to fit your own needs. There is no data replication or auto-scaling built
in for the provided example.
intent is for you to customize the deployment to fit your own needs.
Requirements: a Kubernetes cluster and kubectl
Requirements: a Kubernetes cluster, kubectl, and helm.
Guide: https://docs.onyx.app/production/aws/eks#installing-the-services
**NOTE: This setup does not explicitly enable https, the assumption is you would have this already set up for your
prod cluster**
1. To run Onyx, navigate to `kubernetes` directory and run the following:
- `kubectl apply -f .`
2. To remove Onyx, run:
- **WARNING, this will also erase your indexed data and users**
- `kubectl delete -f .`
- To not delete the persistent volumes (Document indexes and Users), specify the specific `.yaml` files instead of
`.` without specifying delete on persistent-volumes.yaml.
### Using Helm to deploy to an existing cluster
Onyx has a helm chart that is convenient to install all services to an existing Kubernetes cluster. To install:
* Currently the helm chart is not published so to install, clone the repo.
* Configure access to the cluster via kubectl. Ensure the kubectl context is set to the cluster that you want to use
* The default secrets, environment variables and other service level configuration are stored in `deployment/helm/charts/onyx/values.yml`. You may create another `override.yml`
* `cd deployment/helm/charts/onyx` and run `helm install onyx -n onyx -f override.yaml .`. This will install onyx on the cluster under the `onyx` namespace.
* Check the status of the deploy using `kubectl get pods -n onyx`
prod cluster.**

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.api.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
- "/bin/sh"
- "-c"

View File

@@ -36,7 +36,7 @@ spec:
securityContext:
{{- toYaml .Values.celery_beat.securityContext | nindent 12 }}
image: "{{ .Values.celery_shared.image.repository }}:{{ .Values.celery_shared.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.celery_shared.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
[
"celery",

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.celery_worker_heavy.securityContext | nindent 12 }}
image: "{{ .Values.celery_shared.image.repository }}:{{ .Values.celery_shared.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.celery_shared.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
[
"celery",

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.celery_worker_indexing.securityContext | nindent 12 }}
image: "{{ .Values.celery_shared.image.repository }}:{{ .Values.celery_shared.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.celery_shared.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
[
"celery",

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.celery_worker_light.securityContext | nindent 12 }}
image: "{{ .Values.celery_shared.image.repository }}:{{ .Values.celery_shared.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.celery_shared.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
[
"celery",

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.celery_worker_monitoring.securityContext | nindent 12 }}
image: "{{ .Values.celery_shared.image.repository }}:{{ .Values.celery_shared.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.celery_shared.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
[
"celery",

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.celery_worker_primary.securityContext | nindent 12 }}
image: "{{ .Values.celery_shared.image.repository }}:{{ .Values.celery_shared.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.celery_shared.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
[
"celery",

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.celery_worker_user_files_indexing.securityContext | nindent 12 }}
image: "{{ .Values.celery_shared.image.repository }}:{{ .Values.celery_shared.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.celery_shared.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command:
[
"celery",

View File

@@ -26,8 +26,8 @@ spec:
spec:
containers:
- name: {{ .Values.indexCapability.name }}
image: "{{ .Values.indexCapability.image.repository }}:{{ .Values.indexCapability.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.indexCapability.image.pullPolicy }}
image: "{{ .Values.indexCapability.image.repository }}:{{ .Values.indexCapability.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.global.pullPolicy }}
command: [ "uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "{{ .Values.indexCapability.containerPorts.server }}", "--limit-concurrency", "{{ .Values.indexCapability.limitConcurrency }}" ]
ports:
- name: model-server

View File

@@ -23,7 +23,7 @@ spec:
containers:
- name: model-server-inference
image: "{{ .Values.inferenceCapability.image.repository }}:{{ .Values.inferenceCapability.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.inferenceCapability.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
command: [ "uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "{{ .Values.inferenceCapability.containerPorts.server }}" ]
ports:
- name: model-server

View File

@@ -0,0 +1,48 @@
{{- if .Values.slackbot.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "onyx-stack.fullname" . }}-slackbot
labels:
{{- include "onyx-stack.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "onyx-stack.selectorLabels" . | nindent 6 }}
{{- if .Values.slackbot.deploymentLabels }}
{{- toYaml .Values.slackbot.deploymentLabels | nindent 6 }}
{{- end }}
template:
metadata:
{{- with .Values.slackbot.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "onyx-stack.labels" . | nindent 8 }}
{{- with .Values.slackbot.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.slackbot.podSecurityContext | nindent 8 }}
containers:
- name: slackbot
securityContext:
{{- toYaml .Values.slackbot.securityContext | nindent 12 }}
image: "{{ .Values.slackbot.image.repository }}:{{ .Values.slackbot.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.global.pullPolicy }}
command: ["python", "onyx/onyxbot/slack/listener.py"]
resources:
{{- toYaml .Values.slackbot.resources | nindent 12 }}
envFrom:
- configMapRef:
name: {{ .Values.config.envConfigMapName }}
env:
{{- include "onyx-stack.envSecrets" . | nindent 12}}
{{- end }}

View File

@@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.webserver.securityContext | nindent 12 }}
image: "{{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default .Values.global.version }}"
imagePullPolicy: {{ .Values.webserver.image.pullPolicy }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.webserver.containerPorts.server }}

View File

@@ -5,6 +5,8 @@
global:
# Global version for all Onyx components (overrides .Chart.AppVersion)
version: "latest"
# Global pull policy for all Onyx component images
pullPolicy: "IfNotPresent"
postgresql:
primary:
@@ -39,7 +41,6 @@ vespa:
replicaCount: 1
image:
repository: vespa
pullPolicy: IfNotPresent
tag: "8.526.15"
podAnnotations: {}
podLabels:
@@ -82,7 +83,6 @@ inferenceCapability:
repository: onyxdotapp/onyx-model-server
# Overrides the image tag whose default is the chart appVersion.
tag: ""
pullPolicy: IfNotPresent
containerPorts:
server: 9000
podLabels:
@@ -109,7 +109,6 @@ indexCapability:
repository: onyxdotapp/onyx-model-server
# Overrides the image tag whose default is the chart appVersion.
tag: ""
pullPolicy: IfNotPresent
limitConcurrency: 10
config:
envConfigMapName: env-configmap
@@ -147,7 +146,6 @@ webserver:
replicaCount: 1
image:
repository: onyxdotapp/onyx-web-server
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
deploymentLabels:
@@ -216,7 +214,6 @@ api:
replicaCount: 1
image:
repository: onyxdotapp/onyx-backend
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
deploymentLabels:
@@ -344,7 +341,6 @@ api:
celery_shared:
image:
repository: onyxdotapp/onyx-backend
pullPolicy: IfNotPresent
tag: "" # Overrides the image tag whose default is the chart appVersion.
startupProbe:
# startupProbe fails after 2m
@@ -519,6 +515,30 @@ celery_worker_user_files_indexing:
tolerations: []
affinity: {}
slackbot:
enabled: true
replicaCount: 1
image:
repository: onyxdotapp/onyx-backend
tag: "" # Overrides the image tag whose default is the chart appVersion.
podAnnotations: {}
podLabels:
scope: onyx-backend
app: slack-bot
deploymentLabels:
app: slack-bot
podSecurityContext:
{}
securityContext:
{}
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1000m"
memory: "2000Mi"
redis:
enabled: true
architecture: standalone