Skip to content

    Default Pod Settings

    This page describes how to configure the default settings for pods spawned by the operator.

    There are multiple ways to configure the pods in the kannika-operator Helm chart:

    To specify settings for individual pods, check the Backup Pod and Restore Pod documentation.

    Default Resource Requirements

    To set the default resource requirements for all pods spawned by the operator, override the config.pod.resources object in the kannika-operator Helm chart:

    values.yaml
    config:
    pod:
    resources:
    requests:
    memory: "64Mi"
    cpu: "100m"
    limits:
    memory: "1Gi"
    cpu: "1000m"

    To set the default resource requirements for backup pods, override the backup.config.pod.resources object:

    values.yaml
    backup:
    config:
    pod:
    resources:
    requests:
    memory: "64Mi"
    cpu: "100m"
    limits:
    memory: "1Gi"
    cpu: "1000m"

    To set the default resource requirements for restore pods, override the restore.config.pod.resources object:

    values.yaml
    restore:
    config:
    pod:
    resources:
    requests:
    memory: "64Mi"
    cpu: "100m"
    limits:
    memory: "1Gi"
    cpu: "1000m"

    Default Service Account Name

    To set the default service account used by pods spawned by the operator, override the config.pod.serviceAccountName value in the kannika-operator Helm chart.

    values.yaml
    config:
    pod:
    serviceAccountName: "global-service-account"

    To set the default service account used by backup pods, override backup.config.pod.serviceAccountName:

    values.yaml
    backup:
    config:
    pod:
    serviceAccountName: "backup-service-account"

    To set the default service account used by restore pods, override restore.config.pod.serviceAccountName:

    values.yaml
    restore:
    config:
    pod:
    serviceAccountName: "restore-service-account"

    Default Image Pull Secrets

    Normally, image pull secrets are defined using the root imagePullSecrets or global.imagePullSecrets field in the Helm charts, as documented in the Private image registry support section.

    However, if you wish to set different image pull secrets for pods spawned by the operator, it is possible to override the config.pod.imagePullSecrets value in the kannika-operator Helm chart.

    values.yaml
    config:
    pod:
    imagePullSecrets:
    - name: my-secret

    To set the default image pull secrets used by backup pods, override backup.config.pod.imagePullSecrets:

    values.yaml
    backup:
    config:
    pod:
    imagePullSecrets:
    - name: my-secret

    To set the default image pull secrets used by restore pods, override restore.config.pod.imagePullSecrets:

    values.yaml
    restore:
    config:
    pod:
    imagePullSecrets:
    - name: my-secret

    Default Pod Security Context

    To set the default security context for pods spawned by the operator, override the config.pod.securityContext object in the kannika-operator Helm chart.

    Example:

    values.yaml
    config:
    pod:
    securityContext:
    runAsUser: 1000

    To set the default security context for backup pods, override backup.config.pod.securityContext:

    values.yaml
    backup:
    config:
    pod:
    securityContext:
    runAsUser: 1000

    To set the default security context for restore pods, override restore.config.pod.securityContext:

    values.yaml
    restore:
    config:
    pod:
    securityContext:
    runAsUser: 1000

    Container Security Context

    To set the default security context for containers spawned by the operator, override the config.container.pod.securityContext object in the kannika-operator Helm chart.

    values.yaml
    config:
    container:
    pod:
    securityContext:
    runAsUser: 1000

    To set the default security context for backup containers, override config.backup.pod.container.securityContext:

    values.yaml
    config:
    backup:
    pod:
    container:
    securityContext:
    runAsUser: 1000

    To set the default security context for restore containers, override config.restore.pod.container.securityContext:

    values.yaml
    config:
    restore:
    pod:
    container:
    securityContext:
    runAsUser: 1000

    Default Tolerations

    To set the default tolerations for pods spawned by the operator, override the config.pod.tolerations array in the kannika-operator Helm chart.

    values.yaml
    config:
    pod:
    tolerations:
    - key: "key"
    operator: "Equal"
    value: "value"
    effect: "NoSchedule"

    To set the default tolerations for backup pods, override backup.config.pod.tolerations:

    values.yaml
    backup:
    config:
    pod:
    tolerations:
    - key: "key"
    operator: "Equal"
    value: "value"
    effect: "NoSchedule"

    To set the default tolerations for restore pods, override restore.config.pod.tolerations:

    values.yaml
    restore:
    config:
    pod:
    tolerations:
    - key: "key"
    operator: "Equal"
    value: "value"
    effect: "NoSchedule"

    Default Affinity

    To set the default affinity for pods spawned by the operator, override the config.pod.affinity object in the kannika-operator Helm chart.

    Example:

    values.yaml
    config:
    pod:
    affinity:
    nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchExpressions:
    - key: topology.kubernetes.io/zone
    operator: In
    values:
    - antarctica-east1
    - antarctica-west1

    To set the default affinity for backup pods, override backup.config.pod.affinity:

    values.yaml
    backup:
    config:
    pod:
    affinity:
    9 collapsed lines
    nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchExpressions:
    - key: topology.kubernetes.io/zone
    operator: In
    values:
    - antarctica-east1
    - antarctica-west1

    To set the default affinity for restore pods, override restore.config.pod.affinity:

    values.yaml
    restore:
    config:
    pod:
    affinity:
    9 collapsed lines
    nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchExpressions:
    - key: topology.kubernetes.io/zone
    operator: In
    values:
    - antarctica-east1
    - antarctica-west1

    Default Node Selector

    To set the default node selector for pods spawned by the operator, override the config.pod.nodeSelector object in the kannika-operator Helm chart.

    values.yaml
    config:
    pod:
    nodeSelector:
    location: the-moon

    To set the default node selector for backup pods, override backup.config.pod.nodeSelector:

    values.yaml
    backup:
    config:
    pod:
    nodeSelector:
    location: the-moon

    To set the default node selector for restore pods, override restore.config.pod.nodeSelector:

    values.yaml
    restore:
    config:
    pod:
    nodeSelector:
    location: the-moon

    Probes

    It is possible to override the default probes for backup and restore containers. By default, only readiness and liveness probes are configured for the backup and restore containers, which checks the /metrics path on port 9000 (the metrics port).

    values.yaml
    config:
    backup:
    pod:
    container:
    livenessProbe:
    initialDelaySeconds: 1
    periodSeconds: 60
    timeoutSeconds: 5
    successThreshold: 1
    failureThreshold: 3
    httpGet:
    path: /metrics
    port: 9000
    # readinessProbe: ...
    # startupProbe: ...
    restore:
    pod:
    container:
    livenessProbe:
    initialDelaySeconds: 1
    periodSeconds: 60
    timeoutSeconds: 5
    successThreshold: 1
    failureThreshold: 3
    httpGet:
    path: /metrics
    port: 9000
    # readinessProbe: ...
    # startupProbe: ...