zoukankan      html  css  js  c++  java
  • Day5-07 通过helm3部署weave-scope

    一、背景

    Weave Scope是Docker和Kubernetes的可视化监控管理软件。这个项目会自动生成容器之间的关系图,方便理解容器之间的关系,也方便监控容器化和微服务化的应用。
    部署成功后,有如下相关组件:

    • DaemonSet:weave-scope-agent,集群每个节点上都会运行的 scope agent 程序,负责收集数据。
    • Deployment:weave-scope-frontend,scope应用,从agent获取数据,通过Web UI展示并与用户交互。
    • Service:支持NodePort和ClusterIP两种类型


    二、通过 helm3 部署 weave-scope

    官方GitHub:
    https://github.com/weaveworks/scope
    https://github.com/weaveworks/scope/tree/master/examples/k8s

    shell> helm install weave-scope stable/weave-scope --namespace kube-system
    
    • 通过 NodePort 类型的 Service 方式登录
    # 将 type: ClusterIP 修改为 type: NodePort
    shell> kubectl edit svc -n kube-system weave-scope-weave-scope
    
    • 通过 ClusterIP 类型的 Service 方式登录(默认)
    shell> cat > ingress.yaml << "EOF"
    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
      name: weave-scope-weave-scope
      namespace: kube-system
    spec:
      rules:
      - host: weave-scope.k8s.maoxj.com.cn
        http:
          paths:
          - path: /
            backend:
              serviceName: weave-scope-weave-scope
              servicePort: 80
    EOF
    
    # 发布资源配置清单
    shell> kubectl apply -f ingress.yaml
    

    三、配置 dns 解析

    weave-scope.k8s 10 IN A 10.65.24.10

    四、访问 Web UI

    • 通过 NodePort 方式访问
      查看 Service 的 NodePort 对外暴露的端口,打开浏览器输入节点IP+端口,例如 http://10.65.24.21:30950/
    • 通过 Ingress 方式访问,需要配置 nginx vhost 文件
    shell> cat > weave-scope.k8s.conf << "EOF"
      server {
          server_name weave-scope.k8s.maoxj.com.cn;
          location / {
             proxy_pass http://kubernetes_backend;
             proxy_set_header Host $http_host;
             proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
          }
      }
    EOF
    
  • 相关阅读:
    使用Perl5获取有道词典释义
    Compress a Folder/Directory via Perl5
    为该目录以及子目录添加index.html
    学习Perl6: slice fastq file
    Javascript Regexp match and replace
    赋值运算符函数
    扑克牌顺子
    翻转单词顺序VS左旋转字符串
    和为S的两个数字VS和为S的连续正数序列
    数组中只出现一次的数字
  • 原文地址:https://www.cnblogs.com/91donkey/p/14030349.html
Copyright © 2011-2022 走看看