Series of navigation

  • Istio Mixer Adapter development (I) K8S environment construction
  • (2) Istio environment construction
  • (3) Customized Mixer Grpc Adapter deployment

An overview of the

Last time, we installed the Kubeadm + Kubernetes + K8S dashboard from a newly installed VM

This paper will continue the environment construction of Istio based on the established K8S environment

Install Istio

Install helm first. Helm is a package installation component under K8S. If you want to know more about helm, please visit the official website of Helm

Refer to the following two articles to install helm

Docs. Helm. Sh/using_helm /… Docs. Helm. Sh/using_helm /…

Download ISTIO-1.0.5 and use helm to generate the K8S YAML file for ISTIO installation, as shown below:

➜ istio wget wget https://github.com/istio/istio/releases/download/1.0.5/istio-1.0.5-linux.tar.gz ➜ istio tar XVF. - Istio 1.0.5 - Linux. Tar. Gz ➜ istiocdIstio - 1.0.5Copy the code

Refer to the following link to install Istio

Istio. IO/docs/setup /…

See the following links to enable Istio functions

IO /docs/refere/istio. IO /docs/refere…

➜ istio - 1.0.5 helm template install/kubernetes/helm/istio - name istio - namespace istio - system \, the set gateways.istio-egressgateway.enabled=false \
  --set galley.enabled=false \
  --set prometheus.enabled=false \
  --set global.enableTracing=false \
  --set global.proxy.envoyStatsd.enabled=false \
  --set security.enabled=true \
  --set gateways.enabled=true \
  --set gateways.istio-ingressgateway.enabled=true \
  --set sidecarInjectorWebhook.enabled=true \
  --set mixer.enabled=true \
  --set pilot.sidecar=true > ./istio-helm.yaml
Copy the code

The Istio installation starts

➜  istio-1.0.5 kubectl create namespace istio-system
➜  istio-1.0.5 kubectl apply -fYaml ➜ istio-1.0.5 kubectl get Pods-n istio-system NAME READY STATUS RESTARTS AGE istio-citadel-7dd558dcf-6vg6f 1/1 Running 0 8m istio-cleanup-secrets-dq2fz 0/1 Completed 0 8m istio-ingressgateway-58c77897cc-x2x6c 1/1 Running 0 16h istio-pilot-868cdfb5f7-zfq2n 2/2 Running 0 1m istio-policy-56c4579578-4qkhk 2/2 Running 0 16h istio-security-post-install-5vwk5 0/1 Completed 0 8m istio-sidecar-injector-d7f98d9cb-7wn9m   1/1       Running     0          16h
istio-telemetry-7fb48dc68b-pdqrv         2/2       Running     0          16h
Copy the code

Now that Istio based on K8S is installed, let’s install the official demo to verify

IO /docs/exampl…

Run the following command to enable automatic istio-Sidecar injection for namespace default:

➜ istio-1.0.5 kubectl label Namespace default IStio-injection =enabledCopy the code

Next we deploy Istio’s official demo application to verify our deployment:

➜ istio - 1.0.5 kubectl apply-fSamples/bookinfo/platform/kube/bookinfo yaml ➜ istio - 1.0.5 kubectl get the pods NAME READY STATUS RESTARTS the AGE details-v1-6764bbc7f7-k9sd4 2/2 Running 0 6m productpage-v1-54b8b9f55-hx2x9 2/2 Running 0 6m ratings-v1-7bc85949-mqdcp 2/2 Running 0 6m reviews-v1-fdbf674bb-n9kcf 2/2 Running 0 6m reviews-v2-5bdc5877d6-9vtj8 2/2 Running 0 6m Review-v3-dd846cc78-bc7pl 2/2 Running 0 6m ➜ istio-1.0.5 kubectl get services NAME TYPE cluster-ip external-ip PORT(S) AGE Details ClusterIP 10.108.102.13 < None > 9080/TCP 6m kubernetes ClusterIP 10.96.0.1 < None > 443/TCP 19h productPage ClusterIP 10.96.96.61 < None > 9080/TCP 6m Ratings ClusterIP 10.96.196.120 < None > 9080/TCP 6m Reviews ClusterIP 10.96.196.120 < None > 9080/TCP 6m Reviews ClusterIP 10.97.215.227 < none > 9080 / TCP 6 mCopy the code

We have only installed the service, we have not configured gateway, Virtual server, etc to make it accessible reference:

Istio. IO/docs/tasks /…

➜ istio - 1.0.5 kubectl apply-f samples/bookinfo/networking/bookinfo-gateway.yaml
Copy the code

LoadBalancer service: LoadBalancer Istio-ingressgateway does not have an external IP address. This is because LoadBalancer actually depends on the implementation of the cloud platform that provides Kubernetes service. We installed it on a VIRTUAL machine, so we need to change it to NodePort

➜ istio-1.0.5 kubectl edit SVC istio-ingressgateway -n istio-system...type: NodePort
...
Copy the code

Run the following command to verify the application:

➜ istio - 1.0.5export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}') ➜ istio - 1.0.5export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}') ➜ istio - 1.0.5export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}') ➜ istio - 1.0.5export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
➜  istio-1.0.5 curl -o /dev/null -s -w "%{http_code}\n" http://$GATEWAY_URL/ productpage 200 ➜ istio - 1.0.5echo $GATEWAY_URL
192.168.101.6:31380
Copy the code

The return code is 200, indicating that there is no problem with HTTP communication. Let’s check on the browser