CloudNativeGame / aigc-gateway

A user gateway that provides serverless AIGC experience.
Apache License 2.0
41 stars 8 forks source link

增加配置选项,在dashboard界面筛选集群中的gss #26

Closed keisni closed 7 months ago

keisni commented 7 months ago

目的是使与ai无关的gss不在dashboard展示 可以配置所在namespace以及筛选标签

chrisliu1995 commented 7 months ago

Design

新增configmap配置文件,挂载在aigc-gateway上。可供用户设置自定义配置。

configmap如下:

apiVersion: v1
kind: ConfigMap
metadata:
  name: aigc-gateway-config
  namespace: {{ .Values.installation.namespace }}
data:
  config.json: |
    {
      "namespace": "",
      "gss_labels": {
        "": ""
      }
    }

则对应aigc-gateway deployment yaml为:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: aigc-gateway
  namespace: {{ .Values.installation.namespace }}
  labels:
    app: aigc-gateway
spec:
  replicas: 1
  selector:
    matchLabels:
      app: aigc-gateway
  template:
    metadata:
      labels:
        app: aigc-gateway
    spec:
      containers:
        - name: aigc-gateway
          image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
          command:
            - "./aigc-gateway"
          env:
            - name: App_Id
              value: {{ .Values.appId }}
            - name: App_Secret
              value: {{ .Values.appSecret }}
            - name: M2M_Id
              value: {{ .Values.m2mId }}
            - name: M2M_Secret
              value: {{ .Values.m2mSecret }}
            - name: Redirect_Url
              value: https://{{ .Values.host }}/
            - name: Endpoint
              value: {{ .Values.endpoint }}
          ports:
            - containerPort: 8090
              name: dashboard
          volumeMounts:
            - name: config-volume
              mountPath: "/etc/config"  # 挂载点路径
              readOnly: true
      volumes:
        - name: config-volume
          configMap:
            name: aigc-gateway-config
            items:
              - key: config.json
                path: "config.json"  # 映射为容器内的文件名
      serviceAccountName: aigc-gateway
chrisliu1995 commented 7 months ago

related to https://github.com/CloudNativeGame/aigc-gateway/pull/29