• Docker and Kubernetes -- 监控(weave scope)


    docker常用的监控工具

    weave scope

    简介

    • Weave Scope是Docker和Kubernetes的可视化监控管理软件
    • Weave Scope 会自动生成容器之间的关系图,方便理解容器之间的关系,也方便监控容器化和微服务化的应用

    安装部署

    官方安装文档Installing Weave Scope:https://www.weave.works/docs/scope/latest/installing/#k8s

    单节点(Single-node)部署安装:

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

    访问:http://localhost:4040


    集群实验(Cluster)

    实验环境:Hosts

    192.168.137.3
    192.168.137.4
    192.168.137.5
    

    第一步:在每台主机上运行

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

    第二步:在每台Host主机运行时添加集群其他主机

    # 192.168.137.3 主机运行:
    scope launch 192.168.137.4 192.168.137.5
    
    # 192.168.137.4 主机运行;
    scope launch 192.168.137.3 192.168.137.5
    
    # 192.168.137.5 主机运行;
    scope launch 192.168.137.3 192.168.137.4
    

    访问(集群内任意主机ip都可):http://localhost:4040


    k8s集群监控

    第一步:下载

    ╭─root@node1 ~  
    ╰─➤  kubectl apply -f "https://cloud.weave.works/k8s/scope.yaml?k8s-version=$(kubectl version | base64 | tr -d '
    ')&k8s-service-type=NodePort" 
    
    namespace/weave unchanged
    serviceaccount/weave-scope configured
    clusterrole.rbac.authorization.k8s.io/weave-scope configured
    clusterrolebinding.rbac.authorization.k8s.io/weave-scope configured
    deployment.apps/weave-scope-app configured
    service/weave-scope-app configured
    deployment.apps/weave-scope-cluster-agent configured
    daemonset.extensions/weave-scope-agent configured
    
    

    第二步:查看

    ╭─root@node1 ~  
    ╰─➤  kubectl get pod -n weave
    NAME                                         READY   STATUS              RESTARTS   AGE
    weave-scope-agent-26vhd                      0/1     ContainerCreating   0          96s
    weave-scope-agent-qhbnb                      1/1     Running             0          96s
    weave-scope-agent-vlf55                      1/1     Running             0          96s
    weave-scope-app-f6df86749-s2674              1/1     Running             0          97s
    weave-scope-cluster-agent-6546965c48-55d5c   0/1     ContainerCreating   0          97s
    ╭─root@node1 ~  
    ╰─➤  kubectl get deploy -n weave
    NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
    weave-scope-app             1/1     1            1           109s
    weave-scope-cluster-agent   0/1     1            0           109s
    ╭─root@node1 ~  
    ╰─➤  kubectl get svc -n weave
    NAME              TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
    weave-scope-app   NodePort   10.105.170.156   <none>        80:32634/TCP   2m1s
    
    

    weave scope 还可以监控宿主机


    示例图片

    图片来源:https://carey.akhack.com/2019/05/30/weave-scope可视化监控/

  • 相关阅读:
    [BZOJ3751] [NOIP2014] 解方程 (数学)
    [BZOJ4198] [Noi2015] 荷马史诗 (贪心)
    [BZOJ4034] [HAOI2015] T2 (树链剖分)
    [BZOJ1880] [Sdoi2009] Elaxia的路线 (SPFA & 拓扑排序)
    [BZOJ1088] [SCOI2005] 扫雷Mine
    [BZOJ1004] [HNOI2008] Cards (Polya定理)
    [BZOJ1009] [HNOI2008] GT考试 (KMP & dp & 矩阵乘法)
    [BZOJ1503] [NOI2004] 郁闷的出纳员 (treap)
    [BZOJ1059] [ZJOI2007] 矩阵游戏 (二分图匹配)
    BZOJ2626: JZPFAR
  • 原文地址:https://www.cnblogs.com/du-z/p/11367386.html
Copyright © 2020-2023  润新知