中文 | English
NOTE:
git checkout v1.19.3
git checkout v1.19.2
git checkout v1.18.8
git checkout v1.18.6
git checkout v1.18.3
git checkout v1.16.5
git checkout v1.15.5
git checkout v1.15.4
git checkout v1.14.8
git checkout v1.14.7
git checkout v1.14.6
git checkout v1.14.3
git checkout v1.14.1
git checkout v1.13.0
git checkout v1.10.11
Config registry mirror for Docker daemon with https://docker.mirrors.ustc.edu.cn
only if in China
Optional: config the CPU and memory for Kubernetes, 4GB RAM or more is suggested.
Preload Kubernetes images form Alibaba Cloud Registry Service, NOTE: you can modify the images.properties
for your own images
On Mac, execute the following scripts
./load_images.sh
Or on Windows, execute the following scripts in PowerShell
.\load_images.ps1
NOTE: if you failed to start PowerShell scripts for security policy, please execute Set-ExecutionPolicy RemoteSigned
command in PowerShell with "Run as administrator" option.
Enable Kubernetes, and wait a while for Kubernetes is running
TIPS:
On Mac:
If facing problems when deploy Kubernetes, you can check ocker desktop application's log to get realtime log:
pred='process matches ".*(ocker|vpnkit).*"
|| (process in {"taskgated-helper", "launchservicesd", "kernel"} && eventMessage contains[c] "docker")'
/usr/bin/log stream --style syslog --level=debug --color=always --predicate "$pred"
On Windows:
If facing problems when deploy Kubernetes, you can check docker log in C:\ProgramData\DockerDesktop\service.txt, check Kuberneteslog in C:\Users\yourUserName\AppData\Local\Docker\log.txt
problem diagnosis:
If you see Kubernetes stuck in Starting, please refer:
rm -fr '~/Library/Group\ Containers/group.com.docker/pki'
Optional: switch the context to docker-desktop
(In the former version, the context is docker-for-desktop
)
kubectl config use-context docker-desktop
Verify Kubernetes installation
kubectl cluster-info
kubectl get nodes
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.4/aio/deploy/recommended.yaml
or
kubectl create -f kubernetes-dashboard.yaml
Check Kubernetes Dashboard status
kubectl get pod -n kubernetes-dashboard
Start proxy for API server
kubectl proxy
For Mac
TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}')
kubectl config set-credentials docker-for-desktop --token="${TOKEN}"
echo $TOKEN
For Windows
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
kubectl config set-credentials docker-for-desktop --token="${TOKEN}"
echo $TOKEN
Choose Token, and input the output from above result
Or, choose Kubeconfig, select file from below path:
Win: %UserProfile%\.kube\config
Mac: $HOME/.kube/config
Click login, go to Kubernetes Dashboard
Install helm following the instruction on https://helm.sh/docs/intro/install/
# Use homebrew on Mac
brew install helm
# add helm repo
helm repo add stable http://mirror.azure.cn/kubernetes/charts/
# update charts repo
helm repo update
# Use Chocolatey on Windows
# NOTE: please ensure you can access googleapis
choco install kubernetes-helm
# add helm repo
helm repo add stable http://mirror.azure.cn/kubernetes/charts/
# update charts repo
helm repo update
More details can be found in https://istio.io/docs/setup/getting-started/
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.5.0 sh -
cd istio-1.5.0/
export PATH=$PWD/bin:$PATH
In Windows, you can download the Istio manually, or copy getLatestIstio.ps1
to your Istio directory, and execute the script.
NOTE: It refer the scripts from community.
.\getLatestIstio.ps1
istioctl manifest apply --set profile=demo
Check status of istio release
kubectl get pods -n istio-system
default
namespacekubectl label namespace default istio-injection=enabled
kubectl get namespace -L istio-injection
Please refer https://istio.io/docs/examples/bookinfo/
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
Check the resources of sample application
kubectl get svc,pod
Confirm the application is running
kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage:9080/productpage | grep -o "<title>.*</title>"
Create Ingress Gateway
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
Check Gateway status
kubectl get gateway
Confirm the application is accessible
export GATEWAY_URL=localhost:80
curl -s http://${GATEWAY_URL}/productpage | grep -o "<title>.*</title>"
Open with browser http://localhost/productpage
export GATEWAY_URL=localhost:80
curl -o /dev/null -s -w "%{http_code}\n" http://${GATEWAY_URL}/productpage
samples/bookinfo/platform/kube/cleanup.sh
istioctl manifest generate --set profile=demo | kubectl delete -f -
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。