diff --git a/helm-charts/chatqna/README.md b/helm-charts/chatqna/README.md index 558a2362d..16d090df0 100644 --- a/helm-charts/chatqna/README.md +++ b/helm-charts/chatqna/README.md @@ -60,14 +60,14 @@ curl http://localhost:8888/v1/chatqna \ ### Verify the workload through UI -The UI has already been installed via the Helm chart. To access it, use the external IP of your Kubernetes cluster along with the NGINX port. You can find the NGINX port using the following command: +The UI has already been installed via the Helm chart. To access it, use the external IP of one your Kubernetes node along with the NGINX port. You can find the NGINX port using the following command: ```bash export port=$(kubectl get service chatqna-nginx --output='jsonpath={.spec.ports[0].nodePort}') echo $port ``` -Open a browser to access `http://:${port}` to play with the ChatQnA workload. +Open a browser to access `http://:${port}` to play with the ChatQnA workload. ## Values diff --git a/helm-charts/chatqna/templates/deployment.yaml b/helm-charts/chatqna/templates/deployment.yaml index caac42a11..84b51b96d 100644 --- a/helm-charts/chatqna/templates/deployment.yaml +++ b/helm-charts/chatqna/templates/deployment.yaml @@ -7,11 +7,13 @@ metadata: name: {{ include "chatqna.fullname" . }} labels: {{- include "chatqna.labels" . | nindent 4 }} + app: {{ include "chatqna.fullname" . }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "chatqna.selectorLabels" . | nindent 6 }} + app: {{ include "chatqna.fullname" . }} template: metadata: {{- with .Values.podAnnotations }} @@ -20,6 +22,7 @@ spec: {{- end }} labels: {{- include "chatqna.selectorLabels" . | nindent 8 }} + app: {{ include "chatqna.fullname" . }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -51,22 +54,6 @@ spec: - name: chatqna containerPort: {{ .Values.port }} protocol: TCP - # startupProbe: - # httpGet: - # host: {{ .Release.Name }}-llm-uservice - # port: {{ index .Values "llm-uservice" "service" "port" }} - # path: / - # initialDelaySeconds: 5 - # periodSeconds: 5 - # failureThreshold: 120 - # livenessProbe: - # httpGet: - # path: / - # port: {{ .Values.port }} - # readinessProbe: - # httpGet: - # path: / - # port: {{ .Values.port }} resources: {{- toYaml .Values.resources | nindent 12 }} volumes: @@ -92,4 +79,5 @@ spec: labelSelector: matchLabels: {{- include "chatqna.selectorLabels" . | nindent 14 }} + app: {{ include "chatqna.fullname" . }} {{- end }} diff --git a/helm-charts/chatqna/templates/nginx-deployment.yaml b/helm-charts/chatqna/templates/nginx-deployment.yaml index 9e9d6502f..3e1552745 100644 --- a/helm-charts/chatqna/templates/nginx-deployment.yaml +++ b/helm-charts/chatqna/templates/nginx-deployment.yaml @@ -56,24 +56,29 @@ data: kind: ConfigMap metadata: - name: nginx-default-config + name: {{ include "chatqna.fullname" . }}-nginx-config --- apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chatqna.fullname" . }}-nginx + labels: + {{- include "chatqna.labels" . | nindent 4 }} + app: {{ include "chatqna.fullname" . }}-nginx spec: selector: matchLabels: + {{- include "chatqna.selectorLabels" . | nindent 6 }} app: {{ include "chatqna.fullname" . }}-nginx template: metadata: labels: + {{- include "chatqna.selectorLabels" . | nindent 8 }} app: {{ include "chatqna.fullname" . }}-nginx spec: containers: - image: nginx:1.27.1 - imagePullPolicy: IfNotPresent + imagePullPolicy: {{ .Values.image.pullPolicy }} name: nginx volumeMounts: - mountPath: /etc/nginx/conf.d @@ -82,8 +87,20 @@ spec: volumes: - configMap: defaultMode: 420 - name: nginx-default-config + name: {{ include "chatqna.fullname" . }}-nginx-config name: nginx-config-volume + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} --- apiVersion: v1 kind: Service @@ -95,5 +112,6 @@ spec: protocol: TCP targetPort: 80 selector: + {{- include "chatqna.selectorLabels" . | nindent 4 }} app: {{ include "chatqna.fullname" . }}-nginx type: NodePort diff --git a/helm-charts/chatqna/templates/service.yaml b/helm-charts/chatqna/templates/service.yaml index f1421d35a..83e46afc3 100644 --- a/helm-charts/chatqna/templates/service.yaml +++ b/helm-charts/chatqna/templates/service.yaml @@ -16,3 +16,4 @@ spec: name: chatqna selector: {{- include "chatqna.selectorLabels" . | nindent 4 }} + app: {{ include "chatqna.fullname" . }} diff --git a/helm-charts/codegen/Chart.yaml b/helm-charts/codegen/Chart.yaml index 27bb80f54..a8b533cc0 100644 --- a/helm-charts/codegen/Chart.yaml +++ b/helm-charts/codegen/Chart.yaml @@ -12,5 +12,9 @@ dependencies: - name: llm-uservice version: 1.0.0 repository: "file://../common/llm-uservice" + - name: chatqna-ui + version: 1.0.0 + repository: "file://../common/chatqna-ui" + alias: codegen-ui version: 1.0.0 appVersion: "v1.0" diff --git a/helm-charts/codegen/README.md b/helm-charts/codegen/README.md index aa00ac82f..71ffcac86 100644 --- a/helm-charts/codegen/README.md +++ b/helm-charts/codegen/README.md @@ -31,6 +31,10 @@ helm install codegen codegen --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} -- To verify the installation, run the command `kubectl get pod` to make sure all pods are running. +Curl command and UI are the two options that can be leveraged to verify the result. + +### Verify the workload through curl command + Then run the command `kubectl port-forward svc/codegen 7778:7778` to expose the service for access. Open another terminal and run the following command to verify the service if working: @@ -41,6 +45,17 @@ curl http://localhost:7778/v1/codegen \ -d '{"messages": "Implement a high-level API for a TODO list application. The API takes as input an operation request and updates the TODO list in place. If the request is invalid, raise an exception."}' ``` +### Verify the workload through UI + +The UI has already been installed via the Helm chart. To access it, use the external IP of one your Kubernetes node along with the NGINX port. You can find the NGINX port using the following command: + +```bash +export port=$(kubectl get service codegen-nginx --output='jsonpath={.spec.ports[0].nodePort}') +echo $port +``` + +Open a browser to access `http://:${port}` to play with the ChatQnA workload. + ## Values | Key | Type | Default | Description | diff --git a/helm-charts/codegen/templates/deployment.yaml b/helm-charts/codegen/templates/deployment.yaml index 62c35e660..952f63898 100644 --- a/helm-charts/codegen/templates/deployment.yaml +++ b/helm-charts/codegen/templates/deployment.yaml @@ -7,11 +7,13 @@ metadata: name: {{ include "codegen.fullname" . }} labels: {{- include "codegen.labels" . | nindent 4 }} + app: {{ include "codegen.fullname" . }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "codegen.selectorLabels" . | nindent 6 }} + app: {{ include "codegen.fullname" . }} template: metadata: {{- with .Values.podAnnotations }} @@ -20,6 +22,7 @@ spec: {{- end }} labels: {{- include "codegen.selectorLabels" . | nindent 8 }} + app: {{ include "codegen.fullname" . }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -45,22 +48,6 @@ spec: - name: codegen containerPort: {{ .Values.port }} protocol: TCP - # startupProbe: - # httpGet: - # host: {{ .Release.Name }}-llm-uservice - # port: {{ index .Values "llm-uservice" "service" "port" }} - # path: / - # initialDelaySeconds: 5 - # periodSeconds: 5 - # failureThreshold: 120 - # livenessProbe: - # httpGet: - # path: / - # port: {{ .Values.port }} - # readinessProbe: - # httpGet: - # path: / - # port: {{ .Values.port }} resources: {{- toYaml .Values.resources | nindent 12 }} volumes: @@ -86,4 +73,5 @@ spec: labelSelector: matchLabels: {{- include "codegen.selectorLabels" . | nindent 14 }} + app: {{ include "codegen.fullname" . }} {{- end }} diff --git a/helm-charts/codegen/templates/nginx-deployment.yaml b/helm-charts/codegen/templates/nginx-deployment.yaml new file mode 100644 index 000000000..e59010f1a --- /dev/null +++ b/helm-charts/codegen/templates/nginx-deployment.yaml @@ -0,0 +1,93 @@ +apiVersion: v1 +data: + default.conf: |+ + # Copyright (C) 2024 Intel Corporation + # SPDX-License-Identifier: Apache-2.0 + + + server { + listen 80; + listen [::]:80; + + location /home { + alias /usr/share/nginx/html/index.html; + } + + location / { + proxy_pass http://{{ include "ui.fullname" (index .Subcharts "codegen-ui") }}:{{ index .Values "codegen-ui" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/codegen { + proxy_pass http://{{ include "codegen.fullname" . }}:{{ .Values.service.port }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + +kind: ConfigMap +metadata: + name: {{ include "codegen.fullname" . }}-nginx-config +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "codegen.fullname" . }}-nginx + labels: + {{- include "codegen.labels" . | nindent 4 }} + app: {{ include "codegen.fullname" . }}-nginx +spec: + selector: + matchLabels: + {{- include "codegen.selectorLabels" . | nindent 6 }} + app: {{ include "codegen.fullname" . }}-nginx + template: + metadata: + labels: + {{- include "codegen.selectorLabels" . | nindent 8 }} + app: {{ include "codegen.fullname" . }}-nginx + spec: + containers: + - image: nginx:1.27.1 + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: nginx + volumeMounts: + - mountPath: /etc/nginx/conf.d + name: nginx-config-volume + securityContext: {} + volumes: + - configMap: + defaultMode: 420 + name: {{ include "codegen.fullname" . }}-nginx-config + name: nginx-config-volume + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "codegen.fullname" . }}-nginx +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + {{- include "codegen.selectorLabels" . | nindent 4 }} + app: {{ include "codegen.fullname" . }}-nginx + type: NodePort diff --git a/helm-charts/codegen/templates/service.yaml b/helm-charts/codegen/templates/service.yaml index aec13682f..104e00b95 100644 --- a/helm-charts/codegen/templates/service.yaml +++ b/helm-charts/codegen/templates/service.yaml @@ -16,3 +16,4 @@ spec: name: codegen selector: {{- include "codegen.selectorLabels" . | nindent 4 }} + app: {{ include "codegen.fullname" . }} diff --git a/helm-charts/codegen/values.yaml b/helm-charts/codegen/values.yaml index 2e69e2ece..b418194cd 100644 --- a/helm-charts/codegen/values.yaml +++ b/helm-charts/codegen/values.yaml @@ -39,6 +39,13 @@ affinity: {} tgi: LLM_MODEL_ID: meta-llama/CodeLlama-7b-hf +codegen-ui: + image: + repository: opea/codegen-ui + tag: "latest" + BACKEND_SERVICE_ENDPOINT: "/v1/codegen" + containerPort: 5173 + global: http_proxy: "" https_proxy: "" diff --git a/helm-charts/codetrans/Chart.yaml b/helm-charts/codetrans/Chart.yaml index 42228eb33..497849019 100644 --- a/helm-charts/codetrans/Chart.yaml +++ b/helm-charts/codetrans/Chart.yaml @@ -12,5 +12,9 @@ dependencies: - name: llm-uservice version: 1.0.0 repository: "file://../common/llm-uservice" + - name: chatqna-ui + version: 1.0.0 + repository: "file://../common/chatqna-ui" + alias: codetrans-ui version: 1.0.0 appVersion: "v1.0" diff --git a/helm-charts/codetrans/README.md b/helm-charts/codetrans/README.md index 0d61dc250..d1e64de15 100644 --- a/helm-charts/codetrans/README.md +++ b/helm-charts/codetrans/README.md @@ -24,6 +24,10 @@ helm install codetrans codetrans --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN To verify the installation, run the command `kubectl get pod` to make sure all pods are running. +Curl command and UI are the two options that can be leveraged to verify the result. + +### Verify the workload through curl command + Then run the command `kubectl port-forward svc/codetrans 7777:7777` to expose the CodeTrans service for access. Open another terminal and run the following command to verify the service if working: @@ -34,6 +38,17 @@ curl http://localhost:7777/v1/codetrans \ -d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' ``` +### Verify the workload through UI + +The UI has already been installed via the Helm chart. To access it, use the external IP of one your Kubernetes node along with the NGINX port. You can find the NGINX port using the following command: + +```bash +export port=$(kubectl get service codetrans-nginx --output='jsonpath={.spec.ports[0].nodePort}') +echo $port +``` + +Open a browser to access `http://:${port}` to play with the ChatQnA workload. + ## Values | Key | Type | Default | Description | diff --git a/helm-charts/codetrans/templates/deployment.yaml b/helm-charts/codetrans/templates/deployment.yaml index 14fc82539..eba2d75be 100644 --- a/helm-charts/codetrans/templates/deployment.yaml +++ b/helm-charts/codetrans/templates/deployment.yaml @@ -7,11 +7,13 @@ metadata: name: {{ include "codetrans.fullname" . }} labels: {{- include "codetrans.labels" . | nindent 4 }} + app: {{ include "codetrans.fullname" . }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "codetrans.selectorLabels" . | nindent 6 }} + app: {{ include "codetrans.fullname" . }} template: metadata: {{- with .Values.podAnnotations }} @@ -20,6 +22,7 @@ spec: {{- end }} labels: {{- include "codetrans.selectorLabels" . | nindent 8 }} + app: {{ include "codetrans.fullname" . }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -74,4 +77,5 @@ spec: labelSelector: matchLabels: {{- include "codetrans.selectorLabels" . | nindent 14 }} + app: {{ include "codetrans.fullname" . }} {{- end }} diff --git a/helm-charts/codetrans/templates/nginx-deployment.yaml b/helm-charts/codetrans/templates/nginx-deployment.yaml new file mode 100644 index 000000000..9553557b6 --- /dev/null +++ b/helm-charts/codetrans/templates/nginx-deployment.yaml @@ -0,0 +1,93 @@ +apiVersion: v1 +data: + default.conf: |+ + # Copyright (C) 2024 Intel Corporation + # SPDX-License-Identifier: Apache-2.0 + + + server { + listen 80; + listen [::]:80; + + location /home { + alias /usr/share/nginx/html/index.html; + } + + location / { + proxy_pass http://{{ include "ui.fullname" (index .Subcharts "codetrans-ui") }}:{{ index .Values "codetrans-ui" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/codetrans { + proxy_pass http://{{ include "codetrans.fullname" . }}:{{ .Values.service.port }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + +kind: ConfigMap +metadata: + name: {{ include "codetrans.fullname" . }}-nginx-config +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "codetrans.fullname" . }}-nginx + labels: + {{- include "codetrans.labels" . | nindent 4 }} + app: {{ include "codetrans.fullname" . }}-nginx +spec: + selector: + matchLabels: + {{- include "codetrans.selectorLabels" . | nindent 6 }} + app: {{ include "codetrans.fullname" . }}-nginx + template: + metadata: + labels: + {{- include "codetrans.selectorLabels" . | nindent 8 }} + app: {{ include "codetrans.fullname" . }}-nginx + spec: + containers: + - image: nginx:1.27.1 + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: nginx + volumeMounts: + - mountPath: /etc/nginx/conf.d + name: nginx-config-volume + securityContext: {} + volumes: + - configMap: + defaultMode: 420 + name: {{ include "codetrans.fullname" . }}-nginx-config + name: nginx-config-volume + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "codetrans.fullname" . }}-nginx +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + {{- include "codetrans.selectorLabels" . | nindent 4 }} + app: {{ include "codetrans.fullname" . }}-nginx + type: NodePort diff --git a/helm-charts/codetrans/templates/service.yaml b/helm-charts/codetrans/templates/service.yaml index bf3d1ecbe..2c63a5d1e 100644 --- a/helm-charts/codetrans/templates/service.yaml +++ b/helm-charts/codetrans/templates/service.yaml @@ -16,3 +16,4 @@ spec: name: codetrans selector: {{- include "codetrans.selectorLabels" . | nindent 4 }} + app: {{ include "codetrans.fullname" . }} diff --git a/helm-charts/codetrans/values.yaml b/helm-charts/codetrans/values.yaml index e06a05fb0..841530328 100644 --- a/helm-charts/codetrans/values.yaml +++ b/helm-charts/codetrans/values.yaml @@ -40,6 +40,13 @@ affinity: {} tgi: LLM_MODEL_ID: HuggingFaceH4/mistral-7b-grok +codetrans-ui: + image: + repository: opea/codetrans-ui + tag: "latest" + BACKEND_SERVICE_ENDPOINT: "/v1/codetrans" + containerPort: 5173 + global: http_proxy: "" https_proxy: "" diff --git a/helm-charts/common/chatqna-ui/templates/configmap.yaml b/helm-charts/common/chatqna-ui/templates/configmap.yaml index bd868131a..d6bfef1ae 100644 --- a/helm-charts/common/chatqna-ui/templates/configmap.yaml +++ b/helm-charts/common/chatqna-ui/templates/configmap.yaml @@ -14,3 +14,8 @@ data: UPLOAD_FILE_BASE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }} GET_FILE: {{ .Values.DATAPREP_GET_FILE_ENDPOINT | quote }} DELETE_FILE: {{ .Values.DATAPREP_DELETE_FILE_ENDPOINT | quote }} + BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + DOC_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + BASIC_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + VITE_CODE_GEN_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + VITE_DOC_SUM_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} diff --git a/helm-charts/docsum/Chart.yaml b/helm-charts/docsum/Chart.yaml index f61b0902c..596bdd79d 100644 --- a/helm-charts/docsum/Chart.yaml +++ b/helm-charts/docsum/Chart.yaml @@ -12,5 +12,9 @@ dependencies: - name: llm-uservice version: 1.0.0 repository: "file://../common/llm-uservice" + - name: chatqna-ui + version: 1.0.0 + repository: "file://../common/chatqna-ui" + alias: docsum-ui version: 1.0.0 appVersion: "v1.0" diff --git a/helm-charts/docsum/README.md b/helm-charts/docsum/README.md index 48e5b6e8f..27e729c91 100644 --- a/helm-charts/docsum/README.md +++ b/helm-charts/docsum/README.md @@ -24,6 +24,10 @@ helm install docsum docsum --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --se To verify the installation, run the command `kubectl get pod` to make sure all pods are running. +Curl command and UI are the two options that can be leveraged to verify the result. + +### Verify the workload through curl command + Then run the command `kubectl port-forward svc/docsum 8888:8888` to expose the DocSum service for access. Open another terminal and run the following command to verify the service if working: @@ -34,6 +38,17 @@ curl http://localhost:8888/v1/docsum \ -d '{"messages": "Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."}' ``` +### Verify the workload through UI + +The UI has already been installed via the Helm chart. To access it, use the external IP of one your Kubernetes node along with the NGINX port. You can find the NGINX port using the following command: + +```bash +export port=$(kubectl get service docsum-nginx --output='jsonpath={.spec.ports[0].nodePort}') +echo $port +``` + +Open a browser to access `http://:${port}` to play with the ChatQnA workload. + ## Values | Key | Type | Default | Description | diff --git a/helm-charts/docsum/templates/deployment.yaml b/helm-charts/docsum/templates/deployment.yaml index a14cd7d9e..73068b74b 100644 --- a/helm-charts/docsum/templates/deployment.yaml +++ b/helm-charts/docsum/templates/deployment.yaml @@ -7,11 +7,13 @@ metadata: name: {{ include "docsum.fullname" . }} labels: {{- include "docsum.labels" . | nindent 4 }} + app: {{ include "docsum.fullname" . }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "docsum.selectorLabels" . | nindent 6 }} + app: {{ include "docsum.fullname" . }} template: metadata: {{- with .Values.podAnnotations }} @@ -20,6 +22,7 @@ spec: {{- end }} labels: {{- include "docsum.selectorLabels" . | nindent 8 }} + app: {{ include "docsum.fullname" . }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -74,4 +77,5 @@ spec: labelSelector: matchLabels: {{- include "docsum.selectorLabels" . | nindent 14 }} + app: {{ include "docsum.fullname" . }} {{- end }} diff --git a/helm-charts/docsum/templates/nginx-deployment.yaml b/helm-charts/docsum/templates/nginx-deployment.yaml new file mode 100644 index 000000000..47171a01c --- /dev/null +++ b/helm-charts/docsum/templates/nginx-deployment.yaml @@ -0,0 +1,93 @@ +apiVersion: v1 +data: + default.conf: |+ + # Copyright (C) 2024 Intel Corporation + # SPDX-License-Identifier: Apache-2.0 + + + server { + listen 80; + listen [::]:80; + + location /home { + alias /usr/share/nginx/html/index.html; + } + + location / { + proxy_pass http://{{ include "ui.fullname" (index .Subcharts "docsum-ui") }}:{{ index .Values "docsum-ui" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/docsum { + proxy_pass http://{{ include "docsum.fullname" . }}:{{ .Values.service.port }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + +kind: ConfigMap +metadata: + name: {{ include "docsum.fullname" . }}-nginx-config +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "docsum.fullname" . }}-nginx + labels: + {{- include "docsum.labels" . | nindent 4 }} + app: {{ include "docsum.fullname" . }}-nginx +spec: + selector: + matchLabels: + {{- include "docsum.selectorLabels" . | nindent 6 }} + app: {{ include "docsum.fullname" . }}-nginx + template: + metadata: + labels: + {{- include "docsum.selectorLabels" . | nindent 8 }} + app: {{ include "docsum.fullname" . }}-nginx + spec: + containers: + - image: nginx:1.27.1 + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: nginx + volumeMounts: + - mountPath: /etc/nginx/conf.d + name: nginx-config-volume + securityContext: {} + volumes: + - configMap: + defaultMode: 420 + name: {{ include "docsum.fullname" . }}-nginx-config + name: nginx-config-volume + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "docsum.fullname" . }}-nginx +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + {{- include "docsum.selectorLabels" . | nindent 4 }} + app: {{ include "docsum.fullname" . }}-nginx + type: NodePort diff --git a/helm-charts/docsum/templates/service.yaml b/helm-charts/docsum/templates/service.yaml index 21811733e..3fd3e6ba9 100644 --- a/helm-charts/docsum/templates/service.yaml +++ b/helm-charts/docsum/templates/service.yaml @@ -16,3 +16,4 @@ spec: name: docsum selector: {{- include "docsum.selectorLabels" . | nindent 4 }} + app: {{ include "docsum.fullname" . }} diff --git a/helm-charts/docsum/values.yaml b/helm-charts/docsum/values.yaml index 3ff0747b3..6e9e10e90 100644 --- a/helm-charts/docsum/values.yaml +++ b/helm-charts/docsum/values.yaml @@ -45,6 +45,13 @@ llm-uservice: tgi: LLM_MODEL_ID: Intel/neural-chat-7b-v3-3 +docsum-ui: + image: + repository: opea/docsum-ui + tag: "latest" + BACKEND_SERVICE_ENDPOINT: "/v1/docsum" + containerPort: 5173 + global: http_proxy: "" https_proxy: ""