# This file contains overrides for OpenShift-specific configuration and should be combined
# with other overrides using `helm install -f values-overrides.yaml -f values-openshift-overrides.yaml`

# Natsbox doesn't work well without a lot of customization on OpenShift.
# Rather than complicate the deployment we can remove this optional pod
nats:
  natsBox:
    enabled: false

useOpenShiftRoles: true

# --- OpenShift SCC configuration ---
# Uncomment to have the chart render a custom Dremio SCC + ClusterRole + RoleBindings.
# Requires cluster-admin privileges to apply.
#
# Example 1: Chart-managed SCC (e.g., for clusters with strict SELinux enforcement)
# openshift:
#   scc:
#     create: true
#     seLinuxStrategy: RunAsAny
# Example 2: Bind to an admin-managed SCC (no SCC manifest rendered)
# openshift:
#   scc:
#     name: my-admin-managed-scc
#
# --- NATS security context for clusters with a custom Dremio SCC ---
# Only uncomment this block when an SCC is enabled above (Example 1 or 2) that
# permits a fixed non-root UID and a non-default SELinux type — i.e. the
# chart-managed dremio-scc (MustRunAsNonRoot + fsGroup/SELinux RunAsAny) or an
# equivalent admin-managed SCC.
#
# Do NOT uncomment this on a standard OpenShift deployment that relies on the
# built-in restricted-v2 / nonroot-v2 SCCs: those require a UID from the
# namespace's auto-allocated range (MustRunAsRange) and a fixed SELinux type, so
# the hardcoded runAsUser: 1000 and seLinuxOptions below would be rejected by
# the admission controller and the NATS pods would fail to start.
#
# nats:
#   podTemplate:
#     merge:
#       spec:
#         securityContext:
#           seLinuxOptions:
#             type: spc_t
#           runAsNonRoot: true
#           runAsUser: 1000
#           runAsGroup: 1000
#           fsGroup: 1000
#           fsGroupChangePolicy: OnRootMismatch
#           seccompProfile:
#             type: RuntimeDefault
#   container:
#     merge:
#       securityContext:
#         runAsNonRoot: true
#         runAsUser: 1000
#         allowPrivilegeEscalation: false
#         readOnlyRootFilesystem: false
#         capabilities:
#           drop: ["ALL"]
#         seccompProfile:
#           type: RuntimeDefault

podSecurityContext:
  seccompProfile:
    type: RuntimeDefault

containerSecurityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - ALL
  privileged: false
  readOnlyRootFilesystem: false
  runAsNonRoot: true

coordinator:
  podSecurityContext:
    fsGroup: 999
    fsGroupChangePolicy: OnRootMismatch
  containerSecurityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
        - ALL
    privileged: false
    readOnlyRootFilesystem: false
    runAsGroup: 999
    runAsNonRoot: true
    runAsUser: 999
    seccompProfile:
      type: RuntimeDefault

engine:
  operator:
    podSecurityContext:
      fsGroupChangePolicy: Always
    containerSecurityContext:
      allowPrivilegeEscalation: false
      capabilities:
        drop:
          - ALL
      privileged: false
      readOnlyRootFilesystem: false
      runAsNonRoot: true
      seccompProfile:
        type: RuntimeDefault

catalog:
  containerSecurityContext:
    runAsUser: null
    runAsGroup: null
    runAsNonRoot: true
    privileged: false
    allowPrivilegeEscalation: false
    readOnlyRootFilesystem: true
    capabilities:
      drop:
        - ALL
  podSecurityContext:
    fsGroup: null
    seccompProfile:
      type: RuntimeDefault

mongodb:
  waitContainer:
    securityContext:
      allowPrivilegeEscalation: false
      capabilities:
        drop:
        - ALL
      privileged: false
      readOnlyRootFilesystem: true
      runAsNonRoot: true
  podSecurityContext:
    runAsUser: null
    runAsGroup: null
    fsGroup: null
    runAsNonRoot: true
    seccompProfile:
      type: RuntimeDefault
  containerSecurityContext:
    allowPrivilegeEscalation: false
    privileged: false
    readOnlyRootFilesystem: false
    runAsNonRoot: true
    capabilities:
      drop:
        - ALL

mongodbHooks:
  podSecurityContext:
    fsGroup: null
    seccompProfile:
      type: RuntimeDefault
  containerSecurityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
        - ALL
    readOnlyRootFilesystem: true
    runAsNonRoot: true
    runAsGroup: null
    runAsUser: null

mongodbOperator:
  podSecurityContext:
    runAsNonRoot: true
    runAsUser: null
    runAsGroup: null
    fsGroup: null

opensearch:
  setVMMaxMapCount: false
  podSecurityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
        - ALL
    readOnlyRootFilesystem: true
    runAsNonRoot: true
    seccompProfile:
      type: RuntimeDefault

opensearchOperator:
  manager:
    extraEnv:
      - name: SKIP_INIT_CONTAINER
        value: "true"

zookeeper:
  podSecurityContext:
    runAsUser: null
    fsGroup: null
    runAsNonRoot: true
  containerSecurityContext:
    privileged: false
    allowPrivilegeEscalation: false
    readOnlyRootFilesystem: false
    runAsNonRoot: true
    runAsUser: null
    runAsGroup: null
    capabilities:
      drop:
        - ALL
