如何在Kubernetes上使用Istio服务网格设置Java微服务 - wpsshop博客
当前位置:   article > 正文

如何在Kubernetes上使用Istio服务网格设置Java微服务

kubesphere 使用istio作为服务网关

Øriginally published in deepu.tech.

Originally published at Medium on 17-Nov-2018. This post has been updated since to work with the latest version of JHipster(6.3.0) and Istio(1.3.0).


Istio is the coolest kid on the DevOps and Cloud block now. For those of you who aren’t following close enough — 一世stio is a service mesh for distributed application architectures, especially the ones that you run on the cloud with Kubernetes. Istio plays extremely nice with Kubernetes, so nice that you might think that it’s part of the Kubernetes platform.

如果您仍然想知道,到底什么是服务网格或Istio? 接下来让我们来概述一下Istio。

Istio

Istio在分布式应用程序体系结构中提供以下功能:

  • Service discovery — Traditionally provided by platforms like Netflix Eureka or Consul.

  • Automatic load balancing — You might have used Netflix Zuul for this.

  • Routing, circuit breaking, retries, fail-overs, fault injection — Think of Netflix Ribbon, Hytrix and so on.

  • Policy enforcement for access control, rate limiting, A/B testing, traffic splits, and quotas — Again you might have used Zuul to do some of these.

  • Metrics, logs, and traces — Think of ELK or Stack driver

  • Secure service-to-service communication

下面是Istio的体系结构。

Istio architecture一世stio architecture

它可以分为2个不同的平面。

data plane: Is made of Envoy proxies deployed as sidecars to the application containers. They control all the incoming and outgoing traffic to the container.

控制平面:使用Pilot来管理和配置代理以路由流量。 它还将Mixer配置为强制执行策略并收集遥测。 它还具有其他组件,例如用于管理安全性的Citadel和用于管理配置的Galley。

Istio can also configure an instance of Grafana, Prometheus, Jaeger, and Kiali for Monitoring and Observability. You can use this or use your existing monitoring stack as well if you wish to do so.

希望本文提供了Istio的概述,现在让我们关注本文的目标。

Preparing the Kubernetes cluster

首先,让我们准备一个Kubernetes集群以部署Istio和我们的应用程序容器。 请按照您喜欢的任何平台上的说明进行操作。

Prerequisites

We will be using Helm to install Istio on the Kubernetes cluster and kubectl for deploying the applications.

Helm: The Kubernetes package manager. Install it.

kubectl: The command-line tool to interact with Kubernetes. Install and configure it.

Create a cluster on Azure Kubernetes Service(AKS)

If you are going to use Azure, then install Azure CLI to interact with Azure. Install and login with your Azure account (you can create a free account if you don’t have one already). If not skip this section.

首先,让我们创建一个资源组。 您可以在这里使用任何您喜欢的地区,而不是美国东部。

$ az group create --name eCommerceCluster --location eastus

创建Kubernetes集群:

  1. $ az aks create \
  2. --resource-group eCommerceCluster \
  3. --name eCommerceCluster \
  4. --node-count 4 \
  5. --kubernetes-version 1.13.7 \
  6. --enable-addons monitoring \
  7. --generate-ssh-keys

的节点数该标志很重要,因为安装程序至少需要四个带有默认CPU的节点才能运行所有内容。 您可以尝试使用更高的kubernetes版本如果受支持,则坚持1.13

创建集群可能需要一些时间,因此请放松休息。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/915794
推荐阅读
相关标签