# Default values for kantaloupe.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

## @section Global configuration
# global.imageRegistry -- Global Docker image registry

# global.imagePullSecrets -- Global Docker image pull secrets

# nameOverride -- String to partially override the fullname template (will maintain the release name)

# fullnameOverride -- String to fully override the fullname template
nameOverride: ""
fullnameOverride: "kantaloupe"
global:
  # global.imageRegistry -- Global Docker image registry
  imageRegistry: ""
  ## E.g.
  ## imagePullSecrets:
  ##   - myRegistryKeySecretName
  # global.imagePullSecrets -- Global Docker image pull secrets
  imagePullSecrets: []

## @section Pre-Hook configuration
# installCRDs -- define flag whether to install CRD resources
installCRDs: true

## @section CRD hook image configuration
# hook.image.registry -- CRD hook image registry

# hook.image.repository -- CRD hook image repository

# hook.image.tag -- CRD hook image tag (immutable tags are recommended)

# hook.image.pullPolicy -- CRD hook image pull policy

# hook.image.pullSecrets -- Specify docker-registry secret names as an array
hook:
  image:
    registry: ghcr.io
    repository: cloudtty/cloudshell
    tag: "v0.8.9"
    pullPolicy: IfNotPresent
    pullSecrets: []

controlPlaneName: "control-plane"

## @section Gateway configuration
# gateway.enabled -- Enable Gateway API resources

# gateway.className -- GatewayClass name

# gateway.apiserverCors -- Optional CORS policy attached only to the apiserver HTTPRoute (`/apis`)

# gateway.apiserverCors.enabled -- Enable Envoy Gateway SecurityPolicy-based CORS on the apiserver route

# gateway.apiserverCors.allowOrigins -- Allowed browser origins for apiserver CORS; required when enabled

# gateway.apiserverCors.allowMethods -- Allowed methods returned on CORS preflight responses

# gateway.apiserverCors.allowHeaders -- Allowed request headers returned on CORS preflight responses

# gateway.apiserverCors.exposeHeaders -- Response headers exposed to browser JavaScript

# gateway.apiserverCors.allowCredentials -- Whether credentialed cross-origin requests are allowed

# gateway.apiserverCors.maxAge -- Optional browser preflight cache max age in seconds

# gateway.ipAddress -- Gateway IP address

# gateway.hostnames -- List of site hostnames (DNS names or wildcard names such as `*.example.com`, without scheme, port, or path). Applied to UI/API routes and passed to controller-manager and apiserver as `GATEWAY_HOSTNAMES` for control-plane workload, vLLM demo, and CloudShell HTTPRoutes. Member-cluster workload routes do not inherit the control-plane site hostnames. An empty list leaves site routes unrestricted by hostname. The first entry also supplies the control-plane cluster gateway address for generated access URLs; use a concrete hostname first. HTTPS certificates must cover these names.

# gateway.apiserverHostnames -- Dedicated external hostnames for direct apiserver access, separate from gateway.hostnames (the UI/site domain). When non-empty, a dedicated HTTPRoute routes these hosts to the apiserver; they must be covered by the HTTPS listener's TLS certificate.

# gateway.listeners -- Gateway listeners configuration

# gateway.envoy -- Envoy Gateway implementation details

# gateway.envoy.service -- Envoy service configuration

# gateway.envoy.service.type -- Envoy service type (LoadBalancer or NodePort)

# gateway.envoy.service.ports.http -- HTTP port configuration

# gateway.envoy.service.ports.http.nodePort -- HTTP NodePort

# gateway.envoy.service.ports.https -- HTTPS port configuration

# gateway.envoy.service.ports.https.nodePort -- HTTPS NodePort
gateway:
  enabled: true
  className: kantaloupe
  apiserverCors:
    enabled: false
    allowOrigins: [] # @schema item:string
    allowMethods:
      - GET
      - POST
      - PUT
      - PATCH
      - DELETE
      - OPTIONS
    allowHeaders:
      - authorization
      - content-type
      - accept
      - origin
    exposeHeaders: [] # @schema item:string
    allowCredentials: false
    maxAge: null # @schema type:[string, null]
  ipAddress: ""
  hostnames: []
  apiserverHostnames: []
  listeners:
    - name: http
      port: 80
      protocol: HTTP # @schema enum:["HTTP","HTTPS"]
  envoy:
    service:
      # @schema enum:["LoadBalancer", "NodePort"]
      type: NodePort
      ports:
        http:
          nodePort: 30080
        https:
          nodePort: 30443
    proxy:
      # gateway.envoy.proxy.image.registry -- Envoy proxy image registry

      # gateway.envoy.proxy.image.repository -- Envoy proxy image repository. When set without a tag, renders the EnvoyProxy `imageRepository` field.

      # gateway.envoy.proxy.image.tag -- Envoy proxy image tag. When set, renders a complete EnvoyProxy `image` reference.

      # gateway.envoy.proxy.image.pullSecrets -- Image pull secrets for Envoy proxy pods
      image:
        registry: ""
        repository: ""
        tag: ""
        pullSecrets: []

hamiNamespace: "hami-system"

# controller manager config
controllerManager:
  metricsPort: 31001
  # controllerManager.concurrentWorkSyncs -- Reconcile workers per member-cluster controller on the elected leader; standby replicas do not add throughput
  concurrentWorkSyncs: 5
  # controllerManager.terminationGracePeriodSeconds -- Time allowed for controller shutdown and leader failover
  terminationGracePeriodSeconds: 45
  # controllerManager.rollingUpdate.maxSurge -- Extra Pods allowed during updates; use 0 with required anti-affinity on fully occupied nodes

  # controllerManager.rollingUpdate.maxUnavailable -- Pods allowed to be unavailable during updates; use 1 with maxSurge=0
  rollingUpdate:
    maxSurge: 1
    maxUnavailable: 0
  ## @section controllerManager configuration
  # controllerManager.labels -- controllerManager labels
  labels: {}
  # controllerManager.replicaCount -- controllerManager target replica count
  replicaCount: 1
  # controllerManager.podAnnotations -- controllerManager pod annotations
  podAnnotations: {}
  # controllerManager.podLabels -- controllerManager pod labels
  podLabels: {}
  # controllerManager.image.registry -- kantaloupe image registry

  # controllerManager.image.repository -- kantaloupe image repository

  # controllerManager.image.tag -- kantaloupe image tag (immutable tags are recommended)

  # controllerManager.image.pullPolicy -- kantaloupe image pull policy

  # controllerManager.image.pullSecrets -- Specify docker-registry secret names as an array
  image:
    registry: ghcr.io
    repository: dynamia-ai/kantaloupe-controller-manager
    tag: "v0.17.0"
    ## Specify a imagePullPolicy
    ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
    ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
    ##
    pullPolicy: IfNotPresent
    ## Optionally specify an array of imagePullSecrets.
    ## Secrets must be manually created in the namespace.
    ## Example:
    ## pullSecrets:
    ##   - myRegistryKeySecretName
    ##
    pullSecrets: []
  # controllerManager.resources -- controllerManager resource requests and limits
  resources: {}
    # If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #   cpu: 100m
    #   memory: 128Mi
    # requests:
    #   cpu: 100m
    #   memory: 128Mi
  # controllerManager.nodeSelector -- controllerManager node labels for pod assignment
  nodeSelector: {}
  # controllerManager.affinity -- controllerManager affinity settings
  affinity: {}
  # controllerManager.tolerations -- controllerManager tolerations for pod assignment
  tolerations: {}
  # controllerManager.livenessProbe.enabled -- Enable livenessProbe on controllerManager containers
  livenessProbe:
    enabled: false
  # controllerManager.readinessProbe.enabled -- Enable readinessProbe on controllerManager containers
  readinessProbe:
    enabled: false
  # controllerManager.prometheusAddr -- The Prometheus-compatible query endpoint for controller-manager. If empty, uses the default value from Go code.
  prometheusAddr: ""

  webhook:
    enabled: true
    port: 9443
    servicePort: 443
    certDir: /var/run/kantaloupe/webhook-certs
    certName: tls.crt
    keyName: tls.key

## @section auth configuration
# auth.enabled -- Enable kantaloupe auth (JWT login, RBAC, audit)

# auth.storeBackend -- Auth store backend. Supported values: `crd`, `sqlite`

# auth.crdAuditWindowSize -- Max number of audit CRDs retained by the apiserver write path

# auth.crdQPS -- Shared Kubernetes request rate for the CRD auth backend on each apiserver replica. Must be positive.

# auth.crdBurst -- Shared Kubernetes request burst for the CRD auth backend on each apiserver replica. Must be positive.

# auth.dbPath -- SQLite database path for auth data when `auth.storeBackend=sqlite`

# auth.jwtSecret -- JWT signing secret (plain text, dev only)

# auth.bootstrapAdminUsername -- Bootstrap PlatformAdmin username

# auth.bootstrapAdminPassword -- Bootstrap admin password (plain text, dev only)

# auth.bootstrapAdminFullName -- Bootstrap PlatformAdmin full name (display name)

# auth.bootstrapAdminEmail -- Bootstrap PlatformAdmin email address

# auth.existingAuthSecret -- Name of an existing K8s Secret with keys "jwt-secret" and "bootstrap-admin-password" (use instead of plain-text values for production)

# auth.dryRun -- Allow requests without enforcing auth; inject bootstrap admin when no valid token is provided
auth:
  enabled: true
  storeBackend: crd
  crdAuditWindowSize: 1000
  crdQPS: 50 # @schema type:[number]
  crdBurst: 100
  dryRun: false
  dbPath: /data/kantaloupe/auth.db
  jwtSecret: "your-own-jwt-secret"
  bootstrapAdminUsername: "bootstrap-platform-admin"
  bootstrapAdminPassword: "admin12345"
  bootstrapAdminFullName: "Platform Administrator"
  bootstrapAdminEmail: "admin@email.com"
  existingAuthSecret: ""
  # auth.apiserverServiceAccountName -- ServiceAccount name of the kantaloupe-apiserver, used by the auth assignment admission webhook to validate the requester identity. Defaults to the release fullname.
  apiserverServiceAccountName: ""
  # auth.image.registry -- db-migrate image registry for sqlite backend

  # auth.image.repository -- db-migrate image repository for sqlite backend

  # auth.image.tag -- db-migrate image tag for sqlite backend

  # auth.image.pullPolicy -- db-migrate image pull policy for sqlite backend
  image:
    registry: ghcr.io
    repository: dynamia-ai/kantaloupe-db-migrate
    tag: v0.17.0
    pullPolicy: IfNotPresent
  # auth.persistence.enabled -- Enable persistence using PVC for sqlite backend (PV is dynamically provisioned via cluster default StorageClass)

  ## WARNING: If set to false, all auth data (user accounts, tokens) will be lost when the pod restarts.
  ##          Set to true for production sqlite installs or switch to the `crd` backend for etcd-backed persistence.

  # auth.persistence.size -- PVC storage size for sqlite backend

  # auth.persistence.storageClass -- PVC storage class for sqlite backend (empty = use cluster default StorageClass for dynamic PV provisioning)

  # auth.persistence.existingClaim -- Name of an existing PVC to use for sqlite backend (if set, a new PVC will not be created)
  persistence:
    enabled: false
    size: 1Gi
    storageClass: ""
    existingClaim: ""

