diff --git a/deploy/charts/arcadia/Chart.yaml b/deploy/charts/arcadia/Chart.yaml index aa278aae7..b14b51838 100644 --- a/deploy/charts/arcadia/Chart.yaml +++ b/deploy/charts/arcadia/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: arcadia description: A Helm chart(Also a KubeBB Component) for KubeAGI Arcadia type: application -version: 0.3.2 +version: 0.3.3 appVersion: "0.2.0" keywords: diff --git a/deploy/charts/arcadia/README.md b/deploy/charts/arcadia/README.md index a23a9c61b..af4ee551b 100644 --- a/deploy/charts/arcadia/README.md +++ b/deploy/charts/arcadia/README.md @@ -55,19 +55,30 @@ graphql and bff server | `oidc.issuerURL` | URL of issuer portal | `https://portal..nip.io/oidc` | | `oidc.masterURL` | URL of master | `https://k8s..nip.io` | -### portal +### opsconsole -portal for arcadia web console +portal for arcadia operation console | Parameter | Description | Default | | --------------- | --------------------------------- | ------------------------------------------- | | `enabled` | enable arcadia web portal console | `true` | | `kubebbEnabled` | enable kubebb platform | `true` | | `image` | image of web console pod | `kubeagi/ops-console:latest` | -| `port` | port of web console | `80` | | `ingress.path` | ingress path of portal | `kubeagi-portal-public` | | `ingress.host` | host of ingress path | `portal..nip.io` | +### agentportal + +portal for arcadia gpt service + +| Parameter | Description | Default | +| --------------- | --------------------------------- | ------------------------------------------- | +| `enabled` | enable arcadia agent portal | `true` | +| `kubebbEnabled` | enable kubebb platform | `true` | +| `image` | image of web console pod | `kubeagi/agent-portal:latest` | +| `ingress.path` | ingress path of portal | `` | +| `ingress.host` | host of ingress path | `gpts..nip.io` | + ### fastchat fastchat is used as LLM serve platform for arcadia diff --git a/deploy/charts/arcadia/templates/agent-portal.yaml b/deploy/charts/arcadia/templates/agent-portal.yaml new file mode 100644 index 000000000..d9221aab0 --- /dev/null +++ b/deploy/charts/arcadia/templates/agent-portal.yaml @@ -0,0 +1,126 @@ +{{- if .Values.agentportal.enabled }} +apiVersion: v1 +data: + .env.production: | + # oidc server client id && secret + CLIENT_ID={{ .Values.apiserver.oidc.clientID }} + CLIENT_SECRET={{ .Values.apiserver.oidc.clientSecret }} + # oidc server url, e.g. https://kubeagi.com/oidc + OIDC_SERVER_URL={{ .Values.apiserver.oidc.issuerURL }} + # bff-server origin, for SSR + BFF_SERVER_ORIGIN=http://localhost:3000 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-agentportal + namespace: {{ .Release.Namespace }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ .Release.Name }}-agentportal + name: {{ .Release.Name }}-agentportal + namespace: {{ .Release.Namespace }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-agentportal + template: + metadata: + labels: + app: {{ .Release.Name }}-agentportal + spec: + containers: + - image: {{ .Values.agentportal.image }} + imagePullPolicy: IfNotPresent + name: agentportal + env: + - name: NODE_TLS_REJECT_UNAUTHORIZED + value: '0' + ports: + - containerPort: 80 + protocol: TCP + resources: + limits: + cpu: "5" + memory: 1280Mi + requests: + cpu: 50m + memory: 512Mi + volumeMounts: + - mountPath: /etc/localtime + name: time-localtime + readOnly: true + - mountPath: /usr/src/app/.env.production + name: agentportal-config-volume + subPath: .env.production + restartPolicy: Always + volumes: + - hostPath: + path: /etc/localtime + type: "" + name: time-localtime + - configMap: + name: {{ .Release.Name }}-agentportal + name: agentportal-config-volume +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: {{ .Release.Name }}-agentportal + name: {{ .Release.Name }}-agentportal + namespace: {{ .Release.Namespace }} +spec: + internalTrafficPolicy: Cluster + ports: + - name: http + port: 3000 + protocol: TCP + targetPort: 3000 + selector: + app: {{ .Release.Name }}-agentportal + type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + description: {{ .Release.Name }}-agentportal-ingress + displayName: {{ .Release.Name }}-agentportal-ingress + httpSend: / + ingress-lb: portal-ingress + kubernetes.io/ingress.class: portal-ingress + nginx.ingress.kubernetes.io/configuration-snippet: | + proxy_cache static-cache; + proxy_cache_valid 404 10m; + proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504; + proxy_cache_bypass $http_x_purge; + add_header X-Cache-Status $upstream_cache_status; # check X-Cache-Status to see if it's HIT + nginx.ingress.kubernetes.io/enable-access-log: "false" + nginx.ingress.kubernetes.io/enable-rewrite-log: "false" + nginx.ingress.kubernetes.io/load-balance: round_robin + nginx.ingress.kubernetes.io/proxy-body-size: 102400m + nginx.ingress.kubernetes.io/proxy-buffering: "on" + nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" + nginx.ingress.kubernetes.io/server-alias: "" + nginx.ingress.kubernetes.io/ssl-redirect: "true" + nginx.ingress.kubernetes.io/upstream-vhost: $host + labels: + ingress-lb: portal-ingress + name: {{ .Release.Name }}-agentportal-ingress + namespace: {{ .Release.Namespace }} +spec: + rules: + - host: {{ .Values.agentportal.ingress.host }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-agentportal + port: + number: 3000 + path: "/{{ .Values.opsconsole.ingress.path }}" + pathType: ImplementationSpecific +{{- end }} diff --git a/deploy/charts/arcadia/templates/kubebb-portal.yaml b/deploy/charts/arcadia/templates/kubebb-portal.yaml deleted file mode 100644 index a8376047b..000000000 --- a/deploy/charts/arcadia/templates/kubebb-portal.yaml +++ /dev/null @@ -1,9 +0,0 @@ -{{- if and (.Values.portal.enabled) (.Values.portal.kubebbEnabled) }} -apiVersion: core.kubebb.k8s.com.cn/v1alpha1 -kind: Portal -metadata: - name: kubeagi-portal -spec: - entry: /kubeagi-portal-public/index.html - path: /kubeagi-portal -{{- end }} diff --git a/deploy/charts/arcadia/templates/kubebb-menus.yaml b/deploy/charts/arcadia/templates/ops-console-menus.yaml similarity index 97% rename from deploy/charts/arcadia/templates/kubebb-menus.yaml rename to deploy/charts/arcadia/templates/ops-console-menus.yaml index 1b789b1e9..71d367bb9 100644 --- a/deploy/charts/arcadia/templates/kubebb-menus.yaml +++ b/deploy/charts/arcadia/templates/ops-console-menus.yaml @@ -1,8 +1,16 @@ -{{- if and (.Values.portal.enabled) (.Values.portal.kubebbEnabled) }} +{{- if and (.Values.opsconsole.enabled) (.Values.opsconsole.kubebbEnabled) }} +apiVersion: core.kubebb.k8s.com.cn/v1alpha1 +kind: Portal +metadata: + name: kubeagi-portal +spec: + entry: /kubeagi-portal-public/index.html + path: /kubeagi-portal + +--- apiVersion: core.kubebb.k8s.com.cn/v1alpha1 kind: Menu metadata: - creationTimestamp: null labels: portal: kubeagi-portal name: yunti-kubeagi-portal-model-app @@ -319,5 +327,4 @@ spec: textEn: LLMOps status: {} ---- {{- end }} \ No newline at end of file diff --git a/deploy/charts/arcadia/templates/ingress-portal.yaml b/deploy/charts/arcadia/templates/ops-console.yaml similarity index 55% rename from deploy/charts/arcadia/templates/ingress-portal.yaml rename to deploy/charts/arcadia/templates/ops-console.yaml index 287914f1d..09b44aa56 100644 --- a/deploy/charts/arcadia/templates/ingress-portal.yaml +++ b/deploy/charts/arcadia/templates/ops-console.yaml @@ -1,4 +1,49 @@ -{{- if .Values.portal.enabled }} +{{- if .Values.opsconsole.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-portal + namespace: {{ .Release.Namespace }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-portal + template: + metadata: + labels: + app: {{ .Release.Name }}-portal + spec: + containers: + - image: {{ .Values.opsconsole.image }} + imagePullPolicy: IfNotPresent + name: kubeagi-portal + ports: + - containerPort: 80 + protocol: TCP + resources: + limits: + cpu: "1" + memory: 1024Mi + requests: + cpu: 100m + memory: 512Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-portal + namespace: {{ .Release.Namespace }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }}-portal + ports: + - name: api + port: 80 + protocol: TCP + targetPort: 80 +--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -27,14 +72,15 @@ metadata: nginx.ingress.kubernetes.io/upstream-vhost: $host spec: rules: - - host: {{ .Values.portal.ingress.host }} + - host: {{ .Values.opsconsole.ingress.host }} http: paths: - pathType: ImplementationSpecific - path: "/{{ .Values.portal.ingress.path }}" + path: "/{{ .Values.opsconsole.ingress.path }}" backend: service: name: {{ .Release.Name }}-portal port: - number: {{ .Values.portal.port }} + number: 80 {{- end }} + diff --git a/deploy/charts/arcadia/templates/portal.yaml b/deploy/charts/arcadia/templates/portal.yaml deleted file mode 100644 index 317bdf54f..000000000 --- a/deploy/charts/arcadia/templates/portal.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{{- if .Values.portal.enabled }} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Release.Name }}-portal - namespace: {{ .Release.Namespace }} -spec: - replicas: 1 - selector: - matchLabels: - app: {{ .Release.Name }}-portal - template: - metadata: - labels: - app: {{ .Release.Name }}-portal - spec: - containers: - - image: {{ .Values.portal.image }} - imagePullPolicy: IfNotPresent - name: kubeagi-portal - ports: - - containerPort: 80 - protocol: TCP - resources: - limits: - cpu: "1" - memory: 1024Mi - requests: - cpu: 100m - memory: 512Mi ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }}-portal - namespace: {{ .Release.Namespace }} -spec: - type: ClusterIP - selector: - app: {{ .Release.Name }}-portal - ports: - - name: api - port: {{ .Values.portal.port }} - protocol: TCP - targetPort: {{ .Values.portal.port }} -{{- end }} \ No newline at end of file diff --git a/deploy/charts/arcadia/values.yaml b/deploy/charts/arcadia/values.yaml index 117cbe4b4..06e71dd96 100644 --- a/deploy/charts/arcadia/values.yaml +++ b/deploy/charts/arcadia/values.yaml @@ -41,15 +41,23 @@ apiserver: issuerURL: https://portal..nip.io/oidc masterURL: https://k8s..nip.io -# @section portal for arcadia web console -portal: +# @section portal for arcadia operation console +opsconsole: enabled: true kubebbEnabled: true image: kubeagi/ops-console:latest - port: 80 ingress: path: kubeagi-portal-public host: portal..nip.io + +# @section portal for arcadia GPT store +agentportal: + enabled: true + kubebbEnabled: true + image: kubeagi/agent-portal:latest + ingress: + path: "" + host: gpts..nip.io # @section fastchat is used as fastchat configurations for arcadia fastchat: diff --git a/tests/deploy-values.yaml b/tests/deploy-values.yaml index 27c1fb32a..11300f841 100644 --- a/tests/deploy-values.yaml +++ b/tests/deploy-values.yaml @@ -32,16 +32,24 @@ apiserver: clientSecret: 61324af0-1234-4f61-b110-ef57013267d6 masterURL: https://k8s.test.nip.io -# @section portal for arcadia web console -portal: +# @section portal for arcadia operation console +opsconsole: enabled: true kubebbEnabled: false image: kubeagi/ops-console:latest - port: 80 ingress: path: kubeagi-portal-public host: portal.test.nip.io +# @section portal for arcadia gpts +agentportal: + enabled: true + kubebbEnabled: false + image: kubeagi/agent-portal:latest + ingress: + path: "" + host: gpts.test.nip.io + # @section fastchat is used as fastchat configurations for arcadia fastchat: image: