Skip to content

Commit

Permalink
chore(chatgpt-retrieval-plugin): update chart version from 0.0.4 to 0…
Browse files Browse the repository at this point in the history
….0.5

feat(chatgpt-retrieval-plugin): add support for custom ai-plugin.json and openapi.yaml files by adding config options to values.yaml and creating corresponding configMaps and volume mounts in web deployment template
  • Loading branch information
masterkain committed May 30, 2023
1 parent f75569f commit 2c2f1c0
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/chatgpt-retrieval-plugin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: chatgpt-retrieval-plugin
description: ChatGPT Retrieval Plugin Helm chart for Kubernetes
type: application
version: 0.0.4
version: 0.0.5
appVersion: "0.0.1"
keywords:
- docker
Expand Down
16 changes: 16 additions & 0 deletions charts/chatgpt-retrieval-plugin/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ The following table lists the configurable parameters of the ChatGPT Retrieval P
| `web.readinessProbe.enabled` | Enables the readiness probe | `false` |
| `web.resources` | Resource limits and requests for the web application | `{}` |
| `web.extraEnvs` | Additional environment variables for the web application | `[]` |
| `web.config.aiPluginJson` | Content of ai-plugin.json file | `""` |
| `web.config.openApiYaml` | Content of openapi.yaml file | `""` |

To customize the configuration, you can provide your own values by creating a `values.yaml` file and overriding the desired parameters.

Here's an example `values.yaml` file with the `web.config` options:

```yaml
web:
config:
aiPluginJson: |
# Content of ai-plugin.json file goes here
openApiYaml: |
# Content of openapi.yaml file goes here
```
## Example using Flux
Expand Down
7 changes: 6 additions & 1 deletion charts/chatgpt-retrieval-plugin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Shorthand for component names
{{- define "app.web.port" -}}
{{- .Values.web.service.port -}}
{{- end -}}
{{- define "app.configmap.openapi.name" -}}
{{- include "app.fullname" . -}}-openapi
{{- end -}}
{{- define "app.configmap.ai-plugin.name" -}}
{{- include "app.fullname" . -}}-ai-plugin
{{- end -}}

{{/*
Common labels
Expand Down Expand Up @@ -83,7 +89,6 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}


{{/*
Return the target Kubernetes version
*/}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "app.configmap.ai-plugin.name" . }}
data:
ai-plugin.json: |
{{ .Values.web.config.aiPluginJson | quote }}
7 changes: 7 additions & 0 deletions charts/chatgpt-retrieval-plugin/templates/openapi-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "app.configmap.openapi.name" . }}
data:
openapi.yaml: |
{{ .Values.web.config.openapiYaml | quote }}
12 changes: 12 additions & 0 deletions charts/chatgpt-retrieval-plugin/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ spec:
- name: http
containerPort: {{ .Values.web.service.port }}
protocol: TCP
volumeMounts:
- name: ai-plugin-config
mountPath: /code/.well-known/ai-plugin.json
- name: openapi-config
mountPath: /code/.well-known/openapi.yaml
{{- if .Values.web.livenessProbe.enabled }}
livenessProbe:
httpGet:
Expand Down Expand Up @@ -81,3 +86,10 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: ai-plugin-config
configMap:
name: ai-plugin-configmap
- name: openapi-config
configMap:
name: openapi-configmap
7 changes: 7 additions & 0 deletions charts/chatgpt-retrieval-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ web:
terminationGracePeriodSeconds: 0
replicaCount: 1

config:
aiPluginJson: |
# Content of ai-plugin.json file goes here
openApiYaml: |
# Content of openapi.yaml file goes here
updateStrategy:
type: RollingUpdate
rollingUpdate:
Expand Down

0 comments on commit 2c2f1c0

Please sign in to comment.