Skip to content

feat: add per-component priorityClassName to ArgoCD CRD (RFE-8802)#1189

Open
aradhanay621 wants to merge 1 commit into
redhat-developer:masterfrom
aradhanay621:feat/per-component-priorityClassName-rfe-8802
Open

feat: add per-component priorityClassName to ArgoCD CRD (RFE-8802)#1189
aradhanay621 wants to merge 1 commit into
redhat-developer:masterfrom
aradhanay621:feat/per-component-priorityClassName-rfe-8802

Conversation

@aradhanay621

Copy link
Copy Markdown

Summary

Exposes priorityClassName per core ArgoCD component in the ArgoCD Custom Resource, resolving RFE-8802.

Without this field, ArgoCD pods use the cluster's global default PriorityClass and are at risk of eviction during resource contention. This change gives cluster administrators fine-grained control over scheduling priority per component.

New fields

Field Workload
spec.controller.priorityClassName Application Controller StatefulSet
spec.server.priorityClassName ArgoCD Server Deployment
spec.repo.priorityClassName Repo Server Deployment
spec.redis.priorityClassName Redis Deployment
spec.applicationSet.priorityClassName ApplicationSet Controller Deployment
spec.sso.dex.priorityClassName Dex Server Deployment

Changes

  • config/crd/bases/argoproj.io_argocds.yaml — CRD base schema updated for v1alpha1 and v1beta1
  • bundle/manifests/argoproj.io_argocds.yaml — OLM bundle manifest updated for v1alpha1 and v1beta1

Example usage

apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: argocd-instance
spec:
  controller:
    priorityClassName: high-priority
  server:
    priorityClassName: high-priority
  repo:
    priorityClassName: high-priority
  redis:
    priorityClassName: high-priority
  applicationSet:
    priorityClassName: high-priority
  sso:
    dex:
      priorityClassName: high-priority

Upstream dependency

The controller-side implementation (Go type definitions, reconcilers, conversion functions between v1alpha1v1beta1, and unit tests) is tracked upstream in argoproj-labs/argocd-operator#2125. The go.mod dependency bump will follow once that upstream change is merged and tagged.

Resolves: RFE-8802

@openshift-ci openshift-ci Bot requested review from svghadi and trdoyle81 June 23, 2026 14:18
@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jannfis for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown

Hi @aradhanay621. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 67d749b5-7bfd-4d28-b463-776df8527826

📥 Commits

Reviewing files that changed from the base of the PR and between 4322bd3 and 37f927f.

📒 Files selected for processing (2)
  • bundle/manifests/argoproj.io_argocds.yaml
  • config/crd/bases/argoproj.io_argocds.yaml
 ______________________________________________________
< Multiplying to perform multi-threaded bug detection. >
 ------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
📝 Walkthrough

Walkthrough

This change adds an optional priorityClassName string field to multiple Argo CD component schema sections in the base CRD and the generated bundle manifest, covering ApplicationSet, Redis, repo-server, server, and Dex-related configurations.

Changes

PriorityClass schema exposure

