首页 > 解决方案 > 无法在 Kops 实例上安装 istio

问题描述

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

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

然后,当我使用列出 pod 时,我kubectl get pod -n istio-system看不到 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

Ps:关于问题的更新:1。

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

标签: kubernetesistio

解决方案


您可以使用以下方式检查哪些 API 支持当前 Kubernetes 对象

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

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

两种解决方案:

  1. istio-demo.yaml任何你有Deployment改变apiVersionextensions/v1beta1地方apps/v1

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

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


推荐阅读