# apiserver config
apiserver:
  ## @section apiserver configuration
  # apiserver.labels -- apiserver labels
  labels: {}
  # apiserver.replicaCount -- apiserver target replica count
  replicaCount: 1
  # apiserver.shutdownDelaySeconds -- Keep serving after readiness fails to allow endpoint and gateway updates to propagate before draining connections
  shutdownDelaySeconds: 15
  # apiserver.terminationGracePeriodSeconds -- Pod shutdown budget; must be at least shutdownDelaySeconds + 40 for routing withdrawal, requests (30s), audit drain (5s), and cleanup
  terminationGracePeriodSeconds: 60
  # apiserver.rollingUpdate.maxSurge -- Extra Pods allowed during CRD-backed updates; use 0 with required anti-affinity on fully occupied nodes

  # apiserver.rollingUpdate.maxUnavailable -- Pods allowed to be unavailable during CRD-backed updates; use 1 with maxSurge=0
  rollingUpdate:
    maxSurge: 1
    maxUnavailable: 0
  # apiserver.topologySpreadConstraints -- Scheduling-time topology constraints; these do not rebalance Pods after scale-down
  topologySpreadConstraints: []
  # apiserver.pdb.enabled -- Create a PodDisruptionBudget for voluntary disruptions

  # apiserver.pdb.minAvailable -- Minimum available API replicas during voluntary disruptions
  pdb:
    enabled: false
    minAvailable: 1
  # apiserver.autoscaling.enabled -- Enable CPU HPA; requires CRD auth storage and CPU requests

  # apiserver.autoscaling.minReplicas -- Minimum APIServer replicas when HPA is enabled

  # apiserver.autoscaling.maxReplicas -- Maximum APIServer replicas; size Kubernetes API capacity before increasing

  # apiserver.autoscaling.targetCPUUtilizationPercentage -- CPU target relative to container CPU requests
  autoscaling:
    enabled: false
    minReplicas: 2
    maxReplicas: 4
    targetCPUUtilizationPercentage: 70
  # apiserver.podAnnotations -- apiserver pod annotations
  podAnnotations: {}
  # apiserver.podLabels -- apiserver pod labels
  podLabels: {}
  # apiserver.image.registry -- kantaloupe image registry

  # apiserver.image.repository -- kantaloupe image repository

  # apiserver.image.tag -- kantaloupe image tag (immutable tags are recommended)

  # apiserver.image.pullPolicy -- kantaloupe image pull policy

  # apiserver.image.pullSecrets -- Specify docker-registry secret names as an array
  image:
    registry: ghcr.io
    repository: dynamia-ai/kantaloupe-apiserver
    tag: "v0.17.0"
    ## Specify a imagePullPolicy
    ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
    ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
    ##
    pullPolicy: IfNotPresent
    ## Optionally specify an array of imagePullSecrets.
    ## Secrets must be manually created in the namespace.
    ## Example:
    ## pullSecrets:
    ##   - myRegistryKeySecretName
    ##
    pullSecrets: []
  # apiserver.resources -- apiserver resource requests and limits
  resources: {}
    # If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #   cpu: 100m
    #   memory: 128Mi
    # requests:
    #   cpu: 100m
    #   memory: 128Mi
  # apiserver.nodeSelector -- apiserver node labels for pod assignment
  nodeSelector: {}
  # apiserver.affinity -- apiserver affinity settings
  affinity: {}
  # apiserver.tolerations -- apiserver tolerations for pod assignment
  tolerations: {}
  # apiserver.livenessProbe.enabled -- Enable livenessProbe on apiserver containers
  livenessProbe:
    enabled: true
    httpGet:
      path: /healthz
      port: 8000
    initialDelaySeconds: 10
    periodSeconds: 10
    timeoutSeconds: 3
    failureThreshold: 6
  # apiserver.readinessProbe.enabled -- Enable business readiness and shutdown checks
  readinessProbe:
    enabled: true
    httpGet:
      path: /readyz
      port: 8000
    periodSeconds: 5
    timeoutSeconds: 3
    failureThreshold: 2
  # apiserver.startupProbe.enabled -- Allow slow cache synchronization before liveness checks begin
  startupProbe:
    enabled: true
    httpGet:
      path: /healthz
      port: 8000
    periodSeconds: 5
    timeoutSeconds: 3
    failureThreshold: 60
  # apiserver.clusterAPIQPS -- QPS to use while talking with cluster kube-apiserver
  clusterAPIQPS: 50
  # apiserver.clusterAPIBurst -- Burst to use while talking with cluster kube-apiserver
  clusterAPIBurst: 100
  # apiserver.logLevel -- apiserver glog verbosity level (0=minimal, 4=info, 5=debug)
  logLevel: 4
  # apiserver.prometheusAddr -- Prometheus server address for apiserver metrics querying
  prometheusAddr: ""

  # apiserver.meteringGRPCAddress -- Override the Metering gRPC address. An empty address uses the bundled Service when metering.enabled is true. With Metering disabled and no address, authorized callers can still read /apis/kantaloupe.dynamia.ai/v1/metering/status. Metering operations return FailedPrecondition (METERING_DISABLED).
  meteringGRPCAddress: ""

  # apiserver.leaderElection.enabled -- Enable apiserver leader election for auth singleton bootstrap when auth.storeBackend=crd

  # apiserver.leaderElection.leaseDuration -- Lease duration for apiserver leader election

  # apiserver.leaderElection.renewDeadline -- Renew deadline for apiserver leader election

  # apiserver.leaderElection.retryPeriod -- Retry period for apiserver leader election

  # apiserver.leaderElection.resourceNamespace -- Namespace of the Lease object; empty means use the release namespace
  leaderElection:
    enabled: true
    leaseDuration: 15s
    renewDeadline: 10s
    retryPeriod: 2s
    resourceNamespace: ""
  ## service config
  service:
    type: ClusterIP
    nodePort: 31800
    port: 8000

