Closed julienteisseire closed 1 month ago
I checked service account, agent role and role bindings.
Have you checked the RBAC config in namespace commanding
? argo-workflow
in commanding
does not have permission to access workflowtasksets.
I believed regarding role description that permissions have been set properly.
# kubectl get role workflow-engine-argo-workflows-workflow -n commanding -o yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
annotations:
meta.helm.sh/release-name: workflow-engine
meta.helm.sh/release-namespace: commanding
creationTimestamp: "2024-10-17T07:04:13Z"
labels:
app: workflow-controller
app.kubernetes.io/component: workflow-controller
app.kubernetes.io/instance: workflow-engine
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: argo-workflows-workflow-controller
app.kubernetes.io/part-of: argo-workflows
helm.sh/chart: argo-workflows-0.42.5
name: workflow-engine-argo-workflows-workflow
namespace: commanding
resourceVersion: "517"
uid: 19600453-b936-4301-b278-79fc685f365b
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- watch
- patch
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- watch
- apiGroups:
- ""
resources:
- pods/exec
verbs:
- create
- apiGroups:
- argoproj.io
resources:
- workflowtaskresults
verbs:
- create
- patch
- apiGroups:
- argoproj.io
resources:
- workflowtasksets
- workflowartifactgctasks
verbs:
- list
- watch
- apiGroups:
- argoproj.io
resources:
- workflowtasksets/status
- workflowartifactgctasks/status
verbs:
- patch
Is there any problem in the role definition ?
Do I need to add permission here in addition to list
and watch
for workflowtasksets
?
It is the default configuration after deployment using helm chart and specifying namespaced and commanding
as main namespace.
- apiGroups:
- argoproj.io
resources:
- workflowtaskresults
verbs:
- create
- patch
- apiGroups:
- argoproj.io
resources:
- workflowtasksets
- workflowartifactgctasks
verbs:
- list
- watch
- apiGroups:
- argoproj.io
resources:
- workflowtasksets/status
- workflowartifactgctasks/status
verbs:
- patch
Thank you
The role definition seems fine. Is there a correct rolebinding for argo-workflow
?
Yes I guess
# kubectl get rolebindings workflow-engine-argo-workflows-workflow -n commanding -o yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
annotations:
meta.helm.sh/release-name: workflow-engine
meta.helm.sh/release-namespace: commanding
creationTimestamp: "2024-10-17T08:17:44Z"
labels:
app: workflow-controller
app.kubernetes.io/component: workflow-controller
app.kubernetes.io/instance: workflow-engine
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: argo-workflows-workflow-controller
app.kubernetes.io/part-of: argo-workflows
helm.sh/chart: argo-workflows-0.42.5
name: workflow-engine-argo-workflows-workflow
namespace: commanding
resourceVersion: "491"
uid: fa683bed-3cb2-467b-a9be-fde121e1d9db
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: workflow-engine-argo-workflows-workflow
subjects:
- kind: ServiceAccount
name: argo-workflow
namespace: commanding
Here is my values.yaml for information :
workflow:
serviceAccount:
create: true
name: "argo-workflow"
rbac:
create: true
server:
authModes: [server]
secure: true
extraArgs:
- --namespaced
- --managed-namespace
- commanding
controller:
extraArgs:
- --namespaced
- --managed-namespace
- commanding
workflowNamespaces:
- commanding
- operations
- processing
configMap:
# -- Create a ConfigMap for the controller
create: false
But I also tried with basic setup (following installation here https://artifacthub.io/packages/helm/argo/argo-workflows ) with same error.
I try to understand why we have 4 serviceaccounts
,
kubectl get serviceaccounts -n commanding
NAME SECRETS AGE
argo-workflow 0 21m
default 0 21m
workflow-engine-argo-workflows-server 0 21m
workflow-engine-argo-workflows-workflow-controller 0 21m
which one executor is using and what should be the error conducting in this situation. Don't see.
Can you execute the following commands to check if the permissions are valid.
kubectl auth can-i list workflowtasksets --as=system:serviceaccount:commanding:argo-workflow -n commanding
kubectl auth can-i watch workflowtasksets --as=system:serviceaccount:commanding:argo-workflow -n commanding
Also, can you provide the detail yaml of the agent pod?
Of course.
kubectl auth can-i list workflowtasksets --as=system:serviceaccount:commanding:argo-workflow -n commanding
yes
kubectl auth can-i watch workflowtasksets --as=system:serviceaccount:commanding:argo-workflow -n commanding
yes
For the yaml detail of POD, which one ? the http-template ? If yes, please find it below :
I don't have a 403 error, but only an error in agent usage.
This error log is in debug mode, you should see logs like: Watch workflowtasksets 403
if debug mode is enabled.
However, all RBAC configs look good to me, so weird🤔.
Indeed, I just activated log debug and see the 403 error :
time="2024-10-17T12:03:37.725Z" level=info msg="Starting Workflow Executor" version=v3.5.11
time="2024-10-17T12:03:37.726Z" level=info msg="Starting Agent" requeueTime=10s taskWorkers=16 workflow=http-template-78cqr
time="2024-10-17T12:03:37.827Z" level=debug msg="Watch workflowtasksets 403"
Error: unknown (get workflowtasksets.argoproj.io)
But I don't understand why ...
Maybe an idea ... Since the beginning of my test, I have to create serviceaccount token
in the correct namespace for the http pod to init (post install script of helm chart) :
apiVersion: v1
kind: Secret
metadata:
name: argo-workflow.service-account-token
namespace: commanding
annotations:
kubernetes.io/service-account.name: default
type: kubernetes.io/service-account-token
Once I apply this serviceaccount token
, I can init and then fall in error 403 ...
But I don't know if the serviceaccount token
creation is normal and why do I have to do it manually after argoworkflow installation ? Maybe it could be the root cause of the problem ?
Shouldn't secret argo-workflow.service-account-token
be automatically generated by k8s when creating service account argo-workflow
?
apiVersion: v1
kind: Secret
metadata:
name: argo-workflow.service-account-token
namespace: commanding
annotations:
kubernetes.io/service-account.name: default # Why do you set the service account name to "default"? Should't it be "argo-workflow"?
type: kubernetes.io/service-account-token
I agree with you, I don't understand why I have to create serviceaccount token
manually (I discovered this error from pod describe).
If you have an idea for the token to be created automatically .. I'd appreciate.
But in any case, since I updated :
kubernetes.io/service-account.name: default
to
kubernetes.io/service-account.name: argo-workflow
http executor is working fine.
STEP TEMPLATE PODNAME DURATION MESSAGE
✔ http-template-4qmlz main
└─┬─✖ bad http received non-2xx response code: 404
└─✔ good http
I thank you a lot for your priceless help.
If you have an idea for the token to be created automatically .. I'd appreciate.
Maybe the latest version disabled this feature, it also not works in my k3s cluster.
Pre-requisites
:latest
image tag (i.e.quay.io/argoproj/workflow-controller:latest
) and can confirm the issue still exists on:latest
. If not, I have explained why, in detail, in my description below.What happened? What did you expect to happen?
Hello, I am trying HTTP template with the example workflow. Agent executor is in Crashloopbackoff after submitting my simple workflow. I work in a dedicated namespace : commanding
I checked service account, agent role and role bindings. I don't have a 403 error, but only an error in agent usage.
My kubectl status :
My error :
I tried everything in order to solve this issue, but I don't understand what is the cause of the error. NB : other workflows not using http template are working fine
Thank you
Version(s)
v3.5.11
Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
Logs from the workflow controller
Logs from in your workflow's wait container