This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/main by this push:
     new 1db1559  Add Kubernetes process detector E2E and recover process 
scanner E2E (#18)
1db1559 is described below

commit 1db155997c157774391a2d823fe3b7b690e720d6
Author: mrproliu <[email protected]>
AuthorDate: Fri Apr 29 10:25:36 2022 +0800

    Add Kubernetes process detector E2E and recover process scanner E2E (#18)
---
 .github/workflows/rover.yaml                       |  32 +++++--
 test/e2e/base/env                                  |   1 +
 .../prepare/setup-e2e-shell/install-helm.sh        |  29 ++++++
 .../prepare/setup-e2e-shell/install-istioctl.sh    |  29 ++++++
 .../prepare/setup-e2e-shell/install-kubectl.sh     |  29 ++++++
 .../agent_sensor/golang/Dockerfile.go2sky          |   0
 .../agent_sensor/golang/docker-compose.yml         |   4 +-
 .../{ => process}/agent_sensor/golang/e2e.yaml     |   2 +-
 .../agent_sensor/golang/expected/instance.yml      |   0
 .../agent_sensor/golang/expected/process.yml       |   0
 .../agent_sensor/golang/expected/service.yml       |   0
 test/e2e/cases/process/istio/e2e.yaml              | 100 +++++++++++++++++++++
 .../golang => process/istio}/expected/process.yml  |  22 ++---
 .../istio/expected/service-instance.yml}           |  15 ++--
 test/e2e/cases/process/istio/expected/service.yml  |  59 ++++++++++++
 .../{base/env => cases/process/istio/kind.yaml}    |  14 ++-
 test/e2e/cases/process/istio/rover.yaml            |  93 +++++++++++++++++++
 17 files changed, 399 insertions(+), 30 deletions(-)

diff --git a/.github/workflows/rover.yaml b/.github/workflows/rover.yaml
index b5794ae..fe767ff 100644
--- a/.github/workflows/rover.yaml
+++ b/.github/workflows/rover.yaml
@@ -66,7 +66,6 @@ jobs:
 
   e2e-test:
     name: E2E test
-    if: ${{ false }}  # disable for temporary, it would activate after OAP 
side finished
     needs: [ docker ]
     runs-on: ubuntu-latest
     timeout-minutes: 60
@@ -82,7 +81,26 @@ jobs:
             config: test/e2e/cases/profiling/c/e2e.yaml
 
           - name: go2sky Agent Sensor
-            config: test/e2e/cases/agent_sensor/golang/e2e.yaml
+            config: test/e2e/cases/process/agent_sensor/golang/e2e.yaml
+
+          - name: Istio Process Finder 1.8.2
+            config: test/e2e/cases/process/istio/e2e.yaml
+            env: ISTIO_VERSION=1.8.2
+          - name: Istio Process Finder 1.9.1
+            config: test/e2e/cases/process/istio/e2e.yaml
+            env: ISTIO_VERSION=1.9.1
+          - name: Istio Process Finder 1.10.3
+            config: test/e2e/cases/process/istio/e2e.yaml
+            env: ISTIO_VERSION=1.10.3
+          - name: Istio Process Finder 1.11.4
+            config: test/e2e/cases/process/istio/e2e.yaml
+            env: ISTIO_VERSION=1.11.4
+          - name: Istio Process Finder 1.12.0
+            config: test/e2e/cases/process/istio/e2e.yaml
+            env: ISTIO_VERSION=1.12.0
+          - name: Istio Process Finder 1.13.1
+            config: test/e2e/cases/process/istio/e2e.yaml
+            env: ISTIO_VERSION=1.13.1
     steps:
       - uses: actions/checkout@v2
         with:
@@ -98,6 +116,8 @@ jobs:
         uses: actions/setup-go@v2
         with:
           go-version: '1.16'
+      - name: Set env var
+        run: echo "${{ matrix.test.env }}"  >> $GITHUB_ENV
       - name: ${{ matrix.test.name }}
         uses: apache/skywalking-infra-e2e@main
         with:
@@ -114,7 +134,7 @@ jobs:
     name: Required
     needs:
       - build
-#      - e2e-test
+      - e2e-test
     runs-on: ubuntu-latest
     timeout-minutes: 10
     steps:
@@ -123,6 +143,6 @@ jobs:
           if [[ ${{ needs.build.result }} != 'success' ]]; then
             exit -1
           fi
-#          if [[ ${{ needs.e2e-test.result }} != 'success' ]]; then
-#            exit -1
-#          fi
\ No newline at end of file
+          if [[ ${{ needs.e2e-test.result }} != 'success' ]]; then
+            exit -1
+          fi
\ No newline at end of file
diff --git a/test/e2e/base/env b/test/e2e/base/env
index 1f008e8..9154c68 100644
--- a/test/e2e/base/env
+++ b/test/e2e/base/env
@@ -14,5 +14,6 @@
 # limitations under the License.
 
 SW_CTL_COMMIT=5a62c2e029e17234e6bbad18ced0ce31d0f67ce9
+SW_KUBERNETES_COMMIT_SHA=0f3ec68e5a7e1608cec8688716b848ed15e971e5
 
 SW_AGENT_GO_COMMIT=216f122d942cb683f48578d3014cc5ea83637582
\ No newline at end of file
diff --git a/test/e2e/base/scripts/prepare/setup-e2e-shell/install-helm.sh 
b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-helm.sh
new file mode 100644
index 0000000..2d53f8f
--- /dev/null
+++ b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-helm.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+BASE_DIR=$1
+BIN_DIR=$2
+HELMVERSION=${HELMVERSION:-'helm-v3.0.0'}
+
+if ! command -v helm &> /dev/null; then
+  mkdir -p $BASE_DIR/helm && cd $BASE_DIR/helm
+  curl -sSL https://get.helm.sh/${HELMVERSION}-linux-amd64.tar.gz | tar xz -C 
$BIN_DIR --strip-components=1 linux-amd64/helm
+fi
\ No newline at end of file
diff --git a/test/e2e/base/scripts/prepare/setup-e2e-shell/install-istioctl.sh 
b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-istioctl.sh
new file mode 100644
index 0000000..bf9ff11
--- /dev/null
+++ b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-istioctl.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+BASE_DIR=$1
+BIN_DIR=$2
+
+if ! command -v istioctl &> /dev/null; then
+  mkdir -p $BASE_DIR/istioctl && cd $BASE_DIR/istioctl
+  curl -L https://istio.io/downloadIstio | sh -
+  cp istio-$ISTIO_VERSION/bin/istioctl $BIN_DIR/istioctl
+fi
\ No newline at end of file
diff --git a/test/e2e/base/scripts/prepare/setup-e2e-shell/install-kubectl.sh 
b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-kubectl.sh
new file mode 100644
index 0000000..792661f
--- /dev/null
+++ b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-kubectl.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+BASE_DIR=$1
+BIN_DIR=$2
+K8SVERSION=${K8SVERSION:-'k8s-v1.19.2'}
+
+if ! command -v kubectl &> /dev/null; then
+  curl -sSL 
"https://storage.googleapis.com/kubernetes-release/release/${K8SVERSION#k8s-}/bin/linux/amd64/kubectl";
 -o $BIN_DIR/kubectl
+  chmod +x $BIN_DIR/kubectl
+fi
\ No newline at end of file
diff --git a/test/e2e/cases/agent_sensor/golang/Dockerfile.go2sky 
b/test/e2e/cases/process/agent_sensor/golang/Dockerfile.go2sky
similarity index 100%
rename from test/e2e/cases/agent_sensor/golang/Dockerfile.go2sky
rename to test/e2e/cases/process/agent_sensor/golang/Dockerfile.go2sky
diff --git a/test/e2e/cases/agent_sensor/golang/docker-compose.yml 
b/test/e2e/cases/process/agent_sensor/golang/docker-compose.yml
similarity index 94%
rename from test/e2e/cases/agent_sensor/golang/docker-compose.yml
rename to test/e2e/cases/process/agent_sensor/golang/docker-compose.yml
index 55e83c5..5583422 100644
--- a/test/e2e/cases/agent_sensor/golang/docker-compose.yml
+++ b/test/e2e/cases/process/agent_sensor/golang/docker-compose.yml
@@ -18,14 +18,14 @@ version: '2.1'
 services:
   oap:
     extends:
-      file: ../../../base/base-compose.yml
+      file: ../../../../base/base-compose.yml
       service: oap
     ports:
       - 12800:12800
 
   rover:
     extends:
-      file: ../../../base/base-compose.yml
+      file: ../../../../base/base-compose.yml
       service: rover
     environment:
       ROVER_PROCESS_DISCOVERY_SCAN_MODE: AGENT_SENSOR
