【问题标题】:Unable to install istio on Kops instance无法在 Kops 实例上安装 istio
【发布时间】:2020-05-05 20:31:15
【问题描述】:

我正在尝试在 Kubernetes 集群上安装 Istio。我创建了一个三节点集群并安装了 istioctl 1.1.0 版本。 istio 安装附带一个位于install/kubernetes/istio-demo.yaml 目录中的istio-demo.yaml 文件。当我运行kubectl apply -f install/kubernetes/istio-demo.yaml 命令时,我得到了以下输出。

然后我使用kubectl get svc -n istio-system 列出了服务,我正在查看服务

然后,当我使用 kubectl get pod -n istio-system 列出 pod 时,我看不到这些 pod。我哪里错了?

rule.config.istio.io/tcpkubeattrgenrulerule created
    kubernetes.config.istio.io/attributes created
    destinationrule.networking.istio.io/istio-policy created
    destinationrule.networking.istio.io/istio-telemetry created
    unable to recognize "install/kubernetes/istio-demo.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
    unable to recognize "install/kubernetes/istio-demo.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
    unable to recognize "install/kubernetes/istio-demo.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
    unable to recognize "install/kubernetes/istio-demo.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
    unable to recognize "install/kubernetes/istio-demo.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
    unable to recognize "install/kubernetes/istio-demo.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
    unable to recognize "install/kubernetes/istio-demo.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

istio-1.1.0]$ kubectl get namespaces
NAME              STATUS   AGE
default           Active   11m
istio-system      Active   100s
kube-node-lease   Active   11m
kube-public       Active   11m
kube-system       Active   11m

kubectl get pod -n istio-system
NAME                                      READY   STATUS      RESTARTS   AGE
istio-cleanup-secrets-1.1.0-fbr87         0/1     Completed   0          3m27s
istio-grafana-post-install-1.1.0-kwz58    0/1     Completed   0          3m27s
istio-security-post-install-1.1.0-mc9wk   0/1     Completed   0          3m27s

P.s:关于问题的更新: 1.

$ kubectl api-resources | grep deployment
deployments                       deploy       apps                           true
     Deployment
  1. 客户端版本:version.Info{Major:"1", Minor:"17"

【问题讨论】:

    标签: kubernetes istio


    【解决方案1】:

    您可以使用检查哪些 api 支持当前的 Kubernetes 对象

    $ kubectl api-resources | grep deployment
    deployments                       deploy       apps                           true         Deployment
    

    所以您正在尝试使用已弃用的apiVersion extensions/v1beta1。这在 kubernetes 版本 1.16 中已被弃用。您似乎有一个高于 1.16 版本的 kubernetes 集群。

    两种解决方案:

    1. istio-demo.yaml 中,无论您有Deployment,将apiVersionextensions/v1beta1 更改为apps/v1

    2. Istio 1.1 已经很老了,所以建议将其升级到最新版本,这样应该可以解决问题。

    还可以通过运行kubectl version 验证 kubectl 客户端版本和 Kubernetes 服务器版本是否匹配

    【讨论】:

    • 正如在 yaml 中的答案中解释的那样,无论您有 Deployment,请将 apiVersion 从 extensions/v1beta1 更改为 apps/v1
    猜你喜欢
    • 2019-03-11
    • 2020-07-18
    • 2016-11-14
    • 1970-01-01
    • 2018-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多