# ui config
ui:
  ## @section ui configuration
  # ui.labels -- ui labels
  labels: {}
  # ui.replicaCount -- ui target replica count
  replicaCount: 1
  # ui.podAnnotations -- ui pod annotations
  podAnnotations: {}
  # ui.podLabels -- ui pod labels
  podLabels: {}
  # ui.image.registry -- kantaloupe image registry

  # ui.image.repository -- kantaloupe image repository

  # ui.image.tag -- kantaloupe image tag (immutable tags are recommended)

  # ui.image.pullPolicy -- kantaloupe image pull policy

  # ui.image.pullSecrets -- Specify docker-registry secret names as an array
  image:
    registry: ghcr.io
    repository: dynamia-ai/kantaloupe-ui
    tag: "v0.14.0"
    ## Specify a imagePullPolicy
    ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
    ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
    ##
    pullPolicy: IfNotPresent
    ## Optionally specify an array of imagePullSecrets.
    ## Secrets must be manually created in the namespace.
    ## Example:
    ## pullSecrets:
    ##   - myRegistryKeySecretName
    ##
    pullSecrets: []
  # ui.resources -- ui resource requests and limits
  resources: {}
    # If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #   cpu: 100m
    #   memory: 128Mi
    # requests:
    #   cpu: 100m
    #   memory: 128Mi
  # ui.nodeSelector -- ui node labels for pod assignment
  nodeSelector: {}
  # ui.affinity -- ui affinity settings
  affinity: {}
  # ui.tolerations -- ui tolerations for pod assignment
  tolerations: {}
  # ui.livenessProbe.enabled -- Enable livenessProbe on ui containers
  livenessProbe:
    enabled: false
  # ui.readinessProbe.enabled -- Enable readinessProbe on ui containers
  readinessProbe:
    enabled: false
  # ui.forceChinese -- Force UI to display Chinese language
  forceChinese: false

  # ui.apiBackendURL -- Optional backend address for UI API requests. Leave empty to use same-origin requests
  apiBackendURL: ""
  ## service config
  service:
    type: ClusterIP
    nodePort: 31300
    port: 80