diff --git a/test/e2e/cases/agent_sensor/golang/e2e.yaml 
b/test/e2e/cases/process/agent_sensor/golang/e2e.yaml
similarity index 95%
rename from test/e2e/cases/agent_sensor/golang/e2e.yaml
rename to test/e2e/cases/process/agent_sensor/golang/e2e.yaml
index 6806cfa..4289916 100644
--- a/test/e2e/cases/agent_sensor/golang/e2e.yaml
+++ b/test/e2e/cases/process/agent_sensor/golang/e2e.yaml
@@ -17,7 +17,7 @@ setup:
   env: compose
   file: docker-compose.yml
   timeout: 20m
-  init-system-environment: ../../../base/env
+  init-system-environment: ../../../../base/env
   steps:
     - name: set PATH
       command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
diff --git a/test/e2e/cases/agent_sensor/golang/expected/instance.yml 
b/test/e2e/cases/process/agent_sensor/golang/expected/instance.yml
similarity index 100%
rename from test/e2e/cases/agent_sensor/golang/expected/instance.yml
rename to test/e2e/cases/process/agent_sensor/golang/expected/instance.yml
diff --git a/test/e2e/cases/agent_sensor/golang/expected/process.yml 
b/test/e2e/cases/process/agent_sensor/golang/expected/process.yml
similarity index 100%
copy from test/e2e/cases/agent_sensor/golang/expected/process.yml
copy to test/e2e/cases/process/agent_sensor/golang/expected/process.yml
diff --git a/test/e2e/cases/agent_sensor/golang/expected/service.yml 
b/test/e2e/cases/process/agent_sensor/golang/expected/service.yml
similarity index 100%
copy from test/e2e/cases/agent_sensor/golang/expected/service.yml
copy to test/e2e/cases/process/agent_sensor/golang/expected/service.yml
diff --git a/test/e2e/cases/process/istio/e2e.yaml 
b/test/e2e/cases/process/istio/e2e.yaml
new file mode 100644
index 0000000..731d050
--- /dev/null
+++ b/test/e2e/cases/process/istio/e2e.yaml
@@ -0,0 +1,100 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is used to show how to write configuration files and can be used 
to test.
+
+setup:
+  env: kind
+  file: kind.yaml
+  init-system-environment: ../../../base/env
+  kind:
+    import-images:
+      - apache/skywalking-rover:latest
+    expose-ports:
+      - namespace: istio-system
+        resource: service/skywalking-ui
+        port: 80
+  steps:
+    - name: set PATH
+      command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
+    - name: install swctl
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh 
swctl
+    - name: install kubectl
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh 
kubectl
+    - name: install istio
+      command: |
+        bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh istioctl
+        istioctl install -y --set profile=demo
+        kubectl label namespace default istio-injection=enabled
+    - name: Install helm
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh 
helm
+    - name: Install SkyWalking
+      command: |
+        rm -rf skywalking-kubernetes && git clone 
https://github.com/apache/skywalking-kubernetes.git
+        cd skywalking-kubernetes
+        git reset --hard $SW_KUBERNETES_COMMIT_SHA
+        cd chart
+        helm dep up skywalking
+        helm -n istio-system install skywalking skywalking \
+                       --set fullnameOverride=skywalking \
+                       --set elasticsearch.replicas=1 \
+                       --set elasticsearch.minimumMasterNodes=1 \
+                       --set elasticsearch.imageTag=7.5.1 \
+                       --set oap.replicas=1 \
+                       --set ui.image.repository=ghcr.io/apache/skywalking/ui \
+                       --set ui.image.tag=latest \
+                       --set oap.image.tag=latest \
+                       --set 
oap.image.repository=ghcr.io/apache/skywalking/oap \
+                       --set oap.storageType=elasticsearch
+      wait:
+        - namespace: istio-system
+          resource: deployments/skywalking-oap
+          for: condition=available
+    - name: Deploy demo services
+      command: |
+        kubectl apply -f 
https://raw.githubusercontent.com/istio/istio/$ISTIO_VERSION/samples/bookinfo/platform/kube/bookinfo.yaml
+        kubectl apply -f 
https://raw.githubusercontent.com/istio/istio/$ISTIO_VERSION/samples/bookinfo/networking/bookinfo-gateway.yaml
+        kubectl apply -f 
https://raw.githubusercontent.com/istio/istio/$ISTIO_VERSION/samples/bookinfo/networking/destination-rule-all.yaml
+        kubectl apply -f 
https://raw.githubusercontent.com/istio/istio/$ISTIO_VERSION/samples/bookinfo/networking/virtual-service-all-v1.yaml
+      wait:
+        - namespace: default
+          resource: pod
+          for: condition=Ready
+    - name: Install SkyWalking Rover
+      command: |
+        envsubst < test/e2e/cases/process/istio/rover.yaml | kubectl apply -f -
+      wait:
+        - namespace: default
+          resource: pod
+          for: condition=Ready
+  timeout: 25m
+
+verify:
+  retry:
+    count: 20
+    interval: 10s
+  cases:
+    # service list
+    - query: swctl --display yaml 
--base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql
 service ls
+      expected: expected/service.yml
+    # service instance list
+    - query: swctl --display yaml 
--base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql
 instance list --service-name=default::productpage
+      expected: expected/service-instance.yml
+    # process list
+    - query: |
+        swctl --display yaml 
--base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql
 process list --service-name=default::productpage --instance-name=$( \
+          swctl --display yaml 
--base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql
 instance list --service-name=default::productpage |yq e '.[0].name' - \
+        )
+      expected: expected/process.yml
diff --git a/test/e2e/cases/agent_sensor/golang/expected/process.yml 
b/test/e2e/cases/process/istio/expected/process.yml
similarity index 75%
rename from test/e2e/cases/agent_sensor/golang/expected/process.yml
rename to test/e2e/cases/process/istio/expected/process.yml
index ca17857..c86d7d2 100644
--- a/test/e2e/cases/agent_sensor/golang/expected/process.yml
+++ b/test/e2e/cases/process/istio/expected/process.yml
@@ -15,23 +15,25 @@
 
 {{- contains . }}
 - id: {{ notEmpty .id }}
-  name: go2sky-instance
-  serviceid: {{ b64enc "go2sky" }}.1
-  servicename: go2sky
-  instanceid: {{ b64enc "go2sky" }}.1_{{ b64enc "go2sky-instance" }}
-  instancename: go2sky-instance
-  layer: GENERAL
+  name: envoy
+  serviceid: {{ b64enc "default::productpage" }}.1
+  servicename: default::productpage
+  instanceid: {{ notEmpty .instanceid }}
+  instancename: {{ notEmpty .instancename }}
+  layer: MESH_DP
   agentid: {{ notEmpty .agentid }}
-  detecttype: VM
+  detecttype: KUBERNETES
   attributes:
     {{- contains .attributes }}
     - name: host_ip
       value: {{ notEmpty .value }}
+    - name: container_ip
+      value: {{ notEmpty .value }}
     - name: pid
       value: {{ notEmpty .value }}
     - name: command_line
-      value: /main --grpc --oap-server oap:11800
+      value: {{ notEmpty .value }}
     {{- end }}
   labels:
-    - e2e-label
-{{- end }}
\ No newline at end of file
+    - mesh-envoy
+{{- end }}
diff --git a/test/e2e/cases/agent_sensor/golang/expected/service.yml 
b/test/e2e/cases/process/istio/expected/service-instance.yml
similarity index 82%
rename from test/e2e/cases/agent_sensor/golang/expected/service.yml
rename to test/e2e/cases/process/istio/expected/service-instance.yml
index 5b244c0..b8e3c0f 100644
--- a/test/e2e/cases/agent_sensor/golang/expected/service.yml
+++ b/test/e2e/cases/process/istio/expected/service-instance.yml
@@ -14,11 +14,10 @@
 # limitations under the License.
 
 {{- contains . }}
