zoukankan      html  css  js  c++  java
  • 基于kubernetes实现链路监控

    介绍

    实践

    Install released version using Helm repository

    下载chart包

    export REPO=skywalking
    helm repo add ${REPO} https://apache.jfrog.io/artifactory/skywalking-helm  
    helm pull skywalking/skywalking
    

    修改value文件

    由于前期有搭ES来收集日志,所以直接引用外部ES来做存储。

    elasticsearch:
      enabled: false
      config:               # For users of an existing elasticsearch cluster,takes effect when `elasticsearch.enabled` is false
        host: elasticsearch-master.logs
        port:
          http: 9200
        user: "elastic"         # [optional]
        password: "vRIfHvcdhNZJDGJ0"     # [optional]
    

    helm install

    helm install skywalking -f ./values-my-es.yaml ../skywalking --namespace=skywalking
    

    ingress 配置

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      annotations:
        kubernetes.io/ingress.class: nginx
      name: skywalking
      namespace: skywalking
    spec:
      tls:
      - hosts:
          - uatk8s-skywalking.jackhe.com
        secretName: leyaoyao
      rules:
      - host: uatk8s-skywalking.jackhe.com
        http:
          paths:
          - path: /
            backend:
              service:
                name: skywalking-ui
                port:
                  number: 80
            pathType: Prefix
    

    集成应用

    制作agent镜像

    这里我们以sidecar 模式接入 skywalking

    Dockerfile

    下载agent包: https://archive.apache.org/dist/skywalking/8.1.0/apache-skywalking-apm-es7-8.1.0.tar.gz

    FROM busybox:latest
    LABEL maintainer="Jackhe"
    COPY apache-skywalking-apm-bin-es7/agent/ /opt/agent/
    

    deployment配置

    • helm 模板
          {{- if .Values.initContainers.SkyWalking.enabled }}
    	- mountPath: /skywalking
              name: apm-agent
          {{- end }}
          initContainers:
          {{- if .Values.initContainers.SkyWalking.enabled }}
          - command:
            - cp
            - -rf
            - /opt/agent
            - /skywalking
            image: tengxunharbor.jackhe.com/lyy-gz/skywalking:8.1.0
            name: skywalking-agent
            imagePullPolicy: Always
            volumeMounts:
            - mountPath: /skywalking
              name: apm-agent
          {{- end }}
          volumes:
          {{- if .Values.initContainers.SkyWalking.enabled }}
          - emptyDir: {}
            name: apm-agent
          {{- end }}
    
    

    应用configmap

    appConfig:
      JAVA_TOOL_OPTIONS: -javaagent:/skywalking/agent/skywalking-agent.jar
      SW_AGENT_COLLECTOR_BACKEND_SERVICES: skywalking-oap.skywalking:11800
      SW_AGENT_NAME: '[middle]user-member-sky'
    
    如对您有帮助,支持下呗!

    微信

    支付宝

  • 相关阅读:
    详解Go变量类型的内存布局
    saltstack手册(含官方pdf)
    Linux之《荒岛余生》(三)内存篇
    linux之网络
    Linux之IO
    【WPF】提高InkAnalyer手写汉字识别的准确率
    mssql 小技巧
    WCF Data Service
    jQuery基础之选择器
    Window程序的安装与部署
  • 原文地址:https://www.cnblogs.com/Dev0ps/p/15727758.html
Copyright © 2011-2022 走看看