无法执行K8S模块

时间:2019-12-12 12:46:28

标签: macos kubernetes ansible minikube

我在tasks/main.yml中的代码。

- name: Check Istio services
  k8s_info:
    api_version: v1
    kind: Service
    namespace: istio-system

但是返回;

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named kubernetes
fatal: [localhost]: FAILED! => {"changed": false, "error": "No module named kubernetes",

"msg": "Failed to import the required Python library (openshift) on Gihu's-MacBook-Pro.local's Python /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python.

为什么会发生此问题?

1 个答案:

答案 0 :(得分:0)

执行命令;

sudo pip install --upgrade --user openshift