ARTS 第十五周

发布于 February 24, 2020

Review

安装部署 Minikube 和 Istio

环境:AWS EC2, Amazon Linux 2, 16G RAM, 2 CPUs

步骤1:安装 Minikube

  1. 安装 kubectl (文档

    curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
    chmod +x ./kubectl
    sudo mv ./kubectl /usr/local/bin/kubectl
    kubectl version --client
    
  2. 安装 Minikube (文档

    curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
    && chmod +x minikube
    sudo mkdir -p /usr/local/bin/
    sudo install minikube /usr/local/bin/
    
  3. 安装完成后,确认状态

    sudo minikube start --vm-driver=none
    minikube status
    

    一切正常,会显示以下状态:

    host: Running
    kubelet: Running
    apiserver: Running
    kubeconfig: Configured
    
  4. 部署一个 Deployment 试试吧

    sudo kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
    sudo kubectl expose deployment hello-minikube --type=NodePort --port=8080
    sudo kubectl get pod
    sudo minikube service hello-minikube --url
    sudo kubectl delete services hello-minikube
    sudo kubectl delete deployment hello-minikube
    

步骤2:安装 Istio

  1. 安装 istioctl

    curl -L https://istio.io/downloadIstio | sh -
    cd istio-1.4.5
    cp bin/istioctl /usr/local/bin/
    
  2. 安装 Istio

    sudo istioctl manifest apply --set profile=demo
    

    验证以下 Kubernetes services 已经正常部署了。

    $ sudo kubectl get svc -n istio-system
    NAME                     TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                                                                      AGE
    grafana                  ClusterIP      10.108.44.2      <none>        3000/TCP                                                                                                                     35s
    istio-citadel            ClusterIP      10.105.146.227   <none>        8060/TCP,15014/TCP                                                                                                           21m
    istio-egressgateway      ClusterIP      10.106.189.119   <none>        80/TCP,443/TCP,15443/TCP                                                                                                     37s
    istio-galley             ClusterIP      10.107.234.119   <none>        443/TCP,15014/TCP,9901/TCP,15019/TCP                                                                                         21m
    istio-ingressgateway     LoadBalancer   10.102.150.117   <pending>     15020:32434/TCP,80:30018/TCP,443:32092/TCP,15029:31992/TCP,15030:32662/TCP,15031:32151/TCP,15032:30452/TCP,15443:30553/TCP   21m
    istio-pilot              ClusterIP      10.103.255.170   <none>        15010/TCP,15011/TCP,8080/TCP,15014/TCP                                                                                       21m
    istio-policy             ClusterIP      10.102.35.129    <none>        9091/TCP,15004/TCP,15014/TCP                                                                                                 21m
    istio-sidecar-injector   ClusterIP      10.99.167.32     <none>        443/TCP                                                                                                                      21m
    istio-telemetry          ClusterIP      10.101.31.38     <none>        9091/TCP,15004/TCP,15014/TCP,42422/TCP                                                                                       21m
    jaeger-agent             ClusterIP      None             <none>        5775/UDP,6831/UDP,6832/UDP                                                                                                   57s
    jaeger-collector         ClusterIP      10.111.79.159    <none>        14267/TCP,14268/TCP,14250/TCP                                                                                                56s
    jaeger-query             ClusterIP      10.103.181.224   <none>        16686/TCP                                                                                                                    50s
    kiali                    ClusterIP      10.98.134.20     <none>        20001/TCP                                                                                                                    40s
    prometheus               ClusterIP      10.96.136.180    <none>        9090/TCP                                                                                                                     21m
    tracing                  ClusterIP      10.108.234.135   <none>        80/TCP                                                                                                                       44s
    zipkin                   ClusterIP      10.105.219.40    <none>        9411/TCP                                                                                                                     41s
    

    同时,验证相应的 Kubernetes pods 已经部署了并且状态为 Running

    $ sudo kubectl get pods -n istio-system
    NAME                                      READY   STATUS    RESTARTS   AGE
    grafana-6b65874977-c94qn                  1/1     Running   0          3m11s
    istio-citadel-7d4689c4cf-fgx9n            1/1     Running   0          24m
    istio-egressgateway-679b746848-xnrtg      1/1     Running   0          3m30s
    istio-galley-6b8dfcc549-vwvnv             1/1     Running   0          3m30s
    istio-ingressgateway-db547d98-7zc7h       1/1     Running   0          3m31s
    istio-pilot-85d8f75c4-sxzdt               1/1     Running   0          3m24s
    istio-policy-6845468548-5gztc             1/1     Running   0          3m30s
    istio-sidecar-injector-6fdc95467f-kxlr8   1/1     Running   0          24m
    istio-telemetry-5b994fddc6-rpqpr          1/1     Running   0          3m29s
    istio-tracing-c66d67cd9-fb5hw             1/1     Running   1          3m31s
    kiali-8559969566-qtg57                    1/1     Running   0          3m16s
    prometheus-66c5887c86-kz2hv               1/1     Running   0          24m
    

Algorithm

67. Add Binary

Given two binary strings, return their sum (also a binary string).

The input strings are both non-empty and contains only characters 1 or 0.

Example 1:

Input: a = "11", b = "1"
Output: "100"

Example 1:

Input: a = "1010", b = "1011"
Output: "10101"

Code

Tip

如何设置 sudo 命令下的默认 PATH

编辑文件 /etc/sudoers,找到 Defaults secure_path = 行,将需要新增的路径加入的参数值中 /sbin:/bin:/usr/sbin:/usr/bin

Share

😷 😷 😷 😷 😷 😷 😷 😷 😷

这就是 2020 年的我们的状态了。

E