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

# Public Kubernetes Cluster IP
publicClusterIp: &publicClusterIp XX.XX.XX.XX
# Protocol http or https to use to access ProActive Server (default: http)
protocol: http
# ProActive admin password
proactiveAdminPassword: activeeon
# Number of days before jobs cleanup (default: 30)
housekeepingDays: 30

ports:
  # Port to use to access ProActive Server (default: 8080)
  httpPort: &httpPort 8080
  # Port to use for PARM communication (default: 33647)
  pamrPort: &pamrPort 33647

persistentVolumes:
  # Persistent volumes to host the Scheduler configuration
  scheduler:
    default:
      storage: 10Gi
      path: /opt/proactive/server/default
      accessModes: ReadWriteOnce
    previous:
      storage: 10Gi
      path: /opt/proactive/server/previous
      accessModes: ReadWriteOnce
  # Persistent volumes to host the Nodes configuration
  node:
    default:
      storage: 5Gi
      path: /opt/proactive/node/default
      accessModes: ReadWriteOnce
    previous:
      storage: 5Gi
      path: /opt/proactive/node/previous
      accessModes: ReadWriteOnce
  # Persistent volumes to host the DB configuration
  db:
    default:
      storage: 10Gi
      path: /opt/proactive/db/data
      accessModes: ReadWriteOnce

services:
  scheduler:
    # Scheduler Service to access the ProActive Web portals
    webService:
      name: http
      protocol: TCP
      port: *httpPort
      targetPort: *httpPort
      externalIPs: *publicClusterIp
      type: LoadBalancer
    # Scheduler Service for Scheduler to Nodes communication
    pamrService:
      name: pamr
      protocol: TCP
      port: *pamrPort
      type: LoadBalancer
  node:
    # Node Service to access PSA endpoints
    psaService:
      name: psa
      protocol: TCP
      # Define the ports to open using min_port and max_port
      min_port: 37200
      max_port: 37210
      type: LoadBalancer
  # DB services for Scheduler to DB communication
  dbService:
    postgres:
      protocol: TCP
      port: 5432
      type: ClusterIP
    mysql:
      protocol: TCP
      port: 3306
      type: ClusterIP

# Replicas counts
replicas:
  scheduler:
    replicaCount: 1
  node:
    replicaCount: 1
  db:
    replicaCount: 1

# Docker Images to be used to run the Server, Nodes, initContainers, dind, and DBs
# Check https://dockerhub.activeeon.com/namespaces/36 to verify available ProActive images
images:
  scheduler:
    repository: dockerhub.activeeon.com/k8s/proactive-scheduler
    tag: 12.0.0
    pullPolicy: IfNotPresent
  schedulerExternalDB:
    repository: dockerhub.activeeon.com/k8s/proactive-scheduler-external-db
    tag: 12.0.0
    pullPolicy: IfNotPresent
  node:
    repository: dockerhub.activeeon.com/k8s/proactive-node
    tag: 12.0.0
    pullPolicy: IfNotPresent
  initContainers:
    repository: busybox
    tag: latest
    pullPolicy: IfNotPresent
  dind:
    repository: docker
    tag: 1.12.6-dind
    pullPolicy: IfNotPresent
  db:
    postgres:
      repository: dockerhub.activeeon.com/k8s/postgres-pa
      tag: 12.2
      pullPolicy: IfNotPresent
    mysql:
      repository: dockerhub.activeeon.com/k8s/mysql-pa
      tag: "8.0"
      pullPolicy: IfNotPresent

# Define the resources to be reserved for the Scheduler, Nodes, and DBs Pods
resources:
  scheduler:
    requests:
      cpu: 1000m
      memory: 5G
  node:
    requests:
      cpu: 500m
      memory: 1G
  db:
    postgres:
      requests:
        cpu: 2000m
        memory: 2G
    mysql:
      requests:
        cpu: 2000m
        memory: 2G

# Volume mounts paths
volumeMounts:
  scheduler:
    default:
      mountPath: /opt/proactive/server/default
    previous:
      mountPath: /opt/proactive/server/previous
  node:
    default:
      mountPath: /opt/proactive/node/default
    previous:
      mountPath: /opt/proactive/node/previous
  db:
    postgres:
      mountPath: /var/lib/postgresql/data
    mysql:
      mountPath: /var/lib/mysql

# Define the readinessProbe rules for the Scheduler Pod
readinessProbe:
  httpGet:
    port: *httpPort
  initialDelaySeconds: 60
  periodSeconds: 5
  timeoutSeconds: 3

# Define the livenessProbe rules for the Scheduler Pod
livenessProbe:
  httpGet:
    port: *httpPort
  timeoutSeconds: 3
  failureThreshold: 24 # if during 24*5 seconds = 2 minutes, scheduler seems dead => restart it
  successThreshold: 1
  initialDelaySeconds: 500 # we give some time in order to let the scheduler start properly
  periodSeconds: 5

# Database properties
database:
  # Fill the DB type: default is HSQLDB. Alternatives are MySQL or Postgres
  type: default
  # External ProActive DB credentials, used only for postgres and mysql configurations
  passwords:
    catalogPassword: changeme
    notificationPassword: changeme
    pcaPassword: changeme
    rmPassword: changeme
    schedulerPassword: changeme
    postgresPassword: changeme
    mysqlPassword: changeme

# User starting the ProActive Server
user:
  userName: activeeon
  groupName: activeeon
  uid: 1000
  gid: 1000

# Node Sources properties
nodeSources:
  dynamicK8s:
    # True, to set up a Dynamic Kubernetes Node Source at Server startup (false if not)
    enabled: false
    # Name of the Dynamic Kubernetes Node Source
    name: Dynamic-Kubernetes-Nodes
    # Minimum number of nodes to be deployed
    minNodes: 1
    # Maximum number of nodes to be deployed
    maxNodes: 15
  staticLocal:
    # True, to set up a Static Kubernetes Node Source at Server startup (false if not)
    enabled: true
    # Name of the Static Kubernetes Node Source
    name: Local-Linux-Nodes
    # Number of nodes to be deployed
    numberNodes: 4

# Credentials of the Activeeon Private Docker Registry
# If you do not have access, please contact contact@activeeon.com to request access
imageCredentials:
  registry: dockerhub.activeeon.com
  username: activeeon
  password: changeme
  email: support@activeeon.com