-
Notifications
You must be signed in to change notification settings - Fork 90
docs: add podConfig documentation for tolerations, nodeSelector, labels, and env #2196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kaovilai
wants to merge
1
commit into
openshift:oadp-dev
Choose a base branch
from
kaovilai:docs-podconfig-tolerations-nodeselector
base: oadp-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+179
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| <hr style="height:1px;border:none;color:#333;"> | ||
| <h1 align="center">Pod Configuration (podConfig)</h1> | ||
| <hr style="height:1px;border:none;color:#333;"> | ||
|
|
||
| The `podConfig` field is available under both `configuration.velero` and `configuration.nodeAgent` in the DataProtectionApplication (DPA) CR. It allows customizing the pod scheduling and runtime configuration for Velero Deployment pods and Node Agent DaemonSet pods respectively. | ||
|
|
||
| See also the [Red Hat PodConfig API reference](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/backup_and_restore/oadp-application-backup-and-restore#podconfig-type_oadp-api) for the official supported documentation. | ||
|
|
||
| All available `podConfig` fields can be discovered from your cluster using: | ||
|
|
||
| ``` | ||
| oc explain dataprotectionapplication.spec.configuration.velero.podConfig | ||
| oc explain dataprotectionapplication.spec.configuration.nodeAgent.podConfig | ||
| ``` | ||
|
|
||
| The full CRD schema can also be inspected with: | ||
|
|
||
| ``` | ||
| oc get crd dataprotectionapplications.oadp.openshift.io -o yaml | ||
| ``` | ||
|
|
||
| ### Available Fields | ||
|
|
||
| | Field | Type | Description | | ||
|
Comment on lines
+20
to
+24
|
||
| |-------|------|-------------| | ||
| | `tolerations` | `[]corev1.Toleration` | Tolerations to apply to the pod, allowing scheduling on tainted nodes | | ||
| | `nodeSelector` | `map[string]string` | Node labels required for pod scheduling | | ||
| | `resourceAllocations` | `corev1.ResourceRequirements` | CPU, memory, and ephemeral-storage resource requests and limits | | ||
| | `labels` | `map[string]string` | Additional labels to add to pods | | ||
| | `env` | `[]corev1.EnvVar` | Environment variables to add to the pod | | ||
|
|
||
| ### Tolerations | ||
|
|
||
| To schedule Velero or Node Agent pods on nodes with taints, configure tolerations under `podConfig`. | ||
|
|
||
| This is commonly needed when: | ||
| - Critical workloads run on tainted nodes and Node Agent must be present for PVC backup | ||
| - Infrastructure nodes have taints that prevent general workload scheduling | ||
|
|
||
| **Example: Node Agent on tainted nodes** | ||
|
|
||
| If your cluster has nodes with taint `critical=reserved:NoSchedule` and you need Node Agent pods to run there for PVC data backup: | ||
|
|
||
| ```yaml | ||
| apiVersion: oadp.openshift.io/v1alpha1 | ||
| kind: DataProtectionApplication | ||
| metadata: | ||
| name: dpa-sample | ||
| namespace: openshift-adp | ||
| spec: | ||
| configuration: | ||
| nodeAgent: | ||
| enable: true | ||
| uploaderType: kopia | ||
| podConfig: | ||
| tolerations: | ||
| - key: "critical" | ||
| operator: "Equal" | ||
| value: "reserved" | ||
| effect: "NoSchedule" | ||
| velero: | ||
| defaultPlugins: | ||
| - openshift | ||
|
|
||
| - csi | ||
| backupLocations: | ||
| - velero: | ||
| provider: aws | ||
| default: true | ||
| objectStorage: | ||
| bucket: my-bucket | ||
| prefix: my-prefix | ||
| config: | ||
| region: us-east-1 | ||
| credential: | ||
| name: cloud-credentials | ||
| key: cloud | ||
| ``` | ||
|
|
||
| **Example: Velero on tainted nodes** | ||
|
|
||
| ```yaml | ||
| configuration: | ||
| velero: | ||
| podConfig: | ||
| tolerations: | ||
| - key: "node-role.kubernetes.io/infra" | ||
| operator: "Exists" | ||
| effect: "NoSchedule" | ||
| ``` | ||
|
|
||
| <b>Note:</b> Tolerations must be placed under `podConfig`, not directly under `nodeAgent` or `velero`. For example, `spec.configuration.nodeAgent.tolerations` is **not valid** and will be rejected by CRD validation. The correct path is `spec.configuration.nodeAgent.podConfig.tolerations`. | ||
|
|
||
| ### Node Selector | ||
|
|
||
| To restrict Velero or Node Agent pods to specific nodes, use `nodeSelector` under `podConfig`. | ||
|
|
||
| ```yaml | ||
| configuration: | ||
| velero: | ||
| podConfig: | ||
| nodeSelector: | ||
| node-role.kubernetes.io/infra: "" | ||
| nodeAgent: | ||
| enable: true | ||
| uploaderType: kopia | ||
| podConfig: | ||
| nodeSelector: | ||
| node-role.kubernetes.io/infra: "" | ||
| ``` | ||
|
|
||
| <b>Note:</b> Like tolerations, `nodeSelector` must be placed under `podConfig`. The path `spec.configuration.nodeAgent.nodeSelector` is **not valid**. | ||
|
|
||
| ### Resource Allocations | ||
|
|
||
| See [resource_req_limits.md](resource_req_limits.md) for detailed documentation on setting CPU, memory, and ephemeral-storage resource requests and limits. | ||
|
|
||
| ### Labels | ||
|
|
||
| To add custom labels to Velero or Node Agent pods: | ||
|
|
||
| ```yaml | ||
| configuration: | ||
| velero: | ||
| podConfig: | ||
| labels: | ||
| app.kubernetes.io/part-of: "backup-system" | ||
| nodeAgent: | ||
| enable: true | ||
| uploaderType: kopia | ||
| podConfig: | ||
| labels: | ||
| app.kubernetes.io/part-of: "backup-system" | ||
| ``` | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| To set environment variables on Velero or Node Agent pods: | ||
|
|
||
| ```yaml | ||
| configuration: | ||
| velero: | ||
| podConfig: | ||
| env: | ||
| - name: HTTP_PROXY | ||
| value: "http://proxy.example.com:8080" | ||
| - name: HTTPS_PROXY | ||
| value: "http://proxy.example.com:8080" | ||
| - name: NO_PROXY | ||
| value: ".cluster.local,.svc,10.0.0.0/8" | ||
| ``` | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language specifiers to fenced code blocks.
The code blocks showing
occommands should specify a language identifier for better syntax highlighting and to comply with markdown best practices.📝 Proposed fix
The full CRD schema can also be inspected with:
-
+shelloc get crd dataprotectionapplications.oadp.openshift.io -o yaml
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 9-9: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
[warning] 16-16: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents