如何通过src URL(不是本地文件)使用Ansible管理K8s对象?

问题描述 投票:1回答:1

我正在尝试使用Terraform部署Kubernetes集群,并使用Ansible部署K8s对象。一切正常,使用Ansible K8s,也可以从本地YAML文件进行部署,但是当我尝试使用here所述的网址进行查找时,出现错误:

错误!发现一名工人处于死亡状态

部分Ans​​ible任务:

- name: Fip-Controller rbac
  k8s:
    api_key: "{{ api_token }}"
    host: "{{ api_url }}"
    state: present
    definition: "{{ item }}"
  with_items: "{{lookup('url', 'https://raw.githubusercontent.com/cbeneke/hcloud-fip-controller/master/deploy/rbac.yaml', split_lines=False) | from_yaml_all | list}}"
  when: item is not none

我也尝试过与here (same link as above)所述的相同。

A related Github issue with the same error

如果有人能向我指出任何方向,我将不胜感激。从URL添加YAML是否有更好的解决方案?

Ansible:v2.9.1操作系统:macOS Mojave

kubernetes ansible terraform ansible-tasks
1个回答
1
投票

与OsX一起使用某些python软件包存在已知问题。导出此变量解决了我的问题:

EXPORT = OBJC_DISABLE_INITIALIZE_FORK_SAFETY

See this issue

© www.soinside.com 2019 - 2024. All rights reserved.