avinashpancham opened a new issue, #33539:
URL: https://github.com/apache/airflow/issues/33539

   ### Official Helm Chart version
   
   1.10.0 (latest released)
   
   ### Apache Airflow version
   
   2.6.2
   
   ### Kubernetes Version
   
   1.27.1
   
   ### Helm Chart configuration
   
   custom-values.yaml
   ```
   extraEnv: |
     - name: AIRFLOW__CORE__LOAD_EXAMPLES
       value: 'True'
   
   executor: "KubernetesExecutor"
   
   webserverConfig: |
     from airflow import configuration as conf
   
     AUTH_ROLE_PUBLIC = 'Admin'
   
   rbac:
     # Specifies whether RBAC resources should be created
     create: false
     createSCCRoleBinding: false
   
   ```
   
   ### Docker Image customizations
   
   _No response_
   
   ### What happened
   
   I ran `helm install airflow --namespace airflow -f custom-values.yaml .` on 
my Kind cluster with the above custom settings such that I do not get prompted 
for a login screen. I do this because I already have another internal login I 
am going to use. 
   
   With this setting (`rbac.create: false`) the scheduler pod will however 
fail. I get the following error:
   
   ```
   
   [2023-08-19T20:21:56.206+0000] {kubernetes_executor.py:1017} INFO - Shutting 
down Kubernetes executor
   [2023-08-19T20:21:57.235+0000] {process_utils.py:135} INFO - Sending 
Signals.SIGTERM to group 42. PIDs of all processes in the group: [64, 65, 42]
   [2023-08-19T20:21:57.235+0000] {process_utils.py:86} INFO - Sending the 
signal Signals.SIGTERM to group 42
   [2023-08-19T20:21:57.531+0000] {process_utils.py:258} INFO - Waiting up to 5 
seconds for processes to exit...
   [2023-08-19T20:21:57.570+0000] {process_utils.py:79} INFO - Process 
psutil.Process(pid=42, status='terminated', exitcode=0, started='20:21:56') 
(42) terminated with exit code 0
   [2023-08-19T20:21:57.571+0000] {process_utils.py:79} INFO - Process 
psutil.Process(pid=65, status='terminated', started='20:21:56') (65) terminated 
with exit code None
   [2023-08-19T20:21:57.572+0000] {process_utils.py:79} INFO - Process 
psutil.Process(pid=64, status='terminated', started='20:21:56') (64) terminated 
with exit code None
   [2023-08-19T20:21:57.573+0000] {scheduler_job_runner.py:864} INFO - Exited 
execute loop
   Traceback (most recent call last):
     File "/home/airflow/.local/bin/airflow", line 8, in <module>
       sys.exit(main())
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/__main__.py", line 
48, in main
       args.func(args)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/cli/cli_config.py", 
line 52, in command
       return func(*args, **kwargs)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/utils/cli.py", line 
112, in wrapper
       return f(*args, **kwargs)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/cli/commands/scheduler_command.py",
 line 77, in scheduler
       _run_scheduler_job(job_runner, skip_serve_logs=args.skip_serve_logs)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/cli/commands/scheduler_command.py",
 line 42, in _run_scheduler_job
       run_job(job=job_runner.job, execute_callable=job_runner._execute)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/utils/session.py", 
line 76, in wrapper
       return func(*args, session=session, **kwargs)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/jobs/job.py", line 
284, in run_job
       return execute_job(job, execute_callable=execute_callable)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/jobs/job.py", line 
313, in execute_job
       ret = execute_callable()
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/jobs/scheduler_job_runner.py",
 line 835, in _execute
       self._run_scheduler_loop()
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/jobs/scheduler_job_runner.py",
 line 919, in _run_scheduler_loop
       self.adopt_or_reset_orphaned_tasks()
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/utils/session.py", 
line 76, in wrapper
       return func(*args, session=session, **kwargs)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/jobs/scheduler_job_runner.py",
 line 1556, in adopt_or_reset_orphaned_tasks
       for attempt in run_with_db_retries(logger=self.log):
     File 
"/home/airflow/.local/lib/python3.7/site-packages/tenacity/__init__.py", line 
347, in __iter__
       do = self.iter(retry_state=retry_state)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/tenacity/__init__.py", line 
314, in iter
       return fut.result()
     File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in 
result
       return self.__get_result()
     File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in 
__get_result
       raise self._exception
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/jobs/scheduler_job_runner.py",
 line 1601, in adopt_or_reset_orphaned_tasks
       to_reset = 
self.job.executor.try_adopt_task_instances(tis_to_reset_or_adopt)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/executors/kubernetes_executor.py",
 line 859, in try_adopt_task_instances
       self._adopt_completed_pods(kube_client)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/executors/kubernetes_executor.py",
 line 954, in _adopt_completed_pods
       pod_list = self._list_pods(query_kwargs)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/executors/kubernetes_executor.py",
 line 525, in _list_pods
       namespace=self.kube_config.kube_namespace, **query_kwargs
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api/core_v1_api.py",
 line 15697, in list_namespaced_pod
       return self.list_namespaced_pod_with_http_info(namespace, **kwargs)  # 
noqa: E501
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api/core_v1_api.py",
 line 15826, in list_namespaced_pod_with_http_info
       collection_formats=collection_formats)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api_client.py",
 line 353, in call_api
       _preload_content, _request_timeout, _host)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api_client.py",
 line 184, in __call_api
       _request_timeout=_request_timeout)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api_client.py",
 line 377, in request
       headers=headers)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/rest.py", 
line 244, in GET
       query_params=query_params)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/rest.py", 
line 234, in request
       raise ApiException(http_resp=r)
   kubernetes.client.exceptions.ApiException: (403)
   Reason: Forbidden
   HTTP response headers: HTTPHeaderDict({'Audit-Id': 
'1909c5b4-75fa-4663-98b0-4e27dfe4524b', 'Cache-Control': 'no-cache, private', 
'Content-Type': 'application/json', 'X-Content-Type-Options': 'nosniff', 
'X-Kubernetes-Pf-Flowschema-Uid': '74962d91-56eb-4f14-bb09-4efd008a9e14', 
'X-Kubernetes-Pf-Prioritylevel-Uid': 'eb685615-d606-43bd-a2a2-8e9387039d4d', 
'Date': 'Sat, 19 Aug 2023 20:21:56 GMT', 'Content-Length': '292'})
   HTTP response body: 
{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods
 is forbidden: User \"system:serviceaccount:airflow:airflow-scheduler\" cannot 
list resource \"pods\" in API group \"\" in the namespace 
\"airflow\"","reason":"Forbidden","details":{"kind":"pods"},"code":403}
   ```
   
   
   ### What you think should happen instead
   
   All Airflow pods should spin up and the webserver should not prompt me for 
the login credentials.
   
   ### How to reproduce
   
   `helm install airflow --namespace airflow -f custom-values.yaml .` with 
chart 1.10 and the earlier mentioned custom-values.yaml
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to