kubernetes_minikube

kubernetes

1.1 minkkube install on MacOS

refs:

  • ​​https://kubernetes.io/docs/tasksk8s架构原理/tools/install-minikube/​​
  • ​​https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-macos​​

1.1.1 Install kubectl bik8smnary with curl on macOS

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl

chomd +x kubectl && mv kubectl /usr/local/bin/kubectl

kubectl version

1.1.2linux删除文件命令 Install minikube

refs: ​​https:linux必学的60个命令//kubernetes.io/docs/taskskubernetes/tools/ilinux操作系统基础知识nstall-minikube/linux操作系统基础知识​​

# use brew
brew cask install minikube

# manual
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 \
&& chmod +x minikube

sudo mv minikube /usr/local/bin

第一次运行下面命令,可能会失败,需要先做一些准备工作

# minikube iso image
wget https://storage.googleapis.com/minikube/iso/minikube-v1.1.1.iso
mv minikube-v1.1.1.iso <sub>/.minikube/cache/iso

# kubelet tools
wget https://storage.googleapis.com/kubernetes-release/release/v1.14.3/bin/linux/amd64/kubelet
mv kubelet </sub>/.minikube/cache/v1.14.3

下面是minikube很温馨k8s经典版电影地考虑到我们中国用户而提供的方式

$ minikube start --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
minikube v1.1.1 on darwin (amd64)
checking main repository and mirrors for images
2019/06/18 15:06:55 No matching credentials were found, falling back on anonymous
✅ using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
Re-using the currently running virtualbox VM for "minikube" ...
⌛ Waiting for SSH access ...
Configuring environment for Kubernetes v1.14.3 on Docker 18.09.6
Downloading kubelet v1.14.3
Relaunching Kubernetes v1.14.3 using kubeadm ...
⌛ Verifying: apiserver proxy etcd scheduler controller dns
Done! kubectl is now configured to use "minikube"

linux是什么操作系统果使用了​​minikube stop​​​, 想要再重新启动,还是要使用上面的命令来启动​​minikube start --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_contk8s部署ainers​​才行

1.2 ReplicaSet && Replickubernetes与docker的关系ationController

  • rc_nginx.yml
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 3
selector:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
  • 创建,删除replicaset.apps/nginx
➜  replicas-set kubectl create -f rc_nginx.yml
replicationcontroller/nginx created
➜ replicas-set kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-9k9kb 0/1 ContainerCreating 0 3s <none> minikube <none> <none>
nginx-l55n8 0/1 Terminating 0 42s <none> minikube <none> <none>
nginx-rn9dm 0/1 ContainerCreating 0 3s <none> minikube <none> <none>
nginx-vx545 0/1 ContainerCreating 0 3s <none> minikube <none> <none>
➜ replicas-set kubectl get replicationcontrollers
NAME DESIRED CURRENT READY AGE
nginx 3 3 1 6s
➜ replicas-set kubectl scale replicationcontroller nginx --replicas=5
replicationcontroller/nginx scaled
➜ replicas-set kubectl get replicationcontrollers
NAME DESIRED CURRENT READY AGE
nginx 5 5 3 25s
➜ replicas-set kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-8qkqk 1/1 Running 0 6s 172.17.0.8 minikube <none> <none>
nginx-9k9kb 1/1 Running 0 28s 172.17.0.5 minikube <none> <none>
nginx-n9c9p 0/1 ContainerCreating 0 6s <none> minikube <none> <none>
nginx-rn9dm 1/1 Running 0 28s 172.17.0.6 minikube <none> <none>
nginx-vx545 1/1 Running 0 28s 172.17.0.7 minikube <none> <none>
➜ replicas-set kubectl delete -f rc_nginx.yml
replicationcontroller "nginx" deleted
  • rs_nginx.yml
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx
labels:
tier: frontend
spec:
replicas: 3
selector:
matchLabels:
tier: frontend
template:
metadata:
name: nginx
labels:
tier: frontend
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
  • 创建,删除replicaset.applinux必学的60个命令s/nginx
