气流k8s操作员xcom-禁止握手状态403

时间:2018-12-18 06:15:24

标签: kubernetes airflow kubernetes-python-client apache-airflow-xcom

当我在Airflow版本1.10中使用 KubernetesPodOperator 运行docker映像时

pod成功完成任务后,气流尝试通过k8s流客户端连接到pod来获取xcom值。

以下是我遇到的错误:

[2018-12-18 05:29:02,209] {{models.py:1760}} ERROR - (0)
Reason: Handshake status 403 Forbidden
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/kubernetes/stream/ws_client.py", line 249, in websocket_call
    client = WSClient(configuration, get_websocket_url(url), headers)
  File "/usr/local/lib/python3.6/site-packages/kubernetes/stream/ws_client.py", line 72, in __init__
    self.sock.connect(url, header=header)
  File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 223, in connect
    self.handshake_response = handshake(self.sock, *addrs, **options)
  File "/usr/local/lib/python3.6/site-packages/websocket/_handshake.py", line 79, in handshake
    status, resp = _get_resp_headers(sock)
  File "/usr/local/lib/python3.6/site-packages/websocket/_handshake.py", line 152, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d %s", status, status_message)
websocket._exceptions.WebSocketBadStatusException: Handshake status 403 Forbidden
  

我正在为此使用K8s服务帐户

DAG配置

  

xcom = true,

     

get_logs = True,

     

in_cluster = true

1 个答案:

答案 0 :(得分:3)

所以我们也遇到了这个问题,我们不得不修改rbac规则,特别是必须添加动词“ create”和“ get”的资源“ pods / exec”

nuget.exe