Layer / File(s) Summary
Base CRD schema fields
config/crd/bases/argoproj.io_argocds.yaml
Adds priorityClassName with description and type: string to multiple component configuration sections in the base Argo CD CRD schema.
Generated bundle schema sync
bundle/manifests/argoproj.io_argocds.yaml
Mirrors the same priorityClassName schema additions in the generated operator bundle manifest for the corresponding component sections.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: adding per-component priorityClassName support to the ArgoCD CRD, with reference to the tracking issue RFE-8802.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, including detailed summary, field mappings, file changes, example usage, and upstream dependency context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bundle/manifests/argoproj.io_argocds.yaml`:
- Around line 253-257: The CRD schema now accepts priorityClassName fields in
multiple component configurations, but the corresponding Go API struct fields
are missing from api/v1beta1/argocd_types.go and the reconciliation logic to
apply these values to pod specs is missing from
controllers/argocd/deployment.go. Add the priorityClassName fields to the
relevant Go struct definitions in the API types, and then update the controller
logic in the pod/deployment creation methods to read these priorityClassName
values from the CR and apply them to the generated pod specs (by setting the
PriorityClassName field on the PodSpec). Apply these changes to all locations
mentioned in the line ranges.

In `@config/crd/bases/argoproj.io_argocds.yaml`:
- Around line 242-246: The priorityClassName schema field is exposed in the CRD
but lacks corresponding API struct fields and reconciliation logic in the
operator to actually apply it to PodSpec.PriorityClassName, causing the field to
be silently ignored at runtime. Either remove all priorityClassName schema
additions (including those at lines 1244-1248, 2461-2465, 4258-4262, 8290-8294,
8509-8513, 9164-9168, 13724-13728, 18621-18625, 20437-20441, 26245-26249,
30110-30114) from this CRD definition, or ensure the corresponding API struct
field and controller reconciliation logic are implemented in the
argoproj-labs/argocd-operator to actually set and apply the priorityClassName
value before merging this schema change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: beff128e-bd41-4675-8abd-f5ac758d50fc

📥 Commits

Reviewing files that changed from the base of the PR and between 8fa22b8 and 4322bd3.

📒 Files selected for processing (2)
  • bundle/manifests/argoproj.io_argocds.yaml
  • config/crd/bases/argoproj.io_argocds.yaml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

Comment on lines +253 to +257
priorityClassName:
description: |-
PriorityClassName is the name of the PriorityClass resource to assign to this component's
pod. The PriorityClass must already exist in the cluster.
type: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Schema exposes priorityClassName, but runtime contract is incomplete.

These CRD fields are now accepted, but the linked codebase findings show no matching Go API fields in api/v1beta1/argocd_types.go and no reconciliation logic applying PriorityClassName to pod specs (for example in controllers/argocd/deployment.go). This makes the feature a silent no-op at runtime.

Please land the corresponding API struct fields (v1alpha1/v1beta1 as applicable) and controller wiring before release so accepted CR input is actually enforced on workloads.

As per path instructions, “Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.”

Also applies to: 1255-1259, 2472-2476, 4269-4273, 8301-8305, 8520-8524, 9175-9179, 13735-13739, 18632-18636, 20448-20452, 26256-26260, 30121-30125

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bundle/manifests/argoproj.io_argocds.yaml` around lines 253 - 257, The CRD
schema now accepts priorityClassName fields in multiple component
configurations, but the corresponding Go API struct fields are missing from
api/v1beta1/argocd_types.go and the reconciliation logic to apply these values
to pod specs is missing from controllers/argocd/deployment.go. Add the
priorityClassName fields to the relevant Go struct definitions in the API types,
and then update the controller logic in the pod/deployment creation methods to
read these priorityClassName values from the CR and apply them to the generated
pod specs (by setting the PriorityClassName field on the PodSpec). Apply these
changes to all locations mentioned in the line ranges.

Sources: Path instructions, Linked repositories

Comment on lines +242 to +246
priorityClassName:
description: |-
PriorityClassName is the name of the PriorityClass resource to assign to this component's
pod. The PriorityClass must already exist in the cluster.
type: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Schema/controller contract is currently broken for priorityClassName.

These schema additions expose priorityClassName, but the linked argoproj-labs/argocd-operator findings show no corresponding API struct fields and no reconciliation logic applying PodSpec.PriorityClassName. In that state, users can set the field in CRs and it will be silently ignored at runtime. Please ship this schema change together with (or gated behind) the API/controller implementation to avoid a no-op user-facing feature.

As per path instructions, this focuses on a major cross-layer integration issue and avoids minor/nitpick feedback.

Also applies to: 1244-1248, 2461-2465, 4258-4262, 8290-8294, 8509-8513, 9164-9168, 13724-13728, 18621-18625, 20437-20441, 26245-26249, 30110-30114

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/crd/bases/argoproj.io_argocds.yaml` around lines 242 - 246, The
priorityClassName schema field is exposed in the CRD but lacks corresponding API
struct fields and reconciliation logic in the operator to actually apply it to
PodSpec.PriorityClassName, causing the field to be silently ignored at runtime.
Either remove all priorityClassName schema additions (including those at lines
1244-1248, 2461-2465, 4258-4262, 8290-8294, 8509-8513, 9164-9168, 13724-13728,
18621-18625, 20437-20441, 26245-26249, 30110-30114) from this CRD definition, or
ensure the corresponding API struct field and controller reconciliation logic
are implemented in the argoproj-labs/argocd-operator to actually set and apply
the priorityClassName value before merging this schema change.

Sources: Path instructions, Linked repositories

Expose priorityClassName in the ArgoCD Custom Resource for each core
component so cluster administrators can control pod scheduling priority
and prevent eviction during resource contention.

The following components now support spec.<component>.priorityClassName:
- spec.controller.priorityClassName (Application Controller StatefulSet)
- spec.server.priorityClassName (ArgoCD Server Deployment)
- spec.repo.priorityClassName (Repo Server Deployment)
- spec.redis.priorityClassName (Redis Deployment)
- spec.applicationSet.priorityClassName (ApplicationSet Controller)
- spec.sso.dex.priorityClassName (Dex Server Deployment)

CRD schemas updated for both v1alpha1 and v1beta1 API versions in
config/crd/bases/ and bundle/manifests/.

Upstream argocd-operator changes (type definitions, controllers, unit
tests, and conversion functions) are tracked separately in:
  argoproj-labs/argocd-operator#2125

Resolves: RFE-8802
Co-authored-by: Cursor <cursoragent@cursor.com>
@aradhanay621 aradhanay621 force-pushed the feat/per-component-priorityClassName-rfe-8802 branch from 4322bd3 to 37f927f Compare June 23, 2026 14:46
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant