# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: 2025 Univention GmbH
---
yamlAnchors:
  resources: &baselineResources
    requests:
      cpu: "0.1"
      memory: "500Mi"
    limits:
      cpu: "8"
      memory: "8Gi"

keycloak:
  replicaCount: 5
  resources:
    requests:
      cpu: 1
      memory: "4Gi"
    limits:
      cpu: 4
      memory: "8Gi"

nubusLdapServer:
  resourcesPrimary:
    requests:
      cpu: 3
      memory: "2Gi"
    limits:
      cpu: 16
      memory: "4Gi"
  resourcesSecondary:
    requests:
      cpu: 5
      memory: "2Gi"
    limits:
      cpu: 16
      memory: "4Gi"
  resourcesProxy:
    requests:
      cpu: 3
      memory: "2Gi"
    limits:
      cpu: 16
      memory: "4Gi"
  replicaCountPrimary: 2
  replicaCountSecondary: 8
  replicaCountProxy: 0

nubusUmcServer:
  # Deploy Pods in parallel instead of sequentially
  podManagementPolicy: "Parallel"
  resources:
    requests:
      cpu: "0.15"
      memory: "500M"
    limits:
      cpu: 2
      memory: "2Gi"
  replicaCount: 128
  proxy:
    replicaCount: 4
  topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: "kubernetes.io/hostname"
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchExpressions:
          - key: app.kubernetes.io/name
            operator: In
            values:
              - umc-server
              - nubus-umc-server-proxy

nubusUmcGateway:
  resources: *baselineResources
  replicaCount: 40
  topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: "kubernetes.io/hostname"
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchLabels:
          app.kubernetes.io/name: umc-gateway

nubusPortalServer:
  # Disable the /me endpoint
  portalServer:
    featureToggles:
      api_me: false
  resources:
    requests:
      cpu: "0.4"
      memory: "500M"
    limits:
      cpu: 2
      memory: "2Gi"
  replicaCount: 10
  topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: "kubernetes.io/hostname"
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchLabels:
          app.kubernetes.io/name: portal-server

nubusPortalFrontend:
  resources: *baselineResources
  replicaCount: 6
  topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: "kubernetes.io/hostname"
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchLabels:
          app.kubernetes.io/name: portal-frontend

nubusNotificationsApi:
  requests:
    cpu: "300m"
    memory: "500Mi"
  limits:
    cpu: "8"
    memory: "8Gi"
  replicaCount: 2

postgresql:
  resources:
    limits:
      cpu: "8"
      memory: "8Gi"
    requests:
      cpu: "1000m"
      memory: "500Mi"
  primary:
    resources: *baselineResources
    extendedConfiguration: |
      max_connections = 1200

minio:
  resources:
    limits:
      cpu: "8"
      memory: "8Gi"
    requests:
      cpu: "1.5"
      memory: "500Mi"
  networkPolicy:
    resources: *baselineResources
  tls:
    resources: *baselineResources
  provisioning:
    resources: *baselineResources
    cleanupAfterFinished:
      resources: *baselineResources

nubusGuardian:
  enabled: false

nubusTwofaHelpdesk:
  enabled: false

nubusLdapNotifier:
  resources: *baselineResources

nubusPortalConsumer:
  resources: *baselineResources

nubusProvisioning:
  resources:
    dispatcher: *baselineResources
    prefill: *baselineResources
    api: *baselineResources
  nats:
    resources: *baselineResources
    reloader:
      resources: *baselineResources
    natsBox:
      resources: *baselineResources

nubusUdmListener:
  resources: *baselineResources

nubusSelfServiceConsumer:
  resources: *baselineResources

nubusKeycloakBootstrap:
  resources: *baselineResources

nubusKeycloakExtensions:
  resources: *baselineResources

nubusStackDataUms:
  resources: *baselineResources

nubusUdmRestApi:
  resources: *baselineResources
  replicaCount: 2