-- id: {{ b64enc "go2sky" }}.1
-  name: go2sky
-  group: ""
-  shortname: go2sky
-  layers:
-    - GENERAL
-  normal: true
-{{- end }}
\ No newline at end of file
+- id: {{ notEmpty .id }}
+  name: {{ notEmpty .name }}
+  attributes: []
+  language: UNKNOWN
+  instanceuuid: {{ notEmpty .instanceuuid }}
+  layer: MESH_DP
+{{- end }}
diff --git a/test/e2e/cases/process/istio/expected/service.yml 
b/test/e2e/cases/process/istio/expected/service.yml
new file mode 100644
index 0000000..5aa540b
--- /dev/null
+++ b/test/e2e/cases/process/istio/expected/service.yml
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- contains . }}
+- id: {{ b64enc "default::details" }}.1
+  name: default::details
+  group: default
+  shortname: details
+  layers:
+    - MESH_DP
+  normal: true
+- id: {{ b64enc "istio-system::istio-ingressgateway" }}.1
+  name: istio-system::istio-ingressgateway
+  group: istio-system
+  shortname: istio-ingressgateway
+  layers:
+    - MESH_DP
+  normal: true
+- id: {{ b64enc "default::productpage" }}.1
+  name: default::productpage
+  group: default
+  shortname: productpage
+  layers:
+    - MESH_DP
+  normal: true
+- id: {{ b64enc "default::ratings" }}.1
+  name: default::ratings
+  group: default
+  shortname: ratings
+  layers:
+    - MESH_DP
+  normal: true
+- id: {{ b64enc "default::reviews" }}.1
+  name: default::reviews
+  group: default
+  shortname: reviews
+  layers:
+    - MESH_DP
+  normal: true
+- id: {{ b64enc "istio-system::istio-egressgateway" }}.1
+  name: istio-system::istio-egressgateway
+  group: istio-system
+  shortname: istio-egressgateway
+  layers:
+    - MESH_DP
+  normal: true
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e/base/env b/test/e2e/cases/process/istio/kind.yaml
similarity index 72%
copy from test/e2e/base/env
copy to test/e2e/cases/process/istio/kind.yaml
index 1f008e8..2f9384f 100644
--- a/test/e2e/base/env
+++ b/test/e2e/cases/process/istio/kind.yaml
@@ -13,6 +13,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_CTL_COMMIT=5a62c2e029e17234e6bbad18ced0ce31d0f67ce9
-
-SW_AGENT_GO_COMMIT=216f122d942cb683f48578d3014cc5ea83637582
\ No newline at end of file
+# this config file contains all config fields with comments
+# NOTE: this is not a particularly useful config file
+kind: Cluster
+apiVersion: kind.x-k8s.io/v1alpha4
+nodes:
+  # the control plane node config
+  - role: control-plane
+  # the three workers
+  - role: worker
+  - role: worker
+  - role: worker
diff --git a/test/e2e/cases/process/istio/rover.yaml 
b/test/e2e/cases/process/istio/rover.yaml
new file mode 100644
index 0000000..cf769db
--- /dev/null
+++ b/test/e2e/cases/process/istio/rover.yaml
@@ -0,0 +1,93 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: skywalking-rover
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: skywalking-rover
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: skywalking-rover
+subjects:
+  - kind: ServiceAccount
+    name: skywalking-rover
+    namespace: default
+---
+kind: ClusterRole
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: skywalking-rover
+rules:
+  - apiGroups: [""]
+    resources: ["pods", "nodes", "services"]
+    verbs: ["get", "watch", "list"]
+---
+
+apiVersion: apps/v1
+kind: DaemonSet
+metadata:
+  name: skywalking-rover
+spec:
+  selector:
+    matchLabels:
+      name: skywalking-rover
+  template:
+    metadata:
+      labels:
+        name: skywalking-rover
+    spec:
+      serviceAccountName: skywalking-rover
+      serviceAccount: skywalking-rover
+      containers:
+        - name: skywalking-rover
+          # SkyWalking Rover image path
+          image: apache/skywalking-rover:latest
+          imagePullPolicy: IfNotPresent
+          securityContext:
+            capabilities:
+              add:
+                - SYS_PTRACE
+                - SYS_ADMIN
+            privileged: true
+          volumeMounts:
+            - name: host
+              mountPath: /host
+              readOnly: true
+          env:
+            - name: ROVER_PROCESS_DISCOVERY_KUBERNETES_ACTIVE
+              value: "true"
+            - name: ROVER_PROCESS_DISCOVERY_KUBERNETES_NODE_NAME
+              valueFrom:
+                fieldRef:
+                  fieldPath: spec.nodeName
+            - name: ROVER_BACKEND_ADDR
+              # backend OAP address
+              value: skywalking-oap.istio-system:11800
+            - name: 
ROVER_PROCESS_DISCOVERY_KUBERNETES_ANALYZER_K8S_SERVICE_ACTIVE
+              value: "false"
+      hostPID: true
+      hostNetwork: true
+      dnsPolicy: ClusterFirstWithHostNet
+      volumes:
+        - name: host
+          hostPath:
+            path: /
+            type: Directory
\ No newline at end of file

Reply via email to