Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Kubernetes+Istio Development Environment on Notebook

2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to build a Kubernetes+Istio development environment on a notebook. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Note: the test of the article passed the environment Docker CE 18.09 (Kubernetes 1.10.3) and Istio 1.0.4.

Prerequisites, you need an installation package for Docker for Mac or Docker for Windows. If not, please download the latest version of Docker CE. Because a large number of Kubernetes containers are mirrored in gcr.io, stable access cannot be guaranteed in China. We have provided some tool scripts to help download the required images from the Ali Cloud image service.

First,

Git clone https://github.com/AliyunContainerService/k8s-for-docker-desktopcd k8s-for-docker-desktopDocker for Mac turns on Kubernetes

Configure Docker Hub for Docker daemon to accelerate the https://registry.docker-cn.com of China's official image

Optional: configure CPU and memory resources for Kubernetes, and it is recommended to allocate 4GB or more memory.

Cdn.com/61ae11ebd5b54db875390a1f2a5f36c6a4a32154.png ">

Download the images required by Kubernetes from Aliyun's Docker image service in advance. You can load the images you need by modifying the images.properties file.

. / load_images.sh

Open Kubernetes and wait for Kubernetes to start running

Docker for Windows enables Kubernetes

Configure Docker Hub for Docker daemon to accelerate the https://registry.docker-cn.com of China's official image

Optional: configure CPU and memory resources for Kubernetes, and it is recommended to allocate 4GB or more memory.

Download the images required by Kubernetes from Aliyun's Docker image service in advance. You can load the images you need by modifying the images.properties file.

Use Bash shell

. / load_images.sh

Use PowerShell

.\ load_images.ps1

Note: if the PowerShell script cannot be executed because of security policy, execute the Set-ExecutionPolicy RemoteSigned command in the "run as administrator" PowerShell.

Open Kubernetes and wait for Kubernetes to start running

Configure Kubernetes

Optional action: switch the Kubernetes running context to docker-for-desktop

Kubectl config use-context docker-for-desktop

Verify Kubernetes cluster status

Kubectl cluster-infokubectl get nodes

Deploy Kubernetes dashboard

Kubectl create-f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

Or

Kubectl create-f kubernetes-dashboard.yaml

Open the API Server access agent

Kubectl proxy

Access Kubernetes dashboard through the following URL

Http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default

Note: if you test Istio, you do not need to install Ingress. If you need Ingress, you can refer to the relevant chapter of Ingress in https://github.com/AliyunContainerService/k8s-for-docker-desktop.

Install Helm

You can install helm https://github.com/helm/helm/blob/master/docs/install.md according to the documentation

Install # Use homebrew on Macbrew install kubernetes-helm# Install Tiller into your Kubernetes clusterhelm init on Mac OS-- upgrade-I registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.11.0-- skip-refresh# update charts repo (Optional) helm repo update install # Use Chocolatey on Windowschoco install kubernetes-helm# Install Tiller into your Kubernetes clusterhelm init-- upgrade-I registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.11.0-- skip-refresh# update charts repo (Optional) helm repo update configuration Istio on Windows

You can install Istio https://istio.io/docs/setup/kubernetes/ according to the documentation

Download Istio 1.0.4 and install CLIcurl-L https://git.io/getLatestIstio | sh-cd istio-1.0.4/export PATH=$PWD/bin:$PATH

On Windows, you can download the Istio installation package manually, or copy getLatestIstio.ps1 to the directory where you want to download Istio and execute-instructions: modify it according to the installation script provided by the community

.\ getLatestIstio.ps1 install Istiohelm install install/kubernetes/helm/istio via Helm chart-- name istio--namespace istio-system View istio release status helm status istio enable automatic sidecar injection for default namespaces kubectl label namespace default istio-injection=enabledkubectl get namespace-L istio-injection install Book Info sample kubectl apply-f samples/bookinfo/platform/kube/bookinfo.yamlkubectl apply-f samples/bookinfo/networking/bookinfo-gateway.yaml

Confirm that the sample application is running

Export GATEWAY_URL=localhost:80curl-o / dev/null-s-w "% {http_code}\ n" >

Can be accessed through a browser

Http://localhost/productpage

Note: if the current port 80 has been occupied or reserved, we can edit the install/kubernetes/helm/istio/values.yaml file

Adjust the Gateway port, such as replacing port 80 with port 8888

# # You can add custom gateway ports-port: 8888 # Changed from 80 targetPort: 80 name: http2 nodePort: 31380

Then execute the following command and take effect

Kubectl delete service istio-ingressgateway-n istio-systemhelm upgrade istio install/kubernetes/helm/istio Learning Istio

Let's start learning with reference to Istio, https://istio.io/zh/docs/examples/bookinfo/

Delete instance application samples/bookinfo/platform/kube/cleanup.sh uninstall Istiohelm del-purge istiokubectl delete-f install/kubernetes/helm/istio/templates/crds.yaml-n istio-system the above is how to build a Kubernetes+Istio development environment on a notebook, have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report