Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8s GPT: Multiple providers support #4817

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 39 additions & 4 deletions gitops/argocd/charts/ai/k8sgpt/templates/k8sgpt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,51 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
ai:
enabled: false
model: gpt-3.5-turbo
enabled: true
# LocalAI
{{- if .Values.ai.providers.localai.enabled }}
backend: localai
model: {{ .Values.ai.providers.localai.model }}
baseUrl: {{ .Values.ai.providers.localai.baseUrl }}
{{- end }}
# OpenAI
{{- if .Values.ai.providers.openai.enabled }}
backend: openai
model: {{ .Values.ai.providers.openai.model }}
secret:
name: k8sgpt-credentials
name: k8sgpt-ai-credentials
key: openai-api-key
{{- end }}
# Azure OpenAI
{{- if .Values.ai.providers.azure_openai.enabled }}
backend: azureopenai
model: {{ .Values.ai.providers.azure_openai.model }}
baseUrl: {{ .Values.ai.providers.azure_openai.baseUrl }}
engine: llm
secret:
name: k8sgpt-ai-credentials
key: azure-api-key
{{- end }}
# AWS Bedrock
{{- if .Values.ai.providers.aws_bedrock.enabled }}
backend:
{{- end }}
# Google Gemini
{{- if .Values.ai.providers.google_gemini.enabled }}
backend:
{{- end }}
# anonymized: false
# language: english
noCache: false
version: v0.3.8
noCache: {{ not .Values.ai.cache.enabled }}
{{- if .Values.ai.cache.enabled }}
remoteCache:
credentials:
name: k8sgpt-cloudflare-credentials
s3:
bucketName: {{ .Values.ai.cache.s3.bucketName }}
region: eu-west-1
{{- end }}
# filters:
# - Ingress
# sink:
Expand Down
67 changes: 65 additions & 2 deletions gitops/argocd/charts/ai/k8sgpt/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,82 @@ metadata:
labels:
{{- include "chart.labels" (index .Subcharts "k8sgpt-operator") | nindent 4 }}
app: k8sgpt
name: k8sgpt-credentials
name: k8sgpt-ai-credentials
namespace: {{ .Release.Namespace }}
spec:
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: akeyless
target:
name: k8sgpt-credentials
name: k8sgpt-ai-credentials
creationPolicy: Owner
data:
# OpenAI
{{- if .Values.ai.providers.openai.enabled }}
- secretKey: openai-api-key
remoteRef:
conversionStrategy: Default
decodingStrategy: None
key: K8SGPT_OPENAI
{{- end }}
# Azure OpenAI
{{- if .Values.ai.providers.azure_openai.enabled }}
- secretKey: azure-api-key
remoteRef:
conversionStrategy: Default
decodingStrategy: None
key: K8SGPT_AZURE_OPENAI_APIKEY
- secretKey: AZURE_OPENAI_ENDPOINT
remoteRef:
key: K8SGPT_AZURE_OPENAI_ENDPOINT
{{- end }}
# AWS Bedrock
{{- if .Values.ai.providers.aws_bedrock.enabled }}
- secretKey: AWS_ACCESS_KEY
remoteRef:
key: K8SGPT_AWS_ACCESS_KEY
- secretKey: AWS_SECRET_ACCESS_KEY
remoteRef:
key: K8SGPT_AWS_SECRET_ACCESS_KEY
- secretKey: AWS_DEFAULT_REGION
remoteRef:
key: K8SGPT_AWS_DEFAULT_REGION
{{- end }}
# Google Gemini
{{- if .Values.ai.providers.google_gemini.enabled }}
- secretKey: GEMINI_API_KEY
remoteRef:
key: K8SGPT_GEMINI_API_KEY
{{- end }}
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
{{- if .Values.additionalAnnotations }}
annotations:
{{ toYaml .Values.additionalAnnotations | indent 4 }}
{{- end }}
labels:
{{- include "chart.labels" (index .Subcharts "k8sgpt-operator") | nindent 4 }}
app: k8sgpt
name: k8sgpt-cloudflare-credentials
namespace: {{ .Release.Namespace }}
spec:
refreshInterval: "1h"
secretStoreRef:
kind: ClusterSecretStore
name: akeyless
target:
name: k8sgpt-cloudflare-credentials
creationPolicy: Owner
data:
- secretKey: AWS_ACCESS_KEY_ID
remoteRef:
key: AWS_ACCESS_KEY_ID
- secretKey: AWS_SECRET_ACCESS_KEY
remoteRef:
key: AWS_SECRET_ACCESS_KEY
- secretKey: AWS_S3_ENDPOINT
remoteRef:
key: AWS_S3_ENDPOINT
22 changes: 22 additions & 0 deletions gitops/argocd/charts/ai/k8sgpt/values-k3s-homelab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@
#
# SPDX-License-Identifier: Apache-2.0

ai:
providers:
localai:
enabled: true
model: llama-2-7b-chat.ggmlv3.q4_0.bin # gpt-3.5-turbo
baseUrl: http://localai.ai.svc.cluster.local:8080/v1
openai:
enabled: false
model: gpt-3.5-turbo
azure_openai:
enabled: false
model: gpt-35-turbo
baseUrl: https://k8sgpt.openai.azure.com/
aws_bedrock:
enabled: false
google_gemini:
enabled: false
cache:
enabled: true
s3:
bucketName: portefaix-homelab-k8sgpt-cache

k8sgpt-operator:
controllerManager:
resources:
Expand Down
17 changes: 17 additions & 0 deletions gitops/argocd/charts/ai/k8sgpt/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@
#
# SPDX-License-Identifier: Apache-2.0

ai:
providers:
noopai:
enabled: true
localai:
enabled: false
openai:
enabled: false
azure_openai:
enabled: false
aws_bedrock:
enabled: false
google_gemini:
enabled: false
cache:
enabled: false

k8sgpt:
name: core

Expand Down
Loading