################################################################################
#                            KAGENT DEPLOYED                                  #
################################################################################

Kagent has been successfully deployed to namespace: {{ include "kagent.namespace" . }}

ACCESSING THE UI:
  1. Forward the UI service port:
     kubectl -n {{ include "kagent.namespace" . }} port-forward service/{{ include "kagent.fullname" . }}-ui 8080:{{ .Values.ui.service.ports.port }}

  2. Open your browser and visit:
     http://localhost:8080

ACCESSING THE CONTROLLER API:
  kubectl -n {{ include "kagent.namespace" . }} port-forward service/{{ include "kagent.fullname" . }}-controller {{ .Values.controller.service.ports.port }}:{{ .Values.controller.service.ports.port }}
  
  API endpoint: http://localhost:{{ .Values.controller.service.ports.port }}/api

DEPLOYED COMPONENTS:
  - Controller: {{ include "kagent.fullname" . }}-controller (manages Kubernetes resources)
  - Engine: {{ include "kagent.fullname" . }}-engine (AI agent runtime)
  - UI: {{ include "kagent.fullname" . }}-ui (web interface)
{{- if index .Values "kmcp" "enabled" }}
  - KMCP Controller: {{ include "kagent.fullname" . }}-{{ .Values.kmcp.nameOverride }}-manager-controller (manages MCPServer resources)
{{- end }}

ENABLED TOOLS:
{{- if index .Values "kagent-tools" "enabled" }}
  - Tool Server: Kagent's Built-in tools
{{- end }}
{{- range $tool, $config := .Values.tools }}
{{- if $config.enabled }}
  - {{ $tool }}
{{- end }}
{{- end }}

ENABLED AGENTS:
{{- $agents := list "k8s-agent" "kgateway-agent" "istio-agent" "promql-agent" "observability-agent" "argo-rollouts-agent" "helm-agent" "cilium-policy-agent" "cilium-manager-agent" "cilium-debug-agent" }}
{{- range $agent := $agents }}
{{- $config := index $.Values $agent }}
{{- if and $config (ne ($config.enabled | toString) "false") }}
  - {{ $agent }}
{{- end }}
{{- end }}

USEFUL COMMANDS:
  # View all kagent resources
  kubectl -n {{ include "kagent.namespace" . }} get agents,modelconfigs,toolservers,memories

  # Get agents
  kubectl -n {{ include "kagent.namespace" . }} get agents

  # View logs
  kubectl -n {{ include "kagent.namespace" . }} logs -l app.kubernetes.io/name=kagent -f

TROUBLESHOOTING:
  - Check pod status: kubectl -n {{ include "kagent.namespace" . }} get pods
  - View events: kubectl -n {{ include "kagent.namespace" . }} get events --sort-by='.lastTimestamp'
  - Controller logs: kubectl -n {{ include "kagent.namespace" . }} logs -l app.kubernetes.io/component=controller -f
DOCUMENTATION:
  Visit https://kagent.dev for comprehensive documentation and examples.

{{ if .Values.database.postgres.bundled.enabled -}}
################################################################################
{{- if and (eq .Values.database.postgres.url "") (eq .Values.database.postgres.urlFile "") }}
# WARNING: BUNDLED DATABASE IN USE                                             #
################################################################################
  The bundled PostgreSQL instance is enabled. It is intended for development and
  evaluation only — not suitable for production use. Data may be lost if the
  pod is restarted or rescheduled.

  To use an external database, set:
    database.postgres.url=<your-connection-string> or database.postgres.urlFile=<path>
{{- else }}
# NOTE: BUNDLED DATABASE DEPLOYED BUT NOT IN USE BY CONTROLLER                 #
################################################################################
  The bundled PostgreSQL pod is running, but the controller is connected to an
  external database (database.postgres.url or database.postgres.urlFile is set).

  To connect the controller to the bundled instance instead, unset url/urlFile:
    database.postgres.url=""
  To stop deploying the bundled pod entirely, set:
    database.postgres.bundled.enabled=false
{{- end }}
{{- end }}
################################################################################
