Add Helm chart, Docs, and Config conversion script
Some checks failed
Build / Code Quality Checks (push) Successful in 15m11s
Build / Build & Push Docker Images (worker) (push) Successful in 13m44s
Build / Build & Push Docker Images (frontend) (push) Successful in 5m8s
Build / Build & Push Docker Images (chat) (push) Failing after 30m7s
Build / Build & Push Docker Images (api) (push) Failing after 21m39s
Some checks failed
Build / Code Quality Checks (push) Successful in 15m11s
Build / Build & Push Docker Images (worker) (push) Successful in 13m44s
Build / Build & Push Docker Images (frontend) (push) Successful in 5m8s
Build / Build & Push Docker Images (chat) (push) Failing after 30m7s
Build / Build & Push Docker Images (api) (push) Failing after 21m39s
This commit is contained in:
162
deploy/helm/datacenter-docs/templates/NOTES.txt
Normal file
162
deploy/helm/datacenter-docs/templates/NOTES.txt
Normal file
@@ -0,0 +1,162 @@
|
||||
█████████████████████████████████████████████████████████████████████████████
|
||||
█ █
|
||||
█ Datacenter Docs & Remediation Engine - Successfully Deployed! █
|
||||
█ █
|
||||
█████████████████████████████████████████████████████████████████████████████
|
||||
|
||||
Thank you for installing {{ .Chart.Name }}.
|
||||
|
||||
Your release is named {{ .Release.Name }}.
|
||||
Release namespace: {{ .Release.Namespace }}
|
||||
|
||||
==============================================================================
|
||||
📦 INSTALLED COMPONENTS:
|
||||
==============================================================================
|
||||
|
||||
{{- if .Values.mongodb.enabled }}
|
||||
✓ MongoDB (Database)
|
||||
{{- end }}
|
||||
{{- if .Values.redis.enabled }}
|
||||
✓ Redis (Cache & Task Queue)
|
||||
{{- end }}
|
||||
{{- if .Values.api.enabled }}
|
||||
✓ API Service
|
||||
{{- end }}
|
||||
{{- if .Values.chat.enabled }}
|
||||
✓ Chat Service (WebSocket)
|
||||
{{- end }}
|
||||
{{- if .Values.worker.enabled }}
|
||||
✓ Celery Worker (Background Tasks)
|
||||
{{- end }}
|
||||
{{- if .Values.frontend.enabled }}
|
||||
✓ Frontend (Web UI)
|
||||
{{- end }}
|
||||
|
||||
==============================================================================
|
||||
🔍 CHECK DEPLOYMENT STATUS:
|
||||
==============================================================================
|
||||
|
||||
kubectl get pods -n {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
|
||||
|
||||
kubectl get services -n {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
|
||||
|
||||
==============================================================================
|
||||
🌐 ACCESS YOUR APPLICATION:
|
||||
==============================================================================
|
||||
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{ if $.Values.ingress.tls }}https{{ else }}http{{ end }}://{{ $host.host }}
|
||||
{{- end }}
|
||||
{{- else if .Values.frontend.enabled }}
|
||||
|
||||
To access the frontend, run:
|
||||
|
||||
kubectl port-forward -n {{ .Release.Namespace }} svc/{{ include "datacenter-docs.frontend.fullname" . }} 8080:{{ .Values.frontend.service.port }}
|
||||
|
||||
Then visit: http://localhost:8080
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.api.enabled }}
|
||||
|
||||
To access the API directly, run:
|
||||
|
||||
kubectl port-forward -n {{ .Release.Namespace }} svc/{{ include "datacenter-docs.api.fullname" . }} 8000:{{ .Values.api.service.port }}
|
||||
|
||||
Then visit: http://localhost:8000/api/docs (OpenAPI documentation)
|
||||
{{- end }}
|
||||
|
||||
==============================================================================
|
||||
📊 VIEW LOGS:
|
||||
==============================================================================
|
||||
|
||||
API logs:
|
||||
kubectl logs -n {{ .Release.Namespace }} -l app.kubernetes.io/component=api -f
|
||||
|
||||
{{- if .Values.worker.enabled }}
|
||||
Worker logs:
|
||||
kubectl logs -n {{ .Release.Namespace }} -l app.kubernetes.io/component=worker -f
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.chat.enabled }}
|
||||
Chat logs:
|
||||
kubectl logs -n {{ .Release.Namespace }} -l app.kubernetes.io/component=chat -f
|
||||
{{- end }}
|
||||
|
||||
==============================================================================
|
||||
🔐 SECURITY NOTICE:
|
||||
==============================================================================
|
||||
|
||||
{{ if eq .Values.secrets.llmApiKey "sk-your-openai-api-key-here" }}
|
||||
⚠️ WARNING: You are using the default LLM API key!
|
||||
Update this immediately in production:
|
||||
|
||||
helm upgrade {{ .Release.Name }} datacenter-docs \
|
||||
--set secrets.llmApiKey="your-actual-api-key" \
|
||||
--reuse-values
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Values.secrets.apiSecretKey "your-secret-key-here-change-in-production" }}
|
||||
⚠️ WARNING: You are using the default API secret key!
|
||||
Update this immediately in production:
|
||||
|
||||
helm upgrade {{ .Release.Name }} datacenter-docs \
|
||||
--set secrets.apiSecretKey="your-actual-secret-key" \
|
||||
--reuse-values
|
||||
{{ end }}
|
||||
|
||||
For production deployments:
|
||||
- Use strong, unique secrets
|
||||
- Enable TLS/SSL for all services
|
||||
- Review security context and RBAC policies
|
||||
- Consider using external secret management (e.g., HashiCorp Vault)
|
||||
|
||||
==============================================================================
|
||||
📖 USEFUL COMMANDS:
|
||||
==============================================================================
|
||||
|
||||
Upgrade release:
|
||||
helm upgrade {{ .Release.Name }} datacenter-docs --values custom-values.yaml
|
||||
|
||||
Get values:
|
||||
helm get values {{ .Release.Name }}
|
||||
|
||||
View all resources:
|
||||
helm get manifest {{ .Release.Name }}
|
||||
|
||||
Uninstall:
|
||||
helm uninstall {{ .Release.Name }}
|
||||
|
||||
==============================================================================
|
||||
🛠️ CONFIGURATION:
|
||||
==============================================================================
|
||||
|
||||
{{- if .Values.config.autoRemediation.enabled }}
|
||||
✓ Auto-remediation: ENABLED
|
||||
- Minimum reliability score: {{ .Values.config.autoRemediation.minReliabilityScore }}%
|
||||
- Approval threshold: {{ .Values.config.autoRemediation.requireApprovalThreshold }}%
|
||||
{{- if .Values.config.autoRemediation.dryRun }}
|
||||
- Mode: DRY RUN (no actual changes will be made)
|
||||
{{- else }}
|
||||
- Mode: ACTIVE (changes will be applied)
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
⚠️ Auto-remediation: DISABLED
|
||||
{{- end }}
|
||||
|
||||
LLM Provider: {{ .Values.config.llm.baseUrl }}
|
||||
Model: {{ .Values.config.llm.model }}
|
||||
|
||||
==============================================================================
|
||||
📚 DOCUMENTATION & SUPPORT:
|
||||
==============================================================================
|
||||
|
||||
For more information, visit:
|
||||
https://git.commandware.com/it-ops/llm-automation-docs-and-remediation-engine
|
||||
|
||||
Report issues:
|
||||
https://git.commandware.com/it-ops/llm-automation-docs-and-remediation-engine/issues
|
||||
|
||||
==============================================================================
|
||||
|
||||
Happy automating! 🚀
|
||||
235
deploy/helm/datacenter-docs/templates/_helpers.tpl
Normal file
235
deploy/helm/datacenter-docs/templates/_helpers.tpl
Normal file
@@ -0,0 +1,235 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "datacenter-docs.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
*/}}
|
||||
{{- define "datacenter-docs.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "datacenter-docs.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "datacenter-docs.labels" -}}
|
||||
helm.sh/chart: {{ include "datacenter-docs.chart" . }}
|
||||
{{ include "datacenter-docs.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "datacenter-docs.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "datacenter-docs.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "datacenter-docs.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "datacenter-docs.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
MongoDB fullname
|
||||
*/}}
|
||||
{{- define "datacenter-docs.mongodb.fullname" -}}
|
||||
{{- printf "%s-mongodb" (include "datacenter-docs.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis fullname
|
||||
*/}}
|
||||
{{- define "datacenter-docs.redis.fullname" -}}
|
||||
{{- printf "%s-redis" (include "datacenter-docs.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
API fullname
|
||||
*/}}
|
||||
{{- define "datacenter-docs.api.fullname" -}}
|
||||
{{- printf "%s-api" (include "datacenter-docs.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Chat fullname
|
||||
*/}}
|
||||
{{- define "datacenter-docs.chat.fullname" -}}
|
||||
{{- printf "%s-chat" (include "datacenter-docs.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Worker fullname
|
||||
*/}}
|
||||
{{- define "datacenter-docs.worker.fullname" -}}
|
||||
{{- printf "%s-worker" (include "datacenter-docs.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Frontend fullname
|
||||
*/}}
|
||||
{{- define "datacenter-docs.frontend.fullname" -}}
|
||||
{{- printf "%s-frontend" (include "datacenter-docs.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component labels for MongoDB
|
||||
*/}}
|
||||
{{- define "datacenter-docs.mongodb.labels" -}}
|
||||
{{ include "datacenter-docs.labels" . }}
|
||||
app.kubernetes.io/component: database
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component labels for Redis
|
||||
*/}}
|
||||
{{- define "datacenter-docs.redis.labels" -}}
|
||||
{{ include "datacenter-docs.labels" . }}
|
||||
app.kubernetes.io/component: cache
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component labels for API
|
||||
*/}}
|
||||
{{- define "datacenter-docs.api.labels" -}}
|
||||
{{ include "datacenter-docs.labels" . }}
|
||||
app.kubernetes.io/component: api
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component labels for Chat
|
||||
*/}}
|
||||
{{- define "datacenter-docs.chat.labels" -}}
|
||||
{{ include "datacenter-docs.labels" . }}
|
||||
app.kubernetes.io/component: chat
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component labels for Worker
|
||||
*/}}
|
||||
{{- define "datacenter-docs.worker.labels" -}}
|
||||
{{ include "datacenter-docs.labels" . }}
|
||||
app.kubernetes.io/component: worker
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component labels for Frontend
|
||||
*/}}
|
||||
{{- define "datacenter-docs.frontend.labels" -}}
|
||||
{{ include "datacenter-docs.labels" . }}
|
||||
app.kubernetes.io/component: frontend
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels for MongoDB
|
||||
*/}}
|
||||
{{- define "datacenter-docs.mongodb.selectorLabels" -}}
|
||||
{{ include "datacenter-docs.selectorLabels" . }}
|
||||
app.kubernetes.io/component: database
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels for Redis
|
||||
*/}}
|
||||
{{- define "datacenter-docs.redis.selectorLabels" -}}
|
||||
{{ include "datacenter-docs.selectorLabels" . }}
|
||||
app.kubernetes.io/component: cache
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels for API
|
||||
*/}}
|
||||
{{- define "datacenter-docs.api.selectorLabels" -}}
|
||||
{{ include "datacenter-docs.selectorLabels" . }}
|
||||
app.kubernetes.io/component: api
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels for Chat
|
||||
*/}}
|
||||
{{- define "datacenter-docs.chat.selectorLabels" -}}
|
||||
{{ include "datacenter-docs.selectorLabels" . }}
|
||||
app.kubernetes.io/component: chat
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels for Worker
|
||||
*/}}
|
||||
{{- define "datacenter-docs.worker.selectorLabels" -}}
|
||||
{{ include "datacenter-docs.selectorLabels" . }}
|
||||
app.kubernetes.io/component: worker
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels for Frontend
|
||||
*/}}
|
||||
{{- define "datacenter-docs.frontend.selectorLabels" -}}
|
||||
{{ include "datacenter-docs.selectorLabels" . }}
|
||||
app.kubernetes.io/component: frontend
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the proper image name
|
||||
*/}}
|
||||
{{- define "datacenter-docs.image" -}}
|
||||
{{- $registryName := .registry -}}
|
||||
{{- $repositoryName := .repository -}}
|
||||
{{- $tag := .tag | toString -}}
|
||||
{{- if $registryName }}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- else }}
|
||||
{{- printf "%s:%s" $repositoryName $tag -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "datacenter-docs.imagePullSecrets" -}}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for HPA
|
||||
*/}}
|
||||
{{- define "datacenter-docs.hpa.apiVersion" -}}
|
||||
{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "autoscaling/v2" -}}
|
||||
{{- else -}}
|
||||
{{- print "autoscaling/v2beta2" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
120
deploy/helm/datacenter-docs/templates/api-deployment.yaml
Normal file
120
deploy/helm/datacenter-docs/templates/api-deployment.yaml
Normal file
@@ -0,0 +1,120 @@
|
||||
{{- if .Values.api.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.api.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.api.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.api.autoscaling.enabled }}
|
||||
replicas: {{ .Values.api.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "datacenter-docs.api.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "datacenter-docs.api.selectorLabels" . | nindent 8 }}
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "datacenter-docs.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
initContainers:
|
||||
- name: wait-for-mongodb
|
||||
image: busybox:1.36
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z {{ include "datacenter-docs.mongodb.fullname" . }} {{ .Values.mongodb.service.port }}; do
|
||||
echo "Waiting for MongoDB..."
|
||||
sleep 2
|
||||
done
|
||||
- name: wait-for-redis
|
||||
image: busybox:1.36
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z {{ include "datacenter-docs.redis.fullname" . }} {{ .Values.redis.service.port }}; do
|
||||
echo "Waiting for Redis..."
|
||||
sleep 2
|
||||
done
|
||||
containers:
|
||||
- name: api
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.api.service.targetPort }}
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: MONGODB_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: mongodb-url
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: redis-url
|
||||
- name: LLM_BASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: llm-base-url
|
||||
- name: LLM_MODEL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: llm-model
|
||||
- name: LLM_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-secrets
|
||||
key: llm-api-key
|
||||
- name: API_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-secrets
|
||||
key: api-secret-key
|
||||
- name: LOG_LEVEL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: log-level
|
||||
- name: PYTHONPATH
|
||||
value: "/app/src"
|
||||
livenessProbe:
|
||||
{{- toYaml .Values.api.livenessProbe | nindent 12 }}
|
||||
readinessProbe:
|
||||
{{- toYaml .Values.api.readinessProbe | nindent 12 }}
|
||||
resources:
|
||||
{{- toYaml .Values.api.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
32
deploy/helm/datacenter-docs/templates/api-hpa.yaml
Normal file
32
deploy/helm/datacenter-docs/templates/api-hpa.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- if and .Values.api.enabled .Values.api.autoscaling.enabled }}
|
||||
apiVersion: {{ include "datacenter-docs.hpa.apiVersion" . }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.api.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.api.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "datacenter-docs.api.fullname" . }}
|
||||
minReplicas: {{ .Values.api.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.api.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.api.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
17
deploy/helm/datacenter-docs/templates/api-service.yaml
Normal file
17
deploy/helm/datacenter-docs/templates/api-service.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- if .Values.api.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.api.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.api.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.api.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.api.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "datacenter-docs.api.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
94
deploy/helm/datacenter-docs/templates/chat-deployment.yaml
Normal file
94
deploy/helm/datacenter-docs/templates/chat-deployment.yaml
Normal file
@@ -0,0 +1,94 @@
|
||||
{{- if .Values.chat.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.chat.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.chat.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.chat.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "datacenter-docs.chat.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "datacenter-docs.chat.selectorLabels" . | nindent 8 }}
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "datacenter-docs.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
initContainers:
|
||||
- name: wait-for-mongodb
|
||||
image: busybox:1.36
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z {{ include "datacenter-docs.mongodb.fullname" . }} {{ .Values.mongodb.service.port }}; do
|
||||
echo "Waiting for MongoDB..."
|
||||
sleep 2
|
||||
done
|
||||
containers:
|
||||
- name: chat
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.chat.image.repository }}:{{ .Values.chat.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.chat.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.chat.service.targetPort }}
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: MONGODB_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: mongodb-url
|
||||
- name: LLM_BASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: llm-base-url
|
||||
- name: LLM_MODEL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: llm-model
|
||||
- name: LLM_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-secrets
|
||||
key: llm-api-key
|
||||
- name: LOG_LEVEL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: log-level
|
||||
- name: PYTHONPATH
|
||||
value: "/app/src"
|
||||
resources:
|
||||
{{- toYaml .Values.chat.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
17
deploy/helm/datacenter-docs/templates/chat-service.yaml
Normal file
17
deploy/helm/datacenter-docs/templates/chat-service.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- if .Values.chat.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.chat.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.chat.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.chat.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.chat.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "datacenter-docs.chat.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
37
deploy/helm/datacenter-docs/templates/configmap.yaml
Normal file
37
deploy/helm/datacenter-docs/templates/configmap.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
labels:
|
||||
{{- include "datacenter-docs.labels" . | nindent 4 }}
|
||||
data:
|
||||
# MongoDB connection
|
||||
mongodb-url: {{ tpl .Values.config.mongodbUrl . | quote }}
|
||||
|
||||
# Redis connection
|
||||
redis-url: {{ tpl .Values.config.redisUrl . | quote }}
|
||||
|
||||
# LLM configuration
|
||||
llm-base-url: {{ .Values.config.llm.baseUrl | quote }}
|
||||
llm-model: {{ .Values.config.llm.model | quote }}
|
||||
llm-max-tokens: {{ .Values.config.llm.maxTokens | quote }}
|
||||
llm-temperature: {{ .Values.config.llm.temperature | quote }}
|
||||
|
||||
# MCP configuration
|
||||
mcp-base-url: {{ .Values.config.mcp.baseUrl | quote }}
|
||||
mcp-timeout: {{ .Values.config.mcp.timeout | quote }}
|
||||
|
||||
# Auto-remediation configuration
|
||||
auto-remediation-enabled: {{ .Values.config.autoRemediation.enabled | quote }}
|
||||
auto-remediation-min-reliability: {{ .Values.config.autoRemediation.minReliabilityScore | quote }}
|
||||
auto-remediation-approval-threshold: {{ .Values.config.autoRemediation.requireApprovalThreshold | quote }}
|
||||
auto-remediation-max-actions-per-hour: {{ .Values.config.autoRemediation.maxActionsPerHour | quote }}
|
||||
auto-remediation-dry-run: {{ .Values.config.autoRemediation.dryRun | quote }}
|
||||
|
||||
# Security configuration
|
||||
api-key-enabled: {{ .Values.config.apiKeyEnabled | quote }}
|
||||
cors-origins: {{ join "," .Values.config.corsOrigins | quote }}
|
||||
|
||||
# Logging configuration
|
||||
log-level: {{ .Values.config.logLevel | quote }}
|
||||
log-format: {{ .Values.config.logFormat | quote }}
|
||||
@@ -0,0 +1,69 @@
|
||||
{{- if .Values.frontend.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.frontend.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.frontend.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.frontend.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "datacenter-docs.frontend.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "datacenter-docs.frontend.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "datacenter-docs.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: frontend
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.frontend.service.targetPort }}
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
resources:
|
||||
{{- toYaml .Values.frontend.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
17
deploy/helm/datacenter-docs/templates/frontend-service.yaml
Normal file
17
deploy/helm/datacenter-docs/templates/frontend-service.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- if .Values.frontend.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.frontend.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.frontend.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.frontend.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.frontend.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "datacenter-docs.frontend.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
57
deploy/helm/datacenter-docs/templates/ingress.yaml
Normal file
57
deploy/helm/datacenter-docs/templates/ingress.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.className }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
pathType: {{ .pathType }}
|
||||
backend:
|
||||
service:
|
||||
{{- if eq .service "frontend" }}
|
||||
name: {{ include "datacenter-docs.frontend.fullname" $ }}
|
||||
{{- else if eq .service "api" }}
|
||||
name: {{ include "datacenter-docs.api.fullname" $ }}
|
||||
{{- else if eq .service "chat" }}
|
||||
name: {{ include "datacenter-docs.chat.fullname" $ }}
|
||||
{{- else }}
|
||||
name: {{ .service }}
|
||||
{{- end }}
|
||||
port:
|
||||
{{- if eq .service "frontend" }}
|
||||
number: {{ $.Values.frontend.service.port }}
|
||||
{{- else if eq .service "api" }}
|
||||
number: {{ $.Values.api.service.port }}
|
||||
{{- else if eq .service "chat" }}
|
||||
number: {{ $.Values.chat.service.port }}
|
||||
{{- else }}
|
||||
number: 80
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
17
deploy/helm/datacenter-docs/templates/mongodb-service.yaml
Normal file
17
deploy/helm/datacenter-docs/templates/mongodb-service.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- if .Values.mongodb.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.mongodb.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.mongodb.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.mongodb.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.mongodb.service.port }}
|
||||
targetPort: mongodb
|
||||
protocol: TCP
|
||||
name: mongodb
|
||||
selector:
|
||||
{{- include "datacenter-docs.mongodb.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
113
deploy/helm/datacenter-docs/templates/mongodb-statefulset.yaml
Normal file
113
deploy/helm/datacenter-docs/templates/mongodb-statefulset.yaml
Normal file
@@ -0,0 +1,113 @@
|
||||
{{- if .Values.mongodb.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.mongodb.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.mongodb.labels" . | nindent 4 }}
|
||||
spec:
|
||||
serviceName: {{ include "datacenter-docs.mongodb.fullname" . }}
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "datacenter-docs.mongodb.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "datacenter-docs.mongodb.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "datacenter-docs.serviceAccountName" . }}
|
||||
securityContext:
|
||||
fsGroup: 999
|
||||
runAsUser: 999
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: "{{ .Values.mongodb.image.repository }}:{{ .Values.mongodb.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.mongodb.image.pullPolicy }}
|
||||
ports:
|
||||
- name: mongodb
|
||||
containerPort: 27017
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: MONGO_INITDB_ROOT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-secrets
|
||||
key: mongodb-username
|
||||
- name: MONGO_INITDB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-secrets
|
||||
key: mongodb-password
|
||||
- name: MONGO_INITDB_DATABASE
|
||||
value: {{ .Values.mongodb.auth.database | quote }}
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- mongosh
|
||||
- --eval
|
||||
- "db.adminCommand('ping')"
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- mongosh
|
||||
- --eval
|
||||
- "db.adminCommand('ping')"
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
resources:
|
||||
{{- toYaml .Values.mongodb.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data/db
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mongodb.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
labels:
|
||||
{{- include "datacenter-docs.mongodb.labels" . | nindent 10 }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
{{- if .Values.mongodb.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.mongodb.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: {{ .Values.mongodb.persistence.storageClass | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.mongodb.persistence.size | quote }}
|
||||
{{- else }}
|
||||
volumes:
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
70
deploy/helm/datacenter-docs/templates/redis-deployment.yaml
Normal file
70
deploy/helm/datacenter-docs/templates/redis-deployment.yaml
Normal file
@@ -0,0 +1,70 @@
|
||||
{{- if .Values.redis.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.redis.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.redis.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "datacenter-docs.redis.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "datacenter-docs.redis.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "datacenter-docs.serviceAccountName" . }}
|
||||
securityContext:
|
||||
fsGroup: 999
|
||||
runAsUser: 999
|
||||
containers:
|
||||
- name: redis
|
||||
image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
|
||||
ports:
|
||||
- name: redis
|
||||
containerPort: 6379
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- redis-cli
|
||||
- ping
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- redis-cli
|
||||
- ping
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
resources:
|
||||
{{- toYaml .Values.redis.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
17
deploy/helm/datacenter-docs/templates/redis-service.yaml
Normal file
17
deploy/helm/datacenter-docs/templates/redis-service.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- if .Values.redis.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.redis.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.redis.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.redis.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.redis.service.port }}
|
||||
targetPort: redis
|
||||
protocol: TCP
|
||||
name: redis
|
||||
selector:
|
||||
{{- include "datacenter-docs.redis.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
17
deploy/helm/datacenter-docs/templates/secrets.yaml
Normal file
17
deploy/helm/datacenter-docs/templates/secrets.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-secrets
|
||||
labels:
|
||||
{{- include "datacenter-docs.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
# LLM API Key
|
||||
llm-api-key: {{ .Values.secrets.llmApiKey | quote }}
|
||||
|
||||
# API Secret Key
|
||||
api-secret-key: {{ .Values.secrets.apiSecretKey | quote }}
|
||||
|
||||
# MongoDB credentials
|
||||
mongodb-username: {{ .Values.secrets.mongodbUsername | quote }}
|
||||
mongodb-password: {{ .Values.secrets.mongodbPassword | quote }}
|
||||
13
deploy/helm/datacenter-docs/templates/serviceaccount.yaml
Normal file
13
deploy/helm/datacenter-docs/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: true
|
||||
{{- end }}
|
||||
107
deploy/helm/datacenter-docs/templates/worker-deployment.yaml
Normal file
107
deploy/helm/datacenter-docs/templates/worker-deployment.yaml
Normal file
@@ -0,0 +1,107 @@
|
||||
{{- if .Values.worker.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.worker.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.worker.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.worker.autoscaling.enabled }}
|
||||
replicas: {{ .Values.worker.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "datacenter-docs.worker.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "datacenter-docs.worker.selectorLabels" . | nindent 8 }}
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "datacenter-docs.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
initContainers:
|
||||
- name: wait-for-mongodb
|
||||
image: busybox:1.36
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z {{ include "datacenter-docs.mongodb.fullname" . }} {{ .Values.mongodb.service.port }}; do
|
||||
echo "Waiting for MongoDB..."
|
||||
sleep 2
|
||||
done
|
||||
- name: wait-for-redis
|
||||
image: busybox:1.36
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z {{ include "datacenter-docs.redis.fullname" . }} {{ .Values.redis.service.port }}; do
|
||||
echo "Waiting for Redis..."
|
||||
sleep 2
|
||||
done
|
||||
containers:
|
||||
- name: worker
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
|
||||
env:
|
||||
- name: MONGODB_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: mongodb-url
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: redis-url
|
||||
- name: LLM_BASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: llm-base-url
|
||||
- name: LLM_MODEL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: llm-model
|
||||
- name: LLM_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-secrets
|
||||
key: llm-api-key
|
||||
- name: LOG_LEVEL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "datacenter-docs.fullname" . }}-config
|
||||
key: log-level
|
||||
- name: PYTHONPATH
|
||||
value: "/app/src"
|
||||
resources:
|
||||
{{- toYaml .Values.worker.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
24
deploy/helm/datacenter-docs/templates/worker-hpa.yaml
Normal file
24
deploy/helm/datacenter-docs/templates/worker-hpa.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
{{- if and .Values.worker.enabled .Values.worker.autoscaling.enabled }}
|
||||
apiVersion: {{ include "datacenter-docs.hpa.apiVersion" . }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "datacenter-docs.worker.fullname" . }}
|
||||
labels:
|
||||
{{- include "datacenter-docs.worker.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "datacenter-docs.worker.fullname" . }}
|
||||
minReplicas: {{ .Values.worker.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user