0

我使用 kubespray v2.11.2 来设置 kubernetes 集群。但是,错误发生在“无法解析模块/操作'kube'”:

- name: Kubernetes Apps | Add policies, roles, bindings for PodSecurityPolicy
  kube:
    name: "{{ item.item.name }}"
    kubectl: "{{ bin_dir }}/kubectl"
    resource: "{{ item.item.type }}"
    filename: "{{ kube_config_dir }}/{{ item.item.file }}"
    state: "latest"
  register: result
  until: result is succeeded
  retries: 10
  delay: 6
  with_items: "{{ psp_manifests.results }}"
  when:
    - inventory_hostname == groups['kube-master'][0]
    - not item is skipped
  loop_control:
    label: "{{ item.item.file }}"

这是在https://github.com/kubernetes-sigs/kubespray/blob/324106e91e3febdf75228b0883fff170bb28984c/roles/kubernetes-apps/cluster_roles/tasks/main.yml#L43

我是否错过了用“kube”创建“新”模块/动作的东西?

提前致谢!

4

1 回答 1

0

好吧,我自己回答。显然,原因是缺少“kube”模块。因此,它必须在某个地方定义“kube”模块。是的,它在 kubespray/library/kube.py 中

于 2020-05-08T11:42:49.193 回答