-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chatbot-rag-app: adds Kubernetes manifest and instructions
Signed-off-by: Adrian Cole <[email protected]>
- Loading branch information
1 parent
2868e7d
commit 9f0bb96
Showing
3 changed files
with
108 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: chatbot-rag-app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: chatbot-rag-app | ||
template: | ||
metadata: | ||
labels: | ||
app: chatbot-rag-app | ||
spec: | ||
# Simplify networking so that it can look for elasticsearch on localhost | ||
hostNetwork: true | ||
# The below will recreate your secret based on the gcloud credentials file | ||
# kubectl create secret generic gcloud-credentials \ | ||
# --from-file=application_default_credentials.json=$HOME/.config/gcloud/application_default_credentials.json | ||
volumes: | ||
- name: gcloud-credentials | ||
secret: | ||
secretName: gcloud-credentials | ||
initContainers: | ||
- name: ingest-data | ||
image: &image ghcr.io/elastic/elasticsearch-labs/chatbot-rag-app:latest | ||
imagePullPolicy: &imagePullPolicy IfNotPresent | ||
args: ["flask", "create-index"] | ||
env: | ||
- name: FLASK_APP | ||
value: api/app.py | ||
# The below will recreate your configmap based on the .env file | ||
# kubectl create configmap chatbot-rag-app-env --from-env-file=.env | ||
envFrom: &envFrom | ||
- configMapRef: | ||
name: chatbot-rag-app-env | ||
volumeMounts: &volumeMounts | ||
- name: gcloud-credentials | ||
mountPath: /root/.config/application_default_credentials.json | ||
readOnly: true | ||
containers: | ||
- name: api-frontend | ||
image: *image | ||
imagePullPolicy: *imagePullPolicy | ||
ports: | ||
- containerPort: 4000 | ||
envFrom: *envFrom | ||
volumeMounts: *volumeMounts | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: api | ||
spec: | ||
selector: | ||
app: chatbot-rag-app | ||
ports: | ||
- protocol: TCP | ||
port: 4000 | ||
targetPort: 4000 |