## universe metrics
monitoring:
  enabled: true
  # monitoring.serviceMonitorLabels -- Labels added to ServiceMonitor and PrometheusRule resources for discovery by Prometheus-compatible operators. When empty, defaults to `release: prometheus`; providing any labels replaces that fallback. The built-in `app`, `role`, and `control-plane` labels cannot be overridden.
  serviceMonitorLabels: {} # @schema additionalProperties: {"type":"string"}
  hamiServiceMonitor:
    enabled: true
  vendorServiceMonitor:
    # monitoring.vendorServiceMonitor.enabled -- Create vendor ServiceMonitor templates and recording rules for enabled vendors.
    enabled: true

    # monitoring.vendorServiceMonitor.enableNvidiaServicemonitor -- Enable NVIDIA exporter discovery and NVIDIA recording rules in the control plane. Required for monitoring NVIDIA devices in local or member clusters.
    enableNvidiaServicemonitor: true

    # monitoring.vendorServiceMonitor.enableMetaxServicemonitor -- Enable MetaX exporter discovery and MetaX recording rules in the control plane. Required for monitoring MetaX devices in local or member clusters.
    enableMetaxServicemonitor: false

    # monitoring.vendorServiceMonitor.enableAscendServicemonitor -- Enable Ascend exporter discovery and Ascend recording rules in the control plane. Required for monitoring Ascend devices in local or member clusters.
    enableAscendServicemonitor: false

    # monitoring.vendorServiceMonitor.enableEnflameServicemonitor -- Enable Enflame GCU exporter discovery and Enflame recording rules in the control plane. Required for monitoring Enflame devices in local or member clusters.
    enableEnflameServicemonitor: false

    # monitoring.vendorServiceMonitor.enableAlibabaPPUServicemonitor -- Enable Alibaba PPU exporter discovery and Alibaba PPU recording rules in the control plane. Required for monitoring Alibaba PPU devices in local or member clusters.
    enableAlibabaPPUServicemonitor: false

    # monitoring.vendorServiceMonitor.enableAMDServiceMonitor -- Enable AMD GPU Operator exporter discovery and AMD recording rules in the control plane. Required for monitoring AMD devices in local or member clusters.
    enableAMDServiceMonitor: false

    # monitoring.vendorServiceMonitor.enableIluvatarServicemonitor -- Enable Iluvatar ix-exporter and vgpu-manager discovery and Iluvatar recording rules in the control plane. Required for monitoring Iluvatar devices in local or member clusters.
    enableIluvatarServicemonitor: false

    # monitoring.vendorServiceMonitor.enableHygonServicemonitor -- Enable HCU exporter discovery and Hygon device recording rules in the control plane. Required for monitoring Hygon devices in local or member clusters. Discovers hcu-exporter in the monitoring namespace.
    enableHygonServicemonitor: false

cloudtty:
  enabled: true

metering:
  # -- Deploy HAMi Metering and use its gRPC Service by default.
  enabled: true

  api:
    image:
      # -- Immutable Metering API image for the bundled chart.
      tag: v0.3.1@sha256:99fb7e92c59a190e77bc862224c92d59b79ed3035d993e232e68f1c53d1b9ae7
  collector:
    image:
      # -- Immutable Metering Collector image for the bundled chart.
      tag: v0.3.1@sha256:63f578603eaafbb54e04df9d01249b6fd88252291eb886a28ced99ebb31ef3d3
    migrate:
      image:
        # -- Immutable Flyway migration image for the bundled chart.
        tag: v0.3.1@sha256:30641a6fc1066380e274d4ccd42e7f5f951f4943b32e391861c7d0f679e605ee

resourcePoolManager:
  # -- Deploy the HAMi Resource Pool Manager. Requires an existing scheduler ConfigMap and cluster-connected Helm.
  enabled: true
  # -- Name used for manager resource names and labels.
  nameOverride: hami-resource-pool-manager
  hami:
    # -- Namespace of the existing HAMi scheduler device ConfigMap and the manager workloads. Set to an empty string to use the Kantaloupe release namespace.
    existingConfigMapNamespace: hami-system
    # -- Name of the existing HAMi scheduler device ConfigMap.
    existingConfigMap: hami-scheduler-device

resourcePoolManagerCRDs:
  # -- (bool) Install RPM CRDs. Defaults to resourcePoolManager.enabled. Set to false when another release manages them.
  enabled: null # @schema type:[boolean, null]

mpu:
  enabled: false
  # mpu.image.pullPolicy -- MPU image pull policy
  image:
    registry: ghcr.io
    repository: dynamia-ai/mpu
    # ubuntu-24.04 or ubuntu-22.04 or ubuntu-20.04 for different versions of kernel
    # ubuntu-24.04 for kernel version 6.8.0-6.17.0, ubuntu-22.04 for kernel version 5.15.0-6.8.0, ubuntu-20.04 for kernel version 5.4.0-5.15.0
    tag: "dev-ubuntu24.04"
    pullPolicy: IfNotPresent
    pullSecrets: []
