Skip to content
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

ArgoCD 2.8 should support creating jobs #2194

Closed
jsoref opened this issue Jul 28, 2023 · 3 comments · Fixed by #2212
Closed

ArgoCD 2.8 should support creating jobs #2194

jsoref opened this issue Jul 28, 2023 · 3 comments · Fixed by #2212
Labels
argo-cd awaiting-upstream Is waiting for a change upstream to be completed before it can be merged. enhancement New feature or request

Comments

@jsoref
Copy link
Member

jsoref commented Jul 28, 2023

Is your feature request related to a problem?

Installing the latest version of argocd from this helm repo gives me a 2.8 (or newer?) without the ability to create jobs

Related helm chart

argo-cd

Describe the solution you'd like

Here's roughly the code I used to enable our instance to create jobs:

diff --git a/apps/charts/argocd/templates/argocd-create-job-role-binding.yaml b/apps/charts/argocd/templates/argocd-create-job-role-binding.yaml
new file mode 100644
index 000000000..0fae2c341
--- /dev/null
+++ b/apps/charts/argocd/templates/argocd-create-job-role-binding.yaml
@@ -0,0 +1,12 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: argocd-create-job
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: argocd-create-job
+subjects:
+- kind: ServiceAccount
+  name: argocd-server
+  namespace: {{ .Release.Namespace }}
diff --git a/apps/charts/argocd/templates/argocd-create-job-role.yaml b/apps/charts/argocd/templates/argocd-create-job-role.yaml
new file mode 100644
index 000000000..ed1604d3f
--- /dev/null
+++ b/apps/charts/argocd/templates/argocd-create-job-role.yaml
@@ -0,0 +1,11 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: argocd-create-job
+rules:
+- apiGroups:
+  - "batch"
+  resources:
+  - jobs
+  verbs:
+  - create

You should be able to add the role bits into the existing CR.

Describe alternatives you've considered

No response

Additional context

argoproj/argo-cd#12925 added the feature

@jsoref jsoref added the enhancement New feature or request label Jul 28, 2023
@pdrastil
Copy link
Member

pdrastil commented Jul 29, 2023

Hi - I'm not sure if this relates to Argo CD. Version 2.8 is not released yet and Argo CD UI server do not create any kind of batch jobs in the cluster for it's proper functionality.

EDIT: After looking into upstream manifests for 2.8 it seems as UI customisation action and we will test this when released.

@pdrastil pdrastil added the awaiting-upstream Is waiting for a change upstream to be completed before it can be merged. label Jul 29, 2023
@FernandoMiguel
Copy link

v2.8.0 is out... but no chart release just yet.
waiting patiently

@trevorlauder
Copy link

The new chart supporting v2.8.0 is missing the updates needed for the Role/ClusterRole to support CronJob triggering.

Unable to execute resource action: jobs.batch is forbidden: User "system:serviceaccount:argocd:argocd-server" cannot create resource "jobs" in API group "batch" in the namespace ""

@mkilchhofer mkilchhofer linked a pull request Aug 9, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
argo-cd awaiting-upstream Is waiting for a change upstream to be completed before it can be merged. enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants