Skip to content

lipangeng/Skywalking-Injection

Repository files navigation

Skywalking Injection

前言

官方资料:https://kubernetes.io/zh/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks

JsonPach:http://jsonpatch.com

基于Kubernetes Admission Controllers的Java Agent自动挂载方式

目前仅支持Java Agent的挂载

Kubernetes Admission Controllers

Kubernetes 准入控制器是控制和强制使用集群的一种插件。我们可以把它看作是拦截(已认证)API 请求的拦截器,它可以更改请求对象,甚至完全拒绝请求。
Kubernetes 准入控制器的“准入控制链”分为两个阶段:变更(Mutating)准入控制,修改请求的对象;验证(Validating)准入控制,验证请求的对象。因此准入控制器即可以被用作变更和验证,也可以两者结合起来使用。
ztrwd7qfd7.jpeg

基本思路

通过变更控制器的Webhook方式,在发布时对POD的配置进行变更,从而挂载Skywalking Java Agent与启动命令。
其挂载方式使用InitContainer的方式,启动方式则可使用增加环境变量的方式。
最终生成的pod配置示例:

apiVersion: v1
kind: Pod
metadata:
  labels:
    app: nginx
    skywalking: enabled
    skywalking-volume: sw-volume-09befabe
  name: nginx
  namespace: skac
spec:
  containers:
    - env:
        - name: SWKAC_ENABLE
          value: "true"
        - name: JAVA_TOOL_OPTIONS
          value: -javaagent:/opt/skywalking/skywalking-agent.jar
        - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
          value: apm-aop.apm:11800
        - name: SW_AGENT_NAME
          value: pod-nginx
      image: nginx
      imagePullPolicy: IfNotPresent
      name: nginx
      resources: {}
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      volumeMounts:
        - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
          name: default-token-bptdb
          readOnly: true
        - mountPath: /opt/skywalking
          name: sw-volume-09befabe
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  initContainers:
    - env:
        - name: AGENT_HOME
          value: /opt/skywalking
      image: ilemontech/skywalking-java-agent
      imagePullPolicy: Always
      name: sw-init-09befabe
      resources: {}
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      volumeMounts:
        - mountPath: /opt/skywalking
          name: sw-volume-09befabe
  volumes:
    - name: default-token-bptdb
      secret:
        defaultMode: 420
        secretName: default-token-bptdb
    - emptyDir:
        sizeLimit: 200Mi
      name: sw-volume-09befabe

操作步骤

本示例中所有内容均部署在namespace: skywalking中

准备证书

调用时会默认使用https方式调用。 可以自行创建CA与证书文件。

示例:

CA: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZvakNDQTRvQ0NRREZYZTRwM1o0NjREQU5CZ2txaGtpRzl3MEJBUXNGQURDQmtURUxNQWtHQTFVRUJoTUMKUTA0eEVEQU9CZ05WQkFnTUIwSmxhV3BwYm1jeEVEQU9CZ05WQkFjTUIwSmxhV3BwYm1jeER6QU5CZ05WQkFvTQpCbWxNWlcxdmJqRVBNQTBHQTFVRUN3d0dhVXhsYlc5dU1Sc3dHUVlEVlFRRERCSjNkM2N1YVd4bGJXOXVkR1ZqCmFDNWpiMjB4SHpBZEJna3Foa2lHOXcwQkNRRVdFR3hwY0dkQWIzVjBiRzl2YXk1amIyMHdJQmNOTWpBd056RTMKTURFME5EQXhXaGdQTWpFeU1EQTNNVGN3TVRRME1ERmFNSUdSTVFzd0NRWURWUVFHRXdKRFRqRVFNQTRHQTFVRQpDQXdIUW1WcGFtbHVaekVRTUE0R0ExVUVCd3dIUW1WcGFtbHVaekVQTUEwR0ExVUVDZ3dHYVV4bGJXOXVNUTh3CkRRWURWUVFMREFacFRHVnRiMjR4R3pBWkJnTlZCQU1NRW5kM2R5NXBiR1Z0YjI1MFpXTm9MbU52YlRFZk1CMEcKQ1NxR1NJYjNEUUVKQVJZUWJHbHdaMEJ2ZFhSc2IyOXJMbU52YlRDQ0FpSXdEUVlKS29aSWh2Y05BUUVCQlFBRApnZ0lQQURDQ0Fnb0NnZ0lCQUxIUS9ndTE0WUJDYjNRNSthTWtyT3dEeUpQKzQvQUpjRTg0Yk5tci9WbFhEMW9JCnMzTDJvclFicGtRQ1VEVmZqVHFOTW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XSEUrNFdQRTBZd3IwWCtzeFdlUWVBdUo2bGNlWTZFd3Urb0ZZYnJZakVQSUNPVEgyVnZRZUNGWXZSTk9uWQpCdE0xcWQzYTVoWVpPdjhTM1ZWVjNlcHNmR2NBSUxQOTJVR1FITlBoTWZuNGdjaXJla0w5V1FWOUFKNkFLN0tBCjVDdTMwcGJyMTQ0d2NiaVBTc2VUbkNwenh3TCtSdno0RjlheksvODJxeTdyL05ZcVlnRENURXhnT0ZFQVpYODkKMzBoU2wvcnlHZ1dldzhRS2xESUp5cVhTdW9jdUZodk5NMVJkMW1uU1dwd0daYjMyNnEvSkt5RFpDaEVvZy9VcQovdGpUcGZ6V2R5RnNvUXIyeEVlZzV5elNkSDU4eEtzSElJZGhvUkg0NjNsQ3lNNWVxcWROdFNPYW53PT0KLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0K

创建Secret

可以使用自定义证书。
示例:

apiVersion: v1
kind: Secret
metadata:
  name: skywalking
  namespace: skywalking
data:
  tls.crt: |
    LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZzekNDQTVzQ0NRQ3h5Q2xkRVVFd2RUQU5CZ2txaGtpRzl3MEJBUVVGQURDQmtURUxNQWtHQTFVRUJoTUMKUTA0eEVEQU9CZ05WQkFnTUIwSmxhV3BwYm1jeEVEQU9CZ05WQkFjTUIwSmxhV3BwYm1jeER6QU5CZ05WQkFvTQpCbWxNWlcxdmJqRVBNQTBHQTFVRUN3d0dhVXhsYlc5dU1Sc3dHUVlEVlFRRERCSjNkM2N1YVd4bGJXOXVkR1ZqCmFDNWpiMjB4SHpBZEJna3Foa2lHOXcwQkNRRVdFR3hwY0dkQWIzVjBiRzl2YXk1amIyMHdJQmNOTWpBd056RTMKTURFMU16VTFXaGdQTWpFeU1EQTNNVGN3TVRVek5UVmFNSUdpTVFzd0NRWURWUVFHRXdKRFRqRVFNQTRHQTFVRQpDQXdIUW1WcGFtbHVaekVRTUE0R0ExVUVCd3d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ENURXhnT0ZFQVpYODkKMzBoU2wvcnlHZ1dldzhRS2xESUp5cVhTdW9jdUZodk5NMVJkMW1uU1dwd0daYjMyNnEvSkt5RFpDaEVvZy9VcQovdGpUcGZ6V2R5RnNvUXIyeEVlZzV5elNkSDU4eEtzSElJZGhvUkg0NjNsQ3lNNWVxcWROdFNPYW53PT0KLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0K

部署准入控制器 - SWKAC

准入控制器提供大量的环境变量以及参数可配置,清单如下:

参数名称(环境变量) 默认值 说明
SWKAC_USE_TLS true 是否启用HTTPS
SWKAC_TLS_CERT /etc/swkac/tls.crt HTTPS证书路径
SWKAC_TLS_KEY /etc/swkac/tls.key HTTPS证书路径
SWKAC_TRIGGER_ENV false 通过POD环境变量配置,来识别是否启用自动注入功能。
true:如果目标POD存在环境变量SWKAC_ENABLE且值为true是才会加载agent,否则不对pod做任何变更。
false:关闭该检测功能。
SWKAC_SW_IMAGE lipangeng/skywalking-initcontainer:latest 默认的InitContainer镜像地址
SWKAC_SW_AGENT_COLLECTOR_BACKEND_SERVICES skywalking-aop.skywalking:11800 默认的Skywalking AOP地址
SWKAC_SW_JAVA_ENV_NAME JAVA_TOOL_OPTIONS 写入到pod中的环境变量,将增加启动命令至该环境变量中,通常设置为:-javaagent:/opt/skywalking/skywalking-agent.jar

示例:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: skywalking-injection
spec:
  replicas: 3
  template:
    metadata:
      name: skywalking-injection
      labels:
        app: skywalking-injection
    spec:
      containers:
        - name: skywalking-injection
          image: lipangeng/skywalking-injection:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 80
              name: http
            - containerPort: 443
              name: https
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: SWKAC_TRIGGER_ENV
              value: "true"
            - name: SKAC_OPTIONS
              value: -v 3
            - name: SWKAC_SW_IMAGE
              value: lipangeng/skywalking-initcontainer:7.0.0
            - name: SWKAC_SW_AGENT_COLLECTOR_BACKEND_SERVICES
              value: skywalking-aop.skywalking:11800
            - name: SWKAC_SW_JAVA_ENV_NAME
              value: CATALINA_OPTS
          resources:
            requests:
              memory: 64Mi
            limits:
              memory: 128Mi
          livenessProbe:
            httpGet:
              port: https
              path: /health
              scheme: HTTPS
          readinessProbe:
            httpGet:
              port: https
              path: /health
              scheme: HTTPS
          volumeMounts:
            - mountPath: /etc/swkac/
              name: cert
              readOnly: true
      restartPolicy: Always
      volumes:
        - name: cert
          secret:
            secretName: skywalking
  selector:
    matchLabels:
      app: skywalking-injection

创建Service

apiVersion: v1
kind: Service
metadata:
  name: skywalking-injection
  namespace: skywalking
spec:
  selector:
    app: skywalking-injection
  ports:
    - port: 80
      name: http
    - port: 443
      name: https

注册Skywalking Injection准入控制器

需要Kubernetes1.9版本以上可用,且以1.16为分界点,两种不同的配置。

本示例中,对于哪些pod会被拦截做了筛选。
如果namespace被打上skywalking-injection=true标签,它下面发布的pod才会经过该准入控制器。除此之外还支持其它规则,详情参考官方文档。
示例:

# >= 1.16
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: skywalking-injector
webhooks:
  - admissionReviewVersions: ["v1beta1"]
    failurePolicy: Fail
    clientConfig:
      caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZvakNDQTRvQ0NRREZYZTRwM1o0NjREQU5CZ2txaGtpRzl3MEJBUXNGQURDQmtURUxNQWtHQTFVRUJoTUMKUTA0eEVEQU9CZ05WQkFnTUIwSmxhV3BwYm1jeEVEQU9CZ05WQkFjTUIwSmxhV3BwYm1jeER6QU5CZ05WQkFvTQpCbWxNWlcxdmJqRVBNQTBHQTFVRUN3d0dhVXhsYlc5dU1Sc3dHUVlEVlFRRERCSjNkM2N1YVd4bGJXOXVkR1ZqCmFDNWpiMjB4SHpBZEJna3Foa2lHOXcwQkNRRVdFR3hwY0dkQWIzVjBiRzl2YXk1amIyMHdJQmNOTWpBd056RTMKTURFME5EQXhXaGdQTWp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VmVkeTFBSk5rZThUSXhhRUoyS2hTMGdacQowWXZEVkFRRUg0VlRMeDhWRTdxRm42QTVhaERtVUF0ZEJ5MUNkSy9JQ1o4eDdKZkRCYS9zK0p1K1ZBTGt5Mm9hCjRxVlNEUHQyCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
      service:
        name: skywalking-injection
        namespace: skywalking
    namespaceSelector:
      matchLabels:
        skywalking-injection: "true"
    name: injection.skywalking.ilemontech.com
    timeoutSeconds: 5
    sideEffects: None
    rules:
      - apiGroups: [""]
        apiVersions: ["v1"]
        operations:  ["CREATE"]
        resources:   ["pods"]
        scope: "Namespaced"

# > 1.9 & < 1.16
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
  name: skywalking-injector
webhooks:
  - failurePolicy: Fail
    clientConfig:
      caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZvakNDQTRvQ0NRREZYZTRwM1o0NjREQU5CZ2txaGtpRzl3MEJBUXNGQURDQmtURUxNQWtHQTFVRUJoTUMKUTA0eEVEQU9CZ05WQkFnTUIwSmxhV3BwYm1jeEVEQU9CZ05WQkFjTUIwSmxhV3BwYm1jeER6QU5CZ05WQkFvTQpCbWxNWlcxdmJqRVBNQTBHQTFVRUN3d0dhVXhsYlc5dU1Sc3dHUVlEVlFRRERCSjNkM2N1YVd4bGJXOXVkR1ZqCmFDNWpiMjB4SHpBZEJna3Foa2lHOXcwQkNRRVdFR3hwY0dkQWIzVjBiRzl2YXk1amIyMHdJQmNOTWpBd056RTMKTURFME5EQXhXaGdQTWpFeU1EQTNNVGN3TVRRME1ERmFNSUdSTVFzd0NRWURWUVFHRXdKRFRqRVFNQTRHQTFVRQpDQXdIUW1WcGFtbHVaekVRTUE0R0ExVUVCd3dIUW1WcGFtbHVaekVQTUEwR0ExVUVDZ3dHYVV4bGJXOXVNUTh3CkRRWURWUVFMREFacFRHVnRiMjR4R3pBWkJnTlZCQU1N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
    namespaceSelector:
      matchLabels:
        skywalking-injection: "true"
    name: injection.skywalking.ilemontech.com
    sideEffects: None
    rules:
      - apiGroups: [""]
        apiVersions: ["v1"]
        operations:  ["CREATE"]
        resources:   ["pods"]

About

Skywalking Injection,use Kubernetes Admission Controller

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published