zoukankan      html  css  js  c++  java
  • Kubernetes进阶实战读书笔记:Helm实践部署weave-scope监控

     一、环境准备下载

    1、搜索weave仓库

    [root@master ~]# helm search repo weave
    NAME CHART VERSION	APP VERSION	DESCRIPTION 
    aliyuncs/weave-cloud	0.3.7 1.4.0 Weave Cloud is a add-on to Kubernetes which pro...
    aliyuncs/weave-scope	1.1.8 1.12.0 A Helm chart for the Weave Scope cluster visual...
    stable/weave-cloud 0.3.7 1.4.0 Weave Cloud is a add-on to Kubernetes which pro...
    stable/weave-scope 1.1.10 1.12.0 A Helm chart for the Weave Scope cluster visual...

    2、下载远程安装包到本地并解压

    [root@master ~]# helm fetch stable/weave-scope
    [root@master ~]# tar xf weave-scope-1.1.10.tgz

    3、修改ClusterIP为NodePort

    [root@master ~]# sed -i "s@ type: "ClusterIP"@ type: "NodePort"@" weave-scope/values.yaml

    4、创建weave-scope命名空间

    [root@master ~]# kubectl create namespace weave-scope
    namespace/weave-scope created

    二、安装验证

    1、安装

    [root@master ~]# helm install -n weave-scope common-service -f weave-scope/values.yaml weave-scope/
    NAME: common-service
    LAST DEPLOYED: Mon Jul 27 17:27:54 2020
    NAMESPACE: weave-scope
    STATUS: deployed
    REVISION: 1
    NOTES:
    You should now be able to access the Scope frontend in your web browser, by
    going to the address or hostname of any node in the cluster, using http 
    and the port given by:
    
    SCOPE_PORT=$(kubectl -n weave-scope get svc common-service-weave-scope 
    -o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); echo $SCOPE_PORT
    
    Most likely one or more of the URLs given by this pipeline will work:
    
    SCOPE_PORT=$(kubectl -n weave-scope get svc 
    -o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); 
    kubectl get nodes -o jsonpath='{.items[0].status.addresses[*].address}' | 
    xargs -I{} -d" " echo http://{}:$SCOPE_PORT
    For more details on using Weave Scope, see the Weave Scope documentation:
    
    https://www.weave.works/docs/scope/latest/introducing/

    2、验证服务列表

    [root@master ~]# helm list -n weave-scope
    NAME NAMESPACE REVISION	UPDATED STATUS CHART APP VERSION
    common-service	weave-scope	1 2020-07-27 17:27:54.730013979 +0800 CST	deployed	weave-scope-1.1.10	1.12.0

    3、验证服务状态

    [root@master ~]# helm status common-service -n weave-scope
    NAME: common-service
    LAST DEPLOYED: Mon Jul 27 17:27:54 2020
    NAMESPACE: weave-scope
    STATUS: deployed
    REVISION: 1
    NOTES:
    You should now be able to access the Scope frontend in your web browser, by
    going to the address or hostname of any node in the cluster, using http 
    and the port given by:
    
    SCOPE_PORT=$(kubectl -n weave-scope get svc common-service-weave-scope 
    -o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); echo $SCOPE_PORT
    
    Most likely one or more of the URLs given by this pipeline will work:
    
    SCOPE_PORT=$(kubectl -n weave-scope get svc 
    -o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); 
    kubectl get nodes -o jsonpath='{.items[0].status.addresses[*].address}' | 
    xargs -I{} -d" " echo http://{}:$SCOPE_PORT
    For more details on using Weave Scope, see the Weave Scope documentation:
    
    https://www.weave.works/docs/scope/latest/introducing/

    4、验证pod svc deploy

    [root@master ~]# kubectl get all -n weave-scope -o wide
    NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
    pod/weave-scope-agent-common-service-88zg9 1/1 Running 0 4m20s 192.168.118.19 nodes1 <none> <none>
    pod/weave-scope-agent-common-service-mtgs8 1/1 Running 0 4m20s 192.168.118.4 nodes2 <none> <none>
    pod/weave-scope-agent-common-service-s4pgv 1/1 Running 0 4m20s 192.168.118.18 master <none> <none>
    pod/weave-scope-cluster-agent-common-service-76f8fb44f6-k4h9n 1/1 Running 0 4m20s 10.244.2.147 nodes2 <none> <none>
    pod/weave-scope-frontend-common-service-6949c697bf-vchbh 1/1 Running 0 4m20s 10.244.2.146 nodes2 <none> <none>
    
    NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
    service/common-service-weave-scope NodePort 10.99.171.162 <none> 80:31655/TCP 4m20s app=weave-scope,component=frontend,release=common-service
    
    NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR
    daemonset.apps/weave-scope-agent-common-service 3 3 3 3 3 <none> 4m20s weave-scope-agent weaveworks/scope:1.12.0 app=weave-scope,component=agent,release=common-service
    
    NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
    deployment.apps/weave-scope-cluster-agent-common-service 1/1 1 1 4m20s weave-scope-cluster-agent weaveworks/scope:1.12.0 app=weave-scope,component=cluster-agent,release=common-service
    deployment.apps/weave-scope-frontend-common-service 1/1 1 1 4m20s weave-scope-frontend weaveworks/scope:1.12.0 app=weave-scope,component=frontend,release=common-service
    
    NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
    replicaset.apps/weave-scope-cluster-agent-common-service-76f8fb44f6 1 1 1 4m20s weave-scope-cluster-agent weaveworks/scope:1.12.0 app=weave-scope,component=cluster-agent,pod-template-hash=76f8fb44f6,release=common-service
    replicaset.apps/weave-scope-frontend-common-service-6949c697bf 1 1 1 4m20s weave-scope-frontend weaveworks/scope:1.12.0 app=weave-scope,component=frontend,pod-template-hash=6949c697bf,release=common-service

    三、web页面截图

    1、浏览器输入:http://192.168.118.18:31655

    2、查看pod配置

     3、添加删除pod

                                                     

     4、exec shell

     5、查看日志

  • 相关阅读:
    LINUX用户管理——/etc/passwd文件详解
    接口类型的问题:信息丢失
    swift是强类型语言
    swift的多态
    面向对象的本质:基于对象+面向接口+继承
    多态的本质:同一函数接口在接受不同的类型参量时表现出不同的行为--多态是面向接口编程
    类型约束的本质是:类型构造器在约束类型的基础上构造新的函数类型
    类型与函数:函数是一种复合类型,它的构建依赖于数据类型
    类型约束的语义学研究:基于类型约束的编程
    复合类型、类型约束、添加功能、高阶函数
  • 原文地址:https://www.cnblogs.com/luoahong/p/13367519.html
Copyright © 2011-2022 走看看