$ kubectl create -f rs_nginx.yml
replicaset.apps/nginx created

$ replicas-set kubectl get replicasets.extensions -o wide
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
nginx 3 3 3 25s nginx nginx tier=frontend
$ replicas-set kubectl get replicasets.apps -o wide
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
nginx 3 3 3 32s nginx nginx tier=frontend
$ replicas-set kubectl get replicasets -o wide
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
nginx 3 3 3 53s nginx nginx tier=frontend

$ kubectl delete -f rs_nginx.yml
replicaset.apps "nginx" deleted

1k8s经典版电影.3 Deployment

1.3.1 Ck8sreate Deployment

  • deployment_nginx.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.12.2
ports:
- containerPort: 80

create alinux是什么操作系统 nginx deployment

➜  deployment kubectl create -f deployment_nginx.yml
deployment.apps/nginx-deployment created
➜ deployment kubectl get deployments.apps
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-deployment 0/3 3 0 9s
➜ deployment kubectl get replicasets
NAME DESIRED CURRENT READY AGE
nginx-deployment-75779bd8f 3 3 3 106s
➜ deployment kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-deployment-75779bd8f-jph8b 1/1 Running 0 111s 172.17.0.6 minikube <none> <none>
nginx-deployment-75779bd8f-sh7b9 1/1 Running 0 111s 172.17.0.5 minikube <none> <none>
nginx-deployment-75779bd8f-vp85h 1/1 Running 0 111s 172.17.0.7 minikube <none> <none>

1.3.2 Update Deployment

➜  deployment kubectl set image deployment nginx-deployment nginx=nginx:1.13
deployment.extensions/nginx-deployment image updated
➜ deployment kubectl get deployments -o wide
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
nginx-deployment 3/3 1 3 5m35s nginx nginx:1.13 app=nginx
➜ deployment kubectl get replicasets -o wide
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
nginx-deployment-5478bc896 3 3 3 61s nginx nginx:1.13 app=nginx,pod-template-hash=5478bc896
nginx-deployment-75779bd8f 0 0 0 6m19s nginx nginx:1.12.2 app=nginx,pod-template-hash=75779bd8f

1.3.4 Deployment rollout

➜  deployment kubectl rollout history deployment nginx-deployment
deployment.extensions/nginx-deployment
REVISION CHANGE-CAUSE
1 <none>
2 <none>

➜ deployment kubectl rollout undo deployment nginx-deployment
deployment.extensions/nginx-deployment rolled back
➜ deployment kubectl rollout history deployment nginx-deployment
deployment.extensions/nginx-deployment
REVISION CHANGE-CAUSE
2 <none>
3 <none>

➜ deployment kubectl set image deployment nginx-deployment nginx=nginx:1.13
deployment.extensions/nginx-deployment image updated
➜ deployment kubectl rollout history deployment nginx-deployment
deployment.extensions/nginx-deployment
REVISION CHANGE-CAUSE
3 <none>
4 <none>

➜ deployment kubectl get replicasets -o wide
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
nginx-deployment-5478bc896 3 3 3 3m43s nginx nginx:1.13 app=nginx,pod-template-hash=5478bc896
nginx-deployment-75779bd8f 0 0 0 9m1s nginx nginx:1.12.2 app=nginx,pod-template-hash=75779bd8f

1.3.5 Expose Deployment

➜  deployment kubectl expose deployment nginx-deployment --type=NodePort
service/nginx-deployment exposed
➜ deployment kubectl get service -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 7h32m <none>
nginx-deployment NodePort 10.101.140.20 <none> 80:30506/TCP 26s app=nginx
➜ deployment kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
minikube Ready master 7h33m v1.14.3 10.0.2.15 <none> Buildroot 2018.05 4.15.0 docker://18.9.6

➜ deployment curl -I http://$(minikube ip):30506
HTTP/1.1 200 OK
Server: nginx/1.13.12
Date: Tue, 18 Jun 2019 15:39:44 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 09 Apr 2018 16:01:09 GMT
Connection: keep-alive
ETag: "5acb8e45-264"
Accept-Ranges: bytes

1.4 Serk8s部署vice

  • kubectl expose命令,会给我们的pod创建一个Servick8s面试题与答案e,供外部访问
  • Service主要有3种类型
  • ClusterIlinux操作系统基础知识P: 集内容任意地方都可以访问,但是外部无法访问
  • NodePort: 外部可以访问
  • LoadBalancer
  • 另外也可以使用NDS,但是需要 NDS 的 add-on

1linux必学的60个命令.4.1 为linux是什么操作系统什么不要直接使用和管理Pods

  • 当我们使用​​ReplicaSet​​​或者​​Replicatilinux命令onlinux系统Controller​​做水平扩展kubernetes架构详解scale的时候,Podk8s部署s可能会被Terminated
  • 当我们使用​​Deoployment​​的时候,我们去更新Docker Image Version,旧的Pods会被Terminated, 然后系统运维工资一般多少新的Pods创建

1.4.2 Service ClusterIP

➜  pod-basic kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx 1/1 Running 0 3m47s 172.17.0.6 minikube <none> <none>
➜ pod-basic kubectl expose pod nginx
service/nginx exposed
➜ pod-basic kubectl get services -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 23h <none>
nginx ClusterIP 10.104.168.37 <none> 80/TCP 13s app=nginx

1.4.2.1 Create Deployment

为了节省时间,建议提前下载好镜像​​docker image pull python:2.7​

$ cat deployment_python_http.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: python-deployment
spec:
replicas: 5
selector:
matchLabels:
app: service_test_pod
template:
metadata:
labels:
app: service_test_pod
spec:
containers:
- name: simple-http
image: python:2.7
imagePullPolicy: IfNotPresent
command: ["/bin/bash"]
args: ["-c", "echo \"<p>hello from $(hostname)</p>\" > index.html; python -m SimpleHTTPServer 8080"]
ports:
- name: http
containerPort: 8080

$ kubectl create -f deployment_python_http.yml
deployment.extensions/python-deployment created

$ kukubectl get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE
python-deployment-7c8f76bf76-6wjqp 1/1 Running 0 20s 172.10.0.4 debian-cluster-02
python-deployment-7c8f76bf76-8qksw 1/1 Running 0 20s 172.10.0.3 debian-cluster-02
python-deployment-7c8f76bf76-qsv9d 1/1 Running 0 20s 172.10.192.2 debian-cluster-01
python-deployment-7c8f76bf76-rmxh7 1/1 Running 0 20s 172.10.128.3 debian-cluster-03
python-deployment-7c8f76bf76-xzlbt 1/1 Running 0 20s 172.10.128.4 debian-cluster-03

$ deployment kubectl get deployments
kubectl get deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
python-deployment 5 5 5 5 6s

$ kubectl expose deployment python-deployment
service "python-deployment" exposed

$ kubectl get service -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 13d <none>
python-deployment ClusterIP 10.102.41.116 <none> 8080/TCP 4m app=service_test_pod

$ for i in `seq 1 5`; do
for> curl 10.102.41.116:8080
for> done
<p>hello from python-deployment-7c8f76bf76-6wjqp</p>
<p>hello from python-deployment-7c8f76bf76-qsv9d</p>
<p>hello from python-deployment-7c8f76bf76-rmxh7</p>
<p>hello from python-deployment-7c8f76bf76-xzlbt</p>
<p>hello from python-deployment-7c8f76bf76-8qksw</p>

1.4.2.2 Update Deployment

通过 Deployment 做一个无宕机的更新,通kubernetes过下面的linux必学的60个命令命令编辑更新

$ kubectl get deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
python-deployment 5 5 5 5 10m

# 这里的更新并不是无宕机更新,类似于灰度发布,先更新一部分
$ kubectl edit deployment python-deployment python-deployment
deployment.extensions "python-deployment" edited

1.4.3 Service NodePort

1.4.3.1 NodePort Service Create

$ cat pod_nginx.yml
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx-container
image: nginx
ports:
- name: nginx-port
containerPort: 80

$ kubectl create -f pod_nginx.yml
pod "nginx" created

$ kubectl get pods -o wide --show-labels
NAME READY STATUS RESTARTS AGE IP NODE LABELS
nginx 1/1 Running 0 1m 172.10.192.2 debian-cluster-01 app=nginx

$ kubectl expose pod nginx --type=NodePort
service "nginx" exposed

# 可以看到,这里暴露Node上的32623端口
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 13d
nginx NodePort 10.98.58.54 <none> 80:32623/TCP 6s
python-deployment ClusterIP 10.102.41.116 <none> 8080/TCP 1h

尝试使用NodeIP + Port的方式来访问,经过测试发现每个节点上都会暴露端口,而且端口都会映射到具体的Pod上的容器linux

# 先获取Node的ip地址(推荐使用第一种)
$ kukubectl get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE
nginx 1/1 Running 0 4m 172.10.192.2 debian-cluster-01

$ kubectl describe node debian-cluster-01 | grep 'Addresses' -A 2
Addresses:
InternalIP: 192.168.10.161
Hostname: debian-cluster-00

$ curl -I 192.168.10.161:32623
HTTP/1.1 200 OK
Server: nginx/1.17.0
Date: Wed, 19 Jun 2019 09:16:07 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 21 May 2019 14:23:57 GMT
Connection: keep-alive
ETag: "5ce409fd-264"
Accept-Ranges: bytes

1.4.3.2 使用配置文件来创建 service

先删除k8s经典版电影我们之前因暴露端口而产生的service

$ kukubectl delete service nginx
service "nginx" deleted
$ cat pod_nginx.yml
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx-container
image: nginx
ports:
- name: nginx-port
containerPort: 80

# 创建 service 配置文件
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
ports:
- port: 8080 # 这个是服务本身的端口
nodePort: 30880 # 这里的node上暴露的端口
targetPort: nginx-port # 这里对应上面 pod_nginx.yml 中spec.containers.ports.name的value
protocol: TCP
selector:
app: nginx # 表示操作对象范围,即app=nginx的pod才会被创建
type: NodePort

# 创建 service
kubectl create -f service_nginx.yml
service "nginx-service" created

# 查看 service
kubectl get service -o wide --show-labels
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR LABELS
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 13d <none> component=apiserver,provider=kubernetes
nginx-service NodePort 10.105.98.171 <none> 8080:30880/TCP 3m app=nginx <none>

访问方式还和上面的一样

1.5 Label

# 一个 busybox 的 pod 配置文件
$ cat pod_busybox.yml
apiVersion: v1
kind: Pod
metadata:
name: busybox-pod
labels:
app: busybox
spec:
nodeSelector: # 顾名思义, 也就是说该pod只会在包含hardward=good的node上创建
hardward: good
containers:
- name: busybox-container
image: busybox
command:
- sleep
- "360000"

$ kubectl create -f pod_busybox.yml
pod "busybox-pod" created

# 这里可以看到我们的pod 处于 Pending 状态
$ kubectl get pod -o wide --show-labels
NAME READY STATUS RESTARTS AGE IP NODE LABELS
busybox-pod 0/1 Pending 0 15s <none> <none> app=busybox
nginx 1/1 Running 0 35m 172.10.192.2 debian-cluster-01 app=nginx

# 查看各node的label,并没有hardward=good
$ kubectl get node --show-labels
NAME STATUS ROLES AGE VERSION LABELS
debian-cluster-00 Ready master 13d v1.10.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=debian-cluster-00,node-role.kubernetes.io/master=
debian-cluster-01 Ready <none> 13d v1.10.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=debian-cluster-01
debian-cluster-02 Ready <none> 13d v1.10.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=debian-cluster-02
debian-cluster-03 Ready <none> 13d v1.10.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=debian-cluster-03

# 我们手动给任意的一个节点创建该节点, 这里给两个节点打一个hardward=good的标签
$ kubectl label node debian-cluster-01 hardward=good
node "debian-cluster-01" labeled
$ kubectl label node debian-cluster-03 hardward=good
node "debian-cluster-03" labeled

# 这里看到pod已经处于Running状态了
$ kubectl get pods --show-labels -o wide | grep busybox
busybox-pod 1/1 Running 0 10m 172.10.192.3 debian-cluster-01 app=busybox

1.6 Use K8s Deploy a WordPress Project

1.6.1 Create MySQL Secret Object

$ kubectl create secret generic mysql-pass --from-literal=password=mysql_root_pass
secret "mysql-pass" created

$ kukubectl get secret
NAME TYPE DATA AGE
default-token-g5m8c kubernetes.io/service-account-token 3 13d
mysql-pass Opaque 1 1m

1.6.2 Create MySQL Dekubernetesployment, Service and persistentlinux删除文件命令volueclaim Object

$ cat mysql-deployment.yaml
apiVersion: v1
kind: Service
metadata:
name: mysql-service
labels:
app: wordpress
spec:
ports:
- port: 3306
selector:
app: wordpress
tier: mysql
clusterIP: None
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
labels:
app: wordpress
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
# apiVersion: apps/v1beta2 # for versions after 1.9.0 use apps/v1
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress-mysql
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: mysql
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim

$ kubectl create -f mysql-deployment.yaml
service "mysql-service" created
persistentvolumeclaim "mysql-pv-claim" created
deployment.apps "wordpress-mysql" created

1.6.3 Create WordPress Deployment, Servkubernetes控制器ice and persistentvoluek8s架构原理claim Obje系统/运维ct

下面的两个配置文件,只有在minikube v1.14.3的版本上测试过,在v1.10.3版本上测试不成功

  • wordprekubernetes与docker的关系ss-deployment.yaml
$ cat wordpress-deployment.yaml
apiVersion: v1
kind: Service
metadata:
name: wordpress-service
labels:
app: wordpress
spec:
ports:
- port: 80
selector:
app: wordpress
tier: frontend
type: NodePort
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pv-claim
labels:
app: wordpress
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
# apiVersion: apps/v1beta2 # for versions after 1.9.0 use apps/v1
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: frontend
spec:
containers:
- image: wordpress:4.8-apache
name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: mysql-service
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: wordpress-persistent-storage
mountPath: /var/www/html
volumes:
- name: wordpress-persistent-storage
persistentVolumeClaim:
claimName: wp-pv-claim

创建相关对象

$ kubectl create -f wordpress-deployment.yaml
service "wordpress-service" created
persistentvolumeclaim "wp-pv-claim" created
deployment.apps "wordpress" created

1.6.4kubernetes Access wordpress

  • 如果使用minikube,需要使用​​minikube ip​​获得集ip
  • 查看暴露的端口k8s是干嘛的
$ kubectl get service | grep -i wordpress
wordpress-service NodePort 10.103.28.247 <none> 80:31519/TCP 16m
  • 使用浏览器访问

1.7 Monitor

1.7.1 Weavescope

可以实现单机和多节点的监控,有不错的图形界面,还可以监控容器的日志,以及进入容器

安装方式比较kubernetes控制器简单,如下

sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope

ref:

  • 单节点运行 ​​https://www.weave.works/docs/scopelinux操作系统基础知识/latest/installing/#single-node​​
  • 以集方式运行 ​​https://www.weave.works/docs/scope/l系统/运维atest/installing/#cluster​​