From 239eaa01fdf0da2612c5245fe479b7f765408afb Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Thu, 15 Oct 2020 23:20:46 +0800 Subject: [PATCH] test: set up ALS E2E test (#5675) --- .github/workflows/ci-it.yaml | 2 - .github/workflows/e2e.cluster.yaml | 2 - .github/workflows/e2e.go.yaml | 2 - .github/workflows/e2e.istio.yaml | 119 ++++++++ .github/workflows/e2e.jdk-versions.yaml | 2 - .github/workflows/e2e.js.yaml | 5 +- .github/workflows/e2e.kafka.yaml | 4 +- .github/workflows/e2e.php.yaml | 2 - .github/workflows/e2e.profiling.yaml | 2 - .github/workflows/e2e.python.yaml | 2 - .github/workflows/e2e.storages.yaml | 2 - .github/workflows/e2e.ttl.yaml | 2 - .github/workflows/e2e.yaml | 2 - .github/workflows/istio-mixer-ci.yaml | 67 ----- .github/workflows/plugins-jdk14-test.0.yaml | 5 - .github/workflows/plugins-test.0.yaml | 5 - .github/workflows/plugins-test.1.yaml | 5 - .github/workflows/plugins-test.2.yaml | 5 - .github/workflows/plugins-test.3.yaml | 5 - Makefile | 12 +- README.md | 1 - docker/oap/Dockerfile.oap | 4 +- install/README.md | 7 - install/deploy/all_cleanup.sh | 21 -- install/deploy/demo-deploy.sh | 47 --- install/deploy/istio-deploy.sh | 109 ------- install/deploy/skywalking-deploy.sh | 72 ----- install/kubernetes/helm/skywalking/Chart.yaml | 34 --- install/kubernetes/helm/skywalking/README.md | 232 --------------- .../charts/elasticsearch/Chart.yaml | 42 --- .../charts/elasticsearch/templates/NOTES.txt | 38 --- .../elasticsearch/templates/_helpers.tpl | 80 ------ .../elasticsearch/templates/deployment.yaml | 71 ----- .../elasticsearch/templates/ingress.yaml | 56 ---- .../elasticsearch/templates/service.yaml | 32 --- .../charts/elasticsearch/values.yaml | 83 ------ .../helm/skywalking/templates/NOTES.txt | 43 --- .../helm/skywalking/templates/_helpers.tpl | 78 ----- .../skywalking/templates/es-init.job.yaml | 53 ---- .../templates/istio-adapter/adapter.yaml | 27 -- .../templates/istio-adapter/handler.yaml | 26 -- .../templates/istio-adapter/instance.yaml | 42 --- .../templates/istio-adapter/rule.yaml | 28 -- .../skywalking/templates/oap-clusterrole.yaml | 33 --- .../templates/oap-clusterrolebinding.yaml | 34 --- .../skywalking/templates/oap-deployment.yaml | 118 -------- .../helm/skywalking/templates/oap-role.yaml | 30 -- .../skywalking/templates/oap-rolebinding.yaml | 34 --- .../helm/skywalking/templates/oap-svc.yaml | 36 --- .../kubernetes/helm/skywalking/values.yaml | 269 ------------------ .../kubernetes/NamespacedPodListInformer.java | 6 +- .../als/K8sALSServiceMeshHTTPAnalysis.java | 2 - .../e2e-istio/scripts/{clean.sh => demo.sh} | 12 +- .../scripts/{compile_build.sh => istio.sh} | 13 +- test/e2e-mesh/e2e-istio/scripts/minikube.sh | 29 +- test/e2e-mesh/e2e-istio/scripts/pre.sh | 50 +--- .../e2e/retryable/RetryableTest.java | 2 +- .../skywalking/e2e/SimpleQueryClient.java | 28 +- .../e2e/verification/AbstractMatcher.java | 10 + .../e2e/base/TrafficController.java | 6 +- .../apache/skywalking/e2e/mesh/ALSE2E.java | 264 +++++++++++++++++ .../apache/skywalking/e2e/mesh/IDManager.java | 58 ++++ .../expected/als/endpoints-details.yml | 9 +- .../expected/als/endpoints-productpage.yml | 11 +- .../expected/als/endpoints-ratings.yml | 13 +- .../expected/als/endpoints-reviews.yml | 25 +- .../test/resources/expected/als/instances.yml | 18 ++ .../test/resources/expected/als/services.yml | 37 +-- .../src/test/resources/expected/als/topo.yml | 93 ++++++ 69 files changed, 648 insertions(+), 2070 deletions(-) create mode 100644 .github/workflows/e2e.istio.yaml delete mode 100644 .github/workflows/istio-mixer-ci.yaml delete mode 100644 install/README.md delete mode 100644 install/deploy/all_cleanup.sh delete mode 100644 install/deploy/demo-deploy.sh delete mode 100644 install/deploy/istio-deploy.sh delete mode 100644 install/deploy/skywalking-deploy.sh delete mode 100644 install/kubernetes/helm/skywalking/Chart.yaml delete mode 100644 install/kubernetes/helm/skywalking/README.md delete mode 100644 install/kubernetes/helm/skywalking/charts/elasticsearch/Chart.yaml delete mode 100644 install/kubernetes/helm/skywalking/charts/elasticsearch/templates/NOTES.txt delete mode 100644 install/kubernetes/helm/skywalking/charts/elasticsearch/templates/_helpers.tpl delete mode 100644 install/kubernetes/helm/skywalking/charts/elasticsearch/templates/deployment.yaml delete mode 100644 install/kubernetes/helm/skywalking/charts/elasticsearch/templates/ingress.yaml delete mode 100644 install/kubernetes/helm/skywalking/charts/elasticsearch/templates/service.yaml delete mode 100644 install/kubernetes/helm/skywalking/charts/elasticsearch/values.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/NOTES.txt delete mode 100644 install/kubernetes/helm/skywalking/templates/_helpers.tpl delete mode 100644 install/kubernetes/helm/skywalking/templates/es-init.job.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/istio-adapter/adapter.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/istio-adapter/handler.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/istio-adapter/instance.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/istio-adapter/rule.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/oap-clusterrole.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/oap-clusterrolebinding.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/oap-deployment.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/oap-role.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/oap-rolebinding.yaml delete mode 100644 install/kubernetes/helm/skywalking/templates/oap-svc.yaml delete mode 100644 install/kubernetes/helm/skywalking/values.yaml rename test/e2e-mesh/e2e-istio/scripts/{clean.sh => demo.sh} (71%) mode change 100755 => 100644 rename test/e2e-mesh/e2e-istio/scripts/{compile_build.sh => istio.sh} (83%) mode change 100755 => 100644 create mode 100644 test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/ALSE2E.java create mode 100644 test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/IDManager.java rename install/kubernetes/helm/skywalking/OWNERS => test/e2e/e2e-test/src/test/resources/expected/als/endpoints-details.yml (92%) rename install/kubernetes/helm/skywalking/charts/elasticsearch/templates/serviceaccount.yaml => test/e2e/e2e-test/src/test/resources/expected/als/endpoints-productpage.yml (78%) rename install/kubernetes/helm/skywalking/templates/oap-serviceaccount.yaml => test/e2e/e2e-test/src/test/resources/expected/als/endpoints-ratings.yml (70%) rename install/kubernetes/helm/skywalking/.helmignore => test/e2e/e2e-test/src/test/resources/expected/als/endpoints-reviews.yml (69%) create mode 100644 test/e2e/e2e-test/src/test/resources/expected/als/instances.yml rename install/kubernetes/helm/skywalking/charts/elasticsearch/.helmignore => test/e2e/e2e-test/src/test/resources/expected/als/services.yml (69%) create mode 100644 test/e2e/e2e-test/src/test/resources/expected/als/topo.yml diff --git a/.github/workflows/ci-it.yaml b/.github/workflows/ci-it.yaml index fe0099f70d..976ed85cd3 100644 --- a/.github/workflows/ci-it.yaml +++ b/.github/workflows/ci-it.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: MAVEN_OPTS: -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit diff --git a/.github/workflows/e2e.cluster.yaml b/.github/workflows/e2e.cluster.yaml index 5f988b996d..0b895096f6 100644 --- a/.github/workflows/e2e.cluster.yaml +++ b/.github/workflows/e2e.cluster.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.go.yaml b/.github/workflows/e2e.go.yaml index 1b3846672c..2b5e267f9f 100644 --- a/.github/workflows/e2e.go.yaml +++ b/.github/workflows/e2e.go.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.istio.yaml b/.github/workflows/e2e.istio.yaml new file mode 100644 index 0000000000..28db870268 --- /dev/null +++ b/.github/workflows/e2e.istio.yaml @@ -0,0 +1,119 @@ +# 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. + +name: Istio + +on: + pull_request: + push: + branches: + - master + +env: + SKIP_TEST: true + ES_VERSION: es7 + ISTIO_VERSION: 1.7.1 + TAG: ${{ github.sha }} + SCRIPTS_DIR: test/e2e-mesh/e2e-istio/scripts + SW_OAP_BASE_IMAGE: openjdk:8-jre-alpine + +jobs: + als: + runs-on: ubuntu-16.04 + timeout-minutes: 60 + name: Istio+Envoy Access Log Service + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + + - name: Build Docker Image + run: make docker + + - name: Prepare envrionment + run: bash ${SCRIPTS_DIR}/pre.sh + + - name: Install Minikube + run: bash ${SCRIPTS_DIR}/minikube.sh start + + - name: Install Istio + run: bash ${SCRIPTS_DIR}/istio.sh --set profile=demo --set meshConfig.defaultConfig.envoyAccessLogService.address=skywalking-oap.istio-system:11800 --set meshConfig.enableEnvoyAccessLogService=true + + - name: Install SkyWalking + run: | + git clone https://github.com/apache/skywalking-kubernetes.git + cd skywalking-kubernetes + git reset --hard 419cd1aed8bb4ad972208e5a031527a25d2ae690 + cd chart + helm dep up skywalking + helm -n istio-system install skywalking skywalking \ + --set fullnameOverride=skywalking \ + --set elasticsearch.replicas=1 \ + --set oap.env.SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh \ + --set oap.envoy.als.enabled=true \ + --set oap.replicas=1 \ + --set oap.image.tag=$TAG \ + --set oap.image.repository=skywalking/oap + kubectl -n istio-system get pods + + sleep 3 + kubectl -n istio-system wait --for=condition=available deployments/skywalking-oap --timeout=1200s + kubectl get pods -A -o wide --show-labels + kubectl get services -A -o wide + + - name: Deploy demo services + run: bash ${SCRIPTS_DIR}/demo.sh + + - name: Cluster Info + if: ${{ failure() }} + run: | + df -h + minikube logs + minikube status + + - name: Set up Minikube tunnel + run: | + mkdir /tmp/minikube-tunnel + minikube tunnel > /tmp/minikube-tunnel/a.log & + export POD_NAME=$(kubectl get pods -n istio-system -l "app=skywalking,release=skywalking,component=ui" -o jsonpath="{.items[0].metadata.name}") + echo $POD_NAME + kubectl -n istio-system port-forward $POD_NAME 8080:8080 > /tmp/minikube-tunnel/b.log & + + - name: Run E2E test + run: | + export GATEWAY_HOST=$(minikube ip) + export GATEWAY_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}') + export WEBAPP_HOST=127.0.0.1 + export WEBAPP_PORT=8080 + + ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.mesh.ALSE2E + + - name: Logs + if: ${{ failure() }} + run: | + kubectl -n istio-system logs --tail=10000 -l "app=skywalking,release=skywalking,component=ui" + kubectl -n istio-system logs --tail=10000 -l "app=skywalking,release=skywalking,component=oap" + cat /tmp/minikube-tunnel/* + + - name: Clean up + if: ${{ always() }} + run: minikube delete diff --git a/.github/workflows/e2e.jdk-versions.yaml b/.github/workflows/e2e.jdk-versions.yaml index 7680139027..e29e4e98f8 100644 --- a/.github/workflows/e2e.jdk-versions.yaml +++ b/.github/workflows/e2e.jdk-versions.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.js.yaml b/.github/workflows/e2e.js.yaml index 950d7272ee..903bf0351c 100644 --- a/.github/workflows/e2e.js.yaml +++ b/.github/workflows/e2e.js.yaml @@ -21,8 +21,7 @@ on: push: branches: - master - tags: - - 'v*' + env: SKIP_TEST: true @@ -61,4 +60,4 @@ jobs: if: failure() with: name: logs - path: logs \ No newline at end of file + path: logs diff --git a/.github/workflows/e2e.kafka.yaml b/.github/workflows/e2e.kafka.yaml index 19cd49e842..e8e4c9940c 100644 --- a/.github/workflows/e2e.kafka.yaml +++ b/.github/workflows/e2e.kafka.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true @@ -115,4 +113,4 @@ jobs: if: failure() with: name: logs - path: logs \ No newline at end of file + path: logs diff --git a/.github/workflows/e2e.php.yaml b/.github/workflows/e2e.php.yaml index 3f2071fe1d..7122d31175 100644 --- a/.github/workflows/e2e.php.yaml +++ b/.github/workflows/e2e.php.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.profiling.yaml b/.github/workflows/e2e.profiling.yaml index 40c1d08b4c..20a2212521 100644 --- a/.github/workflows/e2e.profiling.yaml +++ b/.github/workflows/e2e.profiling.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.python.yaml b/.github/workflows/e2e.python.yaml index 11f44774be..84c11f6de7 100644 --- a/.github/workflows/e2e.python.yaml +++ b/.github/workflows/e2e.python.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.storages.yaml b/.github/workflows/e2e.storages.yaml index c844442b68..0b9cd36f3e 100644 --- a/.github/workflows/e2e.storages.yaml +++ b/.github/workflows/e2e.storages.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.ttl.yaml b/.github/workflows/e2e.ttl.yaml index 4a2d1d1265..43e9f53611 100644 --- a/.github/workflows/e2e.ttl.yaml +++ b/.github/workflows/e2e.ttl.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 19e7c67e30..348de064c1 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -21,8 +21,6 @@ on: push: branches: - master - tags: - - 'v*' env: SKIP_TEST: true diff --git a/.github/workflows/istio-mixer-ci.yaml b/.github/workflows/istio-mixer-ci.yaml deleted file mode 100644 index 48ad9c0859..0000000000 --- a/.github/workflows/istio-mixer-ci.yaml +++ /dev/null @@ -1,67 +0,0 @@ -# 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. - -name: istio-mixer-ci - -on: - pull_request: - push: - branches: - - master - tags: - - 'v*' - -env: - SCRIPTS_DIR: ./test/e2e-mesh/e2e-istio/scripts - LOG_DIR: /tmp/skywalking - INSTALL_SCRIPTS_DIR: ./install/deploy -jobs: - build: - runs-on: ubuntu-16.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Prepare enviroment - run: | - bash ${SCRIPTS_DIR}/pre.sh - mkdir -p ${LOG_DIR} - - name: Compile all and Build docker image - run: bash ${SCRIPTS_DIR}/compile_build.sh - - name: Start minikube - run: bash ${SCRIPTS_DIR}/minikube.sh start > ${LOG_DIR}/minikube-start-log.txt 2>&1 & - - name: Wating minikube ready - run: bash ${SCRIPTS_DIR}/minikube.sh wait - - name: Setup tunnel - run: minikube tunnel --log_dir=${LOG_DIR} & - - name: Istio install - run: bash ${INSTALL_SCRIPTS_DIR}/istio-deploy.sh - - name: SW And ES install - run: bash ${INSTALL_SCRIPTS_DIR}/skywalking-deploy.sh - - name: Bookinfo demo install - run: bash ${INSTALL_SCRIPTS_DIR}/demo-deploy.sh - - uses: actions/upload-artifact@v1.0.0 - if: always() - with: - name: logs - path: /tmp/skywalking diff --git a/.github/workflows/plugins-jdk14-test.0.yaml b/.github/workflows/plugins-jdk14-test.0.yaml index c739c2d508..16348a5947 100644 --- a/.github/workflows/plugins-jdk14-test.0.yaml +++ b/.github/workflows/plugins-jdk14-test.0.yaml @@ -18,11 +18,6 @@ name: PluginsJDK14Test on: pull_request: - push: - branches: - - master - tags: - - 'v*' jobs: PluginsJDK14Test: diff --git a/.github/workflows/plugins-test.0.yaml b/.github/workflows/plugins-test.0.yaml index 3e8bb6361e..25d07a9b67 100644 --- a/.github/workflows/plugins-test.0.yaml +++ b/.github/workflows/plugins-test.0.yaml @@ -18,11 +18,6 @@ name: PluginsTest on: pull_request: - push: - branches: - - master - tags: - - 'v*' jobs: PluginsTest: diff --git a/.github/workflows/plugins-test.1.yaml b/.github/workflows/plugins-test.1.yaml index b4635cea8b..e6989affa7 100644 --- a/.github/workflows/plugins-test.1.yaml +++ b/.github/workflows/plugins-test.1.yaml @@ -18,11 +18,6 @@ name: PluginsTest on: pull_request: - push: - branches: - - master - tags: - - 'v*' jobs: PluginsTest: diff --git a/.github/workflows/plugins-test.2.yaml b/.github/workflows/plugins-test.2.yaml index d328d44691..019782c601 100644 --- a/.github/workflows/plugins-test.2.yaml +++ b/.github/workflows/plugins-test.2.yaml @@ -18,11 +18,6 @@ name: PluginsTest on: pull_request: - push: - branches: - - master - tags: - - 'v*' jobs: PluginsTest: diff --git a/.github/workflows/plugins-test.3.yaml b/.github/workflows/plugins-test.3.yaml index 7294d8de8a..baa1a0bd9c 100644 --- a/.github/workflows/plugins-test.3.yaml +++ b/.github/workflows/plugins-test.3.yaml @@ -18,11 +18,6 @@ name: PluginsTest on: pull_request: - push: - branches: - - master - tags: - - 'v*' jobs: PluginsTest: diff --git a/Makefile b/Makefile index 1561285900..69bff7e9cd 100644 --- a/Makefile +++ b/Makefile @@ -28,16 +28,16 @@ init: .PHONY: build.all build.agent build.backend build.ui build.docker build.all: - cd $(SW_ROOT) && ./mvnw clean package -Dmaven.test.skip=$(SKIP_TEST) + cd $(SW_ROOT) && ./mvnw --batch-mode clean package -Dmaven.test.skip=$(SKIP_TEST) build.agent: - cd $(SW_ROOT) && ./mvnw clean package -Dmaven.test.skip=$(SKIP_TEST) -Pagent,dist + cd $(SW_ROOT) && ./mvnw --batch-mode clean package -Dmaven.test.skip=$(SKIP_TEST) -Pagent,dist build.backend: - cd $(SW_ROOT) && ./mvnw clean package -Dmaven.test.skip=$(SKIP_TEST) -Pbackend,dist + cd $(SW_ROOT) && ./mvnw --batch-mode clean package -Dmaven.test.skip=$(SKIP_TEST) -Pbackend,dist build.ui: - cd $(SW_ROOT) && ./mvnw clean package -Dmaven.test.skip=$(SKIP_TEST) -Pui,dist + cd $(SW_ROOT) && ./mvnw --batch-mode clean package -Dmaven.test.skip=$(SKIP_TEST) -Pui,dist DOCKER_BUILD_TOP:=${SW_OUT}/docker_build @@ -63,8 +63,8 @@ else DIST_NAME := apache-skywalking-apm-bin endif -ifneq ($(SW_OAP_JAVA_VERSION),) - BUILD_ARGS := $(BUILD_ARGS) --build-arg JAVA_VERSION=$(SW_OAP_JAVA_VERSION) +ifneq ($(SW_OAP_BASE_IMAGE),) + BUILD_ARGS := $(BUILD_ARGS) --build-arg BASE_IMAGE=$(SW_OAP_BASE_IMAGE) endif BUILD_ARGS := $(BUILD_ARGS) --build-arg DIST_NAME=$(DIST_NAME) diff --git a/README.md b/README.md index e08083efd5..8aa9af1876 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ microservices, cloud native and container-based (Docker, Kubernetes, Mesos) arch [![Maven Central](https://img.shields.io/maven-central/v/org.apache.skywalking/apache-skywalking-apm.svg)](http://skywalking.apache.org/downloads/) [![CI/IT Tests](https://github.com/apache/skywalking/workflows/CI%20AND%20IT/badge.svg?branch=master)](https://github.com/apache/skywalking/actions?query=branch%3Amaster+event%3Apush+workflow%3A%22CI+AND+IT%22) [![E2E Tests](https://github.com/apache/skywalking/workflows/E2E/badge.svg?branch=master)](https://github.com/apache/skywalking/actions?query=branch%3Amaster+event%3Apush+workflow%3AE2E) -[![Code Coverage](https://codecov.io/gh/apache/skywalking/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/skywalking/branch/master) # Abstract **SkyWalking** is an open source APM system, including monitoring, tracing, diagnosing capabilities for distributed system diff --git a/docker/oap/Dockerfile.oap b/docker/oap/Dockerfile.oap index 471415158c..430c80560e 100644 --- a/docker/oap/Dockerfile.oap +++ b/docker/oap/Dockerfile.oap @@ -14,11 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG JAVA_VERSION=8 +ARG BASE_IMAGE='adoptopenjdk/openjdk8:alpine' FROM apache/skywalking-base:8.1.0-es6 AS cli -FROM adoptopenjdk/openjdk$JAVA_VERSION:alpine +FROM $BASE_IMAGE ENV JAVA_OPTS=" -Xms256M " \ SW_CLUSTER="standalone" \ diff --git a/install/README.md b/install/README.md deleted file mode 100644 index f8d3af051e..0000000000 --- a/install/README.md +++ /dev/null @@ -1,7 +0,0 @@ -These scripts are for istio , skywalking , ES to a kubernetes cluster. - -#### Prerequisites - - - kubernetes 1.9.6+ - - helm 3 - - kubectl \ No newline at end of file diff --git a/install/deploy/all_cleanup.sh b/install/deploy/all_cleanup.sh deleted file mode 100644 index f8ae446887..0000000000 --- a/install/deploy/all_cleanup.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/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. - -set -e -# cleanup files - -rm -fr istio/ diff --git a/install/deploy/demo-deploy.sh b/install/deploy/demo-deploy.sh deleted file mode 100644 index 21eb3d29af..0000000000 --- a/install/deploy/demo-deploy.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/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. - -set -e - -#free -lh - -# The script for bookinfo Application to deploy -BOOKINFO_VERSION="1.3" -kubectl label namespace default istio-injection=enabled -kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-${BOOKINFO_VERSION}/samples/bookinfo/platform/kube/bookinfo.yaml - -# check status -kubectl get deploy | grep -E 'details|productpage|ratings|reviews' | awk '{print "deployment/"$1}' | while read deploy -do - kubectl wait ${deploy} --for condition=available --timeout=600s -done - -# request -start=$(date "+%M") -while true -do - REQUEST_STATUS=$(kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl -m 10 productpage:9080/productpage | grep -o ".*" | wc -l) - if [ $REQUEST_STATUS == 1 ]; then - break - fi - end=$(date "+%M") - time=$(($end - $start)) - if [ $time -ge 3 ]; then - echo "Request timeout" - break - fi -done diff --git a/install/deploy/istio-deploy.sh b/install/deploy/istio-deploy.sh deleted file mode 100644 index 506f35ff87..0000000000 --- a/install/deploy/istio-deploy.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/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. - -set -e - -# Add istio official repo -add_repo(){ - VERSION=$1 - REPO="https://storage.googleapis.com/istio-release/releases/${VERSION}/charts/" - helm repo add istio $REPO - - STATUS_CMD=`echo $?` - CHECK_REPO_CMD=`helm repo list | grep $REPO | wc -l` - echo "$STATUS_CMD" - echo "$CHECK_REPO_CMD" - while [[ $STATUS_CMD != 0 && $CHECK_REPO_CMD -ge 1 ]] - do - sleep 5 - helm repo add istio $REPO - - STATUS_CMD=`echo $?` - CHECK_REPO_CMD=`helm repo list | grep $REPO | wc -l` - done -} - -# Create istio-system namespace -create_namespace() { - NAMESPACE=$1 - kubectl create ns ${NAMESPACE} - - STATUS_CMD=`echo $?` - while [[ $STATUS_CMD != 0 ]] - do - sleep 5 - kubectl create ns ${NAMESPACE} - STATUS_CMD=`echo $?` - done -} - -# Create CRD need for istio -create_crd() { - NAMESPACE=$1 - helm install istio-init istio/istio-init -n ${NAMESPACE} - CRD_COUNT=`kubectl get crds | grep 'istio.i' | wc -l` - - while [[ ${CRD_COUNT} != 23 ]] - do - sleep 5 - CRD_COUNT=`kubectl get crds | grep 'istio.io' | wc -l` - done - - echo 'Istio crd create successful' -} - -# Deploy istio related components -deploy_istio() { - NAMESPACE=$1 - VERSION=$2 - CHART_DIR="istio-skywalking-ci/install/kubernetes/helm" - - git clone -b istio-skywalking-ci https://github.com/SkyAPMTest/istio-skywalking-ci.git - - cd $CHART_DIR - - helm install istio istio -n ${NAMESPACE} -f istio/values-istio-skywalking.yaml - - check() { - kubectl -n ${NAMESPACE} get deploy | grep istio | awk '{print "deployment/"$1}' | while read line ; - do - kubectl rollout status $line -n ${NAMESPACE} --timeout 10m - done - } - check - - echo "Istio is deployed successful" -} - -add_mixer_template() { - VERSION=$1 - kubectl apply -f https://raw.githubusercontent.com/istio/istio/$VERSION/mixer/template/metric/template.yaml -} - -main(){ - ISTIO_VERSION="1.3.3" - ISTIO_NAMESPACE="istio-system" - add_repo $ISTIO_VERSION - if [[ `kubectl get ns | grep $ISTIO_NAMESPACE | wc -l ` == 0 && `kubectl get ns $ISTIO_NAMESPACE | grep -v NAME | wc -l` == 0 ]] ;then - create_namespace $ISTIO_NAMESPACE - fi - create_crd $ISTIO_NAMESPACE - deploy_istio $ISTIO_NAMESPACE $ISTIO_VERSION - add_mixer_template $ISTIO_VERSION -} - -main diff --git a/install/deploy/skywalking-deploy.sh b/install/deploy/skywalking-deploy.sh deleted file mode 100644 index 9bf7fb34d4..0000000000 --- a/install/deploy/skywalking-deploy.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/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. - -set -e - -CURRENT_DIR="$(cd "$(dirname $0)"; pwd)" - -CHART_PATH="$CURRENT_DIR/../kubernetes/helm" -DPELOY_NAMESPACE="istio-system" -NEED_CHECK_PREFIX="deployment/skywalking-skywalking-" -ALS_ENABLED=true -MIXER_ENABLED=true - -cd ${CHART_PATH} - -and_stable_repo(){ - STABLE_REPO="https://kubernetes-charts.storage.googleapis.com/" - helm repo add stable $STABLE_REPO - - STATUS_CMD=`echo $?` - CHECK_REPO_CMD=`helm repo list | grep $STABLE_REPO | wc -l` - echo "$STATUS_CMD" - echo "$CHECK_REPO_CMD" - while [[ $STATUS_CMD != 0 && $CHECK_REPO_CMD -ge 1 ]] - do - sleep 5 - helm repo add stable $STABLE_REPO - - STATUS_CMD=`echo $?` - CHECK_REPO_CMD=`helm repo list | grep $STABLE_REPO | wc -l` - done -} - -and_stable_repo - -helm dep up skywalking - -sudo sysctl -w vm.max_map_count=262144 -sudo sysctl -w vm.drop_caches=1 -sudo sysctl -w vm.drop_caches=3 - -TAG="ci" -IMAGE="skywalking/oap" - -docker images - -helm -n $DPELOY_NAMESPACE install skywalking skywalking --set oap.istio.adapter.enabled=$MIXER_ENABLED \ - --set oap.envoy.als.enabled=$ALS_ENABLED --set oap.replicas=1 --set oap.image.tag=$TAG --set oap.image.repository=$IMAGE - -for component in $NEED_CHECK_PREFIX"oap" ; do - sleep 60 - kubectl get deploy -o wide -n $DPELOY_NAMESPACE - kubectl -n ${DPELOY_NAMESPACE} wait $component --for condition=available --timeout=600s -done - -rm -rf tag.txt - -echo "SkyWalking deployed successfully" diff --git a/install/kubernetes/helm/skywalking/Chart.yaml b/install/kubernetes/helm/skywalking/Chart.yaml deleted file mode 100644 index 1a46bccdce..0000000000 --- a/install/kubernetes/helm/skywalking/Chart.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# 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: v2 -name: skywalking -home: https://skywalking.apache.org -version: 0.1.2 -appVersion: latest -description: Apache SkyWalking APM System -icon: https://raw.githubusercontent.com/apache/skywalking-kubernetes/master/logo/sw-logo-for-chart.jpg -sources: -- https://github.com/apache/skywalking-kubernetes -maintainers: -- name: hanahmily - email: hanahmily@gmail.com -- name: innerpeacez - email: innerpeace.zhai@gmail.com - -dependencies: - - name: elasticsearch - version: 6.8.2 - condition: elasticsearch.enabled \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/README.md b/install/kubernetes/helm/skywalking/README.md deleted file mode 100644 index 95bfd24d8a..0000000000 --- a/install/kubernetes/helm/skywalking/README.md +++ /dev/null @@ -1,232 +0,0 @@ -` -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. -` - -# Apache Skywalking Helm Chart - -[Apache SkyWalking](https://skywalking.apache.org/) is application performance monitor tool for distributed systems, especially designed for microservices, cloud native and container-based (Docker, K8s, Mesos) architectures. - -## Introduction - -This chart bootstraps a [Apache SkyWalking](https://skywalking.apache.org/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - -## Prerequisites - - - Kubernetes 1.9.6+ - - PV dynamic provisioning support on the underlying infrastructure (StorageClass) - - Helm 3 - -## Installing the Chart - -To install the chart with the release name `my-release`: - -```shell -$ helm install my-release skywalking -n -``` - -The command deploys Apache Skywalking on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```shell -$ helm uninstall my-release -n -``` - -The command removes all the Kubernetes components associated with the chart and deletes the release. - -## Configuration - -The following table lists the configurable parameters of the Skywalking chart and their default values. - -| Parameter | Description | Default | -|---------------------------------------|--------------------------------------------------------------------|-------------------------------------| -| `nameOverride` | Override name | `nil` | -| `serviceAccounts.oap` | Name of the OAP service account to use or create | `nil` | -| `oap.name` | OAP deployment name | `oap` | -| `oap.image.repository` | OAP container image name | `apache/skywalking-oap-server` | -| `oap.image.tag` | OAP container image tag | `6.1.0` | -| `oap.image.pullPolicy` | OAP container image pull policy | `IfNotPresent` | -| `oap.ports.grpc` | OAP grpc port for tracing or metric | `11800` | -| `oap.ports.rest` | OAP http port for Web UI | `12800` | -| `oap.replicas` | OAP k8s deployment replicas | `2` | -| `oap.service.type` | OAP svc type | `ClusterIP` | -| `oap.javaOpts` | Parameters to be added to `JAVA_OPTS`environment variable for OAP | `-Xms2g -Xmx2g` | -| `oap.antiAffinity` | OAP anti-affinity policy | `soft` | -| `oap.nodeAffinity` | OAP node affinity policy | `{}` | -| `oap.nodeSelector` | OAP labels for master pod assignment | `{}` | -| `oap.tolerations` | OAP tolerations | `[]` | -| `oap.resources` | OAP node resources requests & limits | `{} - cpu limit must be an integer` | -| `oap.envoy.als.enabled` | Open envoy als | `false` | -| `oap.istio.adapter.enabled` | Open istio adapter | `false` | -| `oap.env` | OAP environment variables | `[]` | -| `ui.name` | Web UI deployment name | `ui` | -| `ui.replicas` | Web UI k8s deployment replicas | `1` | -| `ui.image.repository` | Web UI container image name | `apache/skywalking-ui` | -| `ui.image.tag` | Web UI container image tag | `6.1.0` | -| `ui.image.pullPolicy` | Web UI container image pull policy | `IfNotPresent` | -| `ui.ingress.enabled` | Create Ingress for Web UI | `false` | -| `ui.ingress.annotations` | Associate annotations to the Ingress | `{}` | -| `ui.ingress.path` | Associate path with the Ingress | `/` | -| `ui.ingress.hosts` | Associate hosts with the Ingress | `[]` | -| `ui.ingress.tls` | Associate TLS with the Ingress | `[]` | -| `ui.service.type` | Web UI svc type | `ClusterIP` | -| `ui.service.externalPort` | external port for the service | `80` | -| `ui.service.internalPort` | internal port for the service | `8080` | -| `ui.service.externalIPs` | external IP addresses | `nil` | -| `ui.service.loadBalancerIP` | Load Balancer IP address | `nil` | -| `ui.service.annotations` | Kubernetes service annotations | `{}` | -| `ui.service.loadBalancerSourceRanges` | Limit load balancer source IPs to list of CIDRs (where available)) | `[]` | -| `elasticsearch.enabled` | Spin up a new elasticsearch cluster for SkyWalking | `true` | -| `elasticsearch.client.name` | `client` | Client component name | -| `elasticsearch.client.replicas` | `2` | Client node replicas (deployment) | -| `elasticsearch.client.resources` | `{} - cpu limit must be an integer` | Client node resources requests & limits | -| `elasticsearch.client.priorityClassName` | `nil` | Client priorityClass | -| `elasticsearch.client.heapSize` | `512m` | Client node heap size | -| `elasticsearch.client.podAnnotations` | `{}` | Client Deployment annotations | -| `elasticsearch.client.nodeSelector` | `{}` | Node labels for client pod assignment | -| `elasticsearch.client.tolerations` | `[]` | Client tolerations | -| `elasticsearch.client.serviceAnnotations` | `{}` | Client Service annotations | -| `elasticsearch.client.serviceType` | `ClusterIP` | Client service type | -| `elasticsearch.client.httpNodePort` | `nil` | Client service HTTP NodePort port number. Has no effect if client.serviceType is not `NodePort`. | -| `elasticsearch.client.loadBalancerIP` | `{}` | Client loadBalancerIP | -| `elasticsearch.client.loadBalancerSourceRanges` | `{}` | Client loadBalancerSourceRanges | -| `elasticsearch.client.antiAffinity` | `soft` | Client anti-affinity policy | -| `elasticsearch.client.nodeAffinity` | `{}` | Client node affinity policy | -| `elasticsearch.client.initResources` | `{}` | Client initContainer resources requests & limits | -| `elasticsearch.client.additionalJavaOpts` | `""` | Parameters to be added to `ES_JAVA_OPTS` environment variable for client | -| `elasticsearch.client.ingress.enabled` | `false` | Enable Client Ingress | -| `elasticsearch.client.ingress.user` | `nil` | If this & password are set, enable basic-auth on ingress | -| `elasticsearch.client.ingress.password` | `nil` | If this & user are set, enable basic-auth on ingress | -| `elasticsearch.client.ingress.annotations` | `{}` | Client Ingress annotations | -| `elasticsearch.client.ingress.hosts` | `[]` | Client Ingress Hostnames | -| `elasticsearch.client.ingress.tls` | `[]` | Client Ingress TLS configuration | -| `elasticsearch.client.exposeTransportPort` | `false` | Expose transport port 9300 on client service (ClusterIP) | -| `elasticsearch.master.initResources` | `{}` | Master initContainer resources requests & limits | -| `elasticsearch.master.additionalJavaOpts` | `""` | Parameters to be added to `ES_JAVA_OPTS` environment variable for master | -| `elasticsearch.master.exposeHttp` | `false` | Expose http port 9200 on master Pods for monitoring, etc | -| `elasticsearch.master.name` | `master` | Master component name | -| `elasticsearch.master.replicas` | `2` | Master node replicas (deployment) | -| `elasticsearch.master.resources` | `{} - cpu limit must be an integer` | Master node resources requests & limits | -| `elasticsearch.master.priorityClassName` | `nil` | Master priorityClass | -| `elasticsearch.master.podAnnotations` | `{}` | Master Deployment annotations | -| `elasticsearch.master.nodeSelector` | `{}` | Node labels for master pod assignment | -| `elasticsearch.master.tolerations` | `[]` | Master tolerations | -| `elasticsearch.master.heapSize` | `512m` | Master node heap size | -| `elasticsearch.master.name` | `master` | Master component name | -| `elasticsearch.master.persistence.enabled` | `false` | Master persistent enabled/disabled | -| `elasticsearch.master.persistence.name` | `data` | Master statefulset PVC template name | -| `elasticsearch.master.persistence.size` | `4Gi` | Master persistent volume size | -| `elasticsearch.master.persistence.storageClass` | `nil` | Master persistent volume Class | -| `elasticsearch.master.persistence.accessMode` | `ReadWriteOnce` | Master persistent Access Mode | -| `elasticsearch.master.readinessProbe` | see `values.yaml` for defaults | Master container readiness probes | -| `elasticsearch.master.antiAffinity` | `soft` | Master anti-affinity policy | -| `elasticsearch.master.nodeAffinity` | `{}` | Master node affinity policy | -| `elasticsearch.master.podManagementPolicy` | `OrderedReady` | Master pod creation strategy | -| `elasticsearch.master.updateStrategy` | `{type: "onDelete"}` | Master node update strategy policy | -| `elasticsearch.data.initResources` | `{}` | Data initContainer resources requests & limits | -| `elasticsearch.data.additionalJavaOpts` | `""` | Parameters to be added to `ES_JAVA_OPTS` environment variable for data | -| `elasticsearch.data.exposeHttp` | `false` | Expose http port 9200 on data Pods for monitoring, etc | -| `elasticsearch.data.replicas` | `2` | Data node replicas (statefulset) | -| `elasticsearch.data.resources` | `{} - cpu limit must be an integer` | Data node resources requests & limits | -| `elasticsearch.data.priorityClassName` | `nil` | Data priorityClass | -| `elasticsearch.data.heapSize` | `1536m` | Data node heap size | -| `elasticsearch.data.hooks.drain.enabled` | `true` | Data nodes: Enable drain pre-stop and post-start hook | -| `elasticsearch.data.persistence.enabled` | `false` | Data persistent enabled/disabled | -| `elasticsearch.data.persistence.name` | `data` | Data statefulset PVC template name | -| `elasticsearch.data.persistence.size` | `30Gi` | Data persistent volume size | -| `elasticsearch.data.persistence.storageClass` | `nil` | Data persistent volume Class | -| `elasticsearch.data.persistence.accessMode` | `ReadWriteOnce` | Data persistent Access Mode | -| `elasticsearch.data.readinessProbe` | see `values.yaml` for defaults | Readiness probes for data-containers | -| `elasticsearch.data.podAnnotations` | `{}` | Data StatefulSet annotations | -| `elasticsearch.data.nodeSelector` | `{}` | Node labels for data pod assignment | -| `elasticsearch.data.tolerations` | `[]` | Data tolerations | -| `elasticsearch.data.terminationGracePeriodSeconds` | `3600` | Data termination grace period (seconds) | -| `elasticsearch.data.antiAffinity` | `soft` | Data anti-affinity policy | -| `elasticsearch.data.nodeAffinity` | `{}` | Data node affinity policy | -| `elasticsearch.data.podManagementPolicy` | `OrderedReady` | Data pod creation strategy | -| `elasticsearch.data.updateStrategy` | `{type: "onDelete"}` | Data node update strategy policy | - - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, - -```console -$ helm install myrelease skywalking --set nameOverride=newSkywalking -``` - -Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, - -```console -$ helm install my-release skywalking -f values.yaml -``` - -> **Tip**: You can use the default [values.yaml](values.yaml) - -### RBAC Configuration -Roles and RoleBindings resources will be created automatically for `OAP` . - -> **Tip**: You can refer to the default `oap-role.yaml` file in [templates](templates/) to customize your own. - -### Ingress TLS -If your cluster allows automatic create/retrieve of TLS certificates (e.g. [kube-lego](https://github.com/jetstack/kube-lego)), please refer to the documentation for that mechanism. - -To manually configure TLS, first create/retrieve a key & certificate pair for the address(skywalking ui) you wish to protect. Then create a TLS secret in the namespace: - -```console -kubectl create secret tls skywalking-tls --cert=path/to/tls.cert --key=path/to/tls.key -``` - -Include the secret's name, along with the desired hostnames, in the skywalking-ui Ingress TLS section of your custom `values.yaml` file: - -```yaml -ui: - ingress: - ## If true, Skywalking ui server Ingress will be created - ## - enabled: true - - ## Skywalking ui server Ingress hostnames - ## Must be provided if Ingress is enabled - ## - hosts: - - skywalking.domain.com - - ## Skywalking ui server Ingress TLS configuration - ## Secrets must be manually created in the namespace - ## - tls: - - secretName: skywalking-tls - hosts: - - skywalking.domain.com -``` -### Envoy ALS - -Envoy ALS(access log service) provides fully logs about RPC routed, including HTTP and TCP. - -If you want to open envoy ALS, you can do this by modifying values.yaml. - -```yaml -oap: - envoy: - als: - enabled: true -``` - -When envoy als ,will give ServiceAccount clusterrole permission. -More envoy als ,please refer to [als_setting](../../../../docs/en/setup/envoy/als_setting.md) \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/Chart.yaml b/install/kubernetes/helm/skywalking/charts/elasticsearch/Chart.yaml deleted file mode 100644 index 6ed6f9ca12..0000000000 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/Chart.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# 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: v2 -name: elasticsearch -description: A ES Helm chart for SkyWalking CI pipeline - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -version: 6.8.2 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. -appVersion: 6.8.2 - -maintainers: - - name: hanahmily - email: hanahmily@gmail.com - - name: innerpeacez - email: innerpeace.zhai@gmail.com \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/NOTES.txt b/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/NOTES.txt deleted file mode 100644 index c58086e0c1..0000000000 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/NOTES.txt +++ /dev/null @@ -1,38 +0,0 @@ -{{/* -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. -*/}} - -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "elasticsearch.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "elasticsearch.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "elasticsearch.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "elasticsearch.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/_helpers.tpl b/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/_helpers.tpl deleted file mode 100644 index 70ea209bc1..0000000000 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/_helpers.tpl +++ /dev/null @@ -1,80 +0,0 @@ -{{/* -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. -*/}} - -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "elasticsearch.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "elasticsearch.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "elasticsearch.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "elasticsearch.labels" -}} -helm.sh/chart: {{ include "elasticsearch.chart" . }} -{{ include "elasticsearch.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{/* -Selector labels -*/}} -{{- define "elasticsearch.selectorLabels" -}} -app.kubernetes.io/name: {{ include "elasticsearch.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "elasticsearch.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (include "elasticsearch.fullname" .) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/deployment.yaml b/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/deployment.yaml deleted file mode 100644 index 1383786375..0000000000 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/deployment.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# 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: apps/v1 -kind: Deployment -metadata: - name: {{ include "elasticsearch.fullname" . }} - labels: - {{- include "elasticsearch.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "elasticsearch.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "elasticsearch.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "elasticsearch.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 9200 - - name: transport - containerPort: 9300 -# livenessProbe: -# httpGet: -# path: / -# port: http -# readinessProbe: -# httpGet: -# path: / -# port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/ingress.yaml b/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/ingress.yaml deleted file mode 100644 index 7979ab6158..0000000000 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/ingress.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# 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. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "elasticsearch.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "elasticsearch.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} -{{- end }} diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/service.yaml b/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/service.yaml deleted file mode 100644 index a7351bc35b..0000000000 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/service.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# 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: Service -metadata: - name: {{ include "elasticsearch.fullname" . }} - labels: - {{- include "elasticsearch.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.ports.http }} - targetPort: http - name: http - - name: tcp - port: {{ .Values.service.ports.transport }} - targetPort: transport - selector: - {{- include "elasticsearch.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/values.yaml b/install/kubernetes/helm/skywalking/charts/elasticsearch/values.yaml deleted file mode 100644 index 0c8c62e141..0000000000 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/values.yaml +++ /dev/null @@ -1,83 +0,0 @@ -# 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. - -# Default values for elasticsearch. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: elasticsearch - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - ports: - transport: 9300 - http: 9200 - -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: [] - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/install/kubernetes/helm/skywalking/templates/NOTES.txt b/install/kubernetes/helm/skywalking/templates/NOTES.txt deleted file mode 100644 index 8d93db77b6..0000000000 --- a/install/kubernetes/helm/skywalking/templates/NOTES.txt +++ /dev/null @@ -1,43 +0,0 @@ -{{/* -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. -*/}} - - -Thank you for installing {{ .Chart.Name }}. - -Your release is named {{ .Release.Name }}. - -Learn more, please visit https://skywalking.apache.org/ - -Get the UI URL by running these commands: -{{- if .Values.ui.ingress.enabled }} -{{- range .Values.ui.ingress.hosts }} - http{{ if $.Values.ui.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ui.ingress.path }} -{{- end }} -{{- else if contains "NodePort" .Values.ui.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "skywalking.ui.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.ui.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ include "skywalking.ui.fullname" . }} -n {{ .Release.Namespace }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "skywalking.ui.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.ui.service.externalPort }} -{{- else if contains "ClusterIP" .Values.ui.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "skywalking.name" . }},release={{ .Release.Name }},component={{ .Values.ui.name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:{{ .Values.ui.service.internalPort }} -{{- end }} diff --git a/install/kubernetes/helm/skywalking/templates/_helpers.tpl b/install/kubernetes/helm/skywalking/templates/_helpers.tpl deleted file mode 100644 index 387e188bf5..0000000000 --- a/install/kubernetes/helm/skywalking/templates/_helpers.tpl +++ /dev/null @@ -1,78 +0,0 @@ -{{/* -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. -*/}} - -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "skywalking.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "skywalking.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create a default fully qualified oap name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "skywalking.oap.fullname" -}} -{{ template "skywalking.fullname" . }}-{{ .Values.oap.name }} -{{- end -}} - -{{/* -Create a default fully qualified ui name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "skywalking.ui.fullname" -}} -{{ template "skywalking.fullname" . }}-{{ .Values.ui.name }} -{{- end -}} - -{{/* -Create the name of the service account to use for the oap cluster -*/}} -{{- define "skywalking.serviceAccountName.oap" -}} -{{ default (include "skywalking.oap.fullname" .) .Values.serviceAccounts.oap }} -{{- end -}} - -{{- define "call-nested" }} -{{- $dot := index . 0 }} -{{- $subchart := index . 1 }} -{{- $template := index . 2 }} -{{- include $template (dict "Chart" (dict "Name" $subchart) "Values" (index $dot.Values $subchart) "Release" $dot.Release "Capabilities" $dot.Capabilities) }} -{{- end }} - -{{- define "skywalking.containers.wait-for-es" -}} -- name: wait-for-elasticsearch - image: busybox:1.30 - imagePullPolicy: IfNotPresent - command: ['sh', '-c', 'for i in $(seq 1 60); do nc -z -w3 {{ include "call-nested" (list . "elasticsearch" "elasticsearch.fullname") }} 9200 && exit 0 || sleep 5; done; exit 1'] -{{- end -}} diff --git a/install/kubernetes/helm/skywalking/templates/es-init.job.yaml b/install/kubernetes/helm/skywalking/templates/es-init.job.yaml deleted file mode 100644 index ae143c005a..0000000000 --- a/install/kubernetes/helm/skywalking/templates/es-init.job.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# 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. - -# https://docs.sentry.io/server/installation/docker/#running-migrations -apiVersion: batch/v1 -kind: Job -metadata: - name: "{{ .Release.Name }}-es-init" - labels: - app: {{ template "skywalking.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - component: "{{ template "skywalking.fullname" . }}-job" - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} -spec: - template: - metadata: - name: "{{ .Release.Name }}-es-init" - labels: - app: {{ template "skywalking.name" . }} - component: "{{ template "skywalking.fullname" . }}-job" - release: {{ .Release.Name }} - spec: - restartPolicy: Never - initContainers: - {{- include "skywalking.containers.wait-for-es" . | nindent 6 }} - containers: - - name: {{ .Values.oap.name }} - image: "{{ .Values.oap.image.repository }}:{{ .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.oap.image.pullPolicy }} -{{- if .Values.oap.resources }} - resources: -{{ toYaml .Values.oap.resources | indent 10 }} -{{- end }} - env: - - name: JAVA_OPTS - value: "{{ .Values.oap.javaOpts }} -Dmode=init" - - name: SW_STORAGE - value: elasticsearch - - name: SW_STORAGE_ES_CLUSTER_NODES - value: "{{ include "call-nested" (list . "elasticsearch" "elasticsearch.fullname") }}:9200" diff --git a/install/kubernetes/helm/skywalking/templates/istio-adapter/adapter.yaml b/install/kubernetes/helm/skywalking/templates/istio-adapter/adapter.yaml deleted file mode 100644 index 4a74d2551e..0000000000 --- a/install/kubernetes/helm/skywalking/templates/istio-adapter/adapter.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -{{- if .Values.oap.istio.adapter.enabled }} -apiVersion: "config.istio.io/v1alpha2" -kind: adapter -metadata: - name: skywalking-adapter -spec: - description: - session_based: false - templates: - - metric -{{- end}} diff --git a/install/kubernetes/helm/skywalking/templates/istio-adapter/handler.yaml b/install/kubernetes/helm/skywalking/templates/istio-adapter/handler.yaml deleted file mode 100644 index 3ce913a373..0000000000 --- a/install/kubernetes/helm/skywalking/templates/istio-adapter/handler.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - -{{- if .Values.oap.istio.adapter.enabled }} -apiVersion: "config.istio.io/v1alpha2" -kind: handler -metadata: - name: skywalking-handler -spec: - adapter: skywalking-adapter - connection: - address: {{ template "skywalking.oap.fullname" . }}"."{{ .Release.Namespace }}".svc.cluster.local:11800" -{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/templates/istio-adapter/instance.yaml b/install/kubernetes/helm/skywalking/templates/istio-adapter/instance.yaml deleted file mode 100644 index 11a5f8cdff..0000000000 --- a/install/kubernetes/helm/skywalking/templates/istio-adapter/instance.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# 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. - -# instance for template metric -{{- if .Values.oap.istio.adapter.enabled }} -apiVersion: "config.istio.io/v1alpha2" -kind: instance -metadata: - name: skywalking-metric -spec: - template: metric - params: - value: request.size | 0 - dimensions: - sourceService: source.workload.name | "" - sourceNamespace: source.workload.namespace | "" - sourceUID: source.uid | "" - destinationService: destination.workload.name | "" - destinationNamespace: destination.workload.namespace | "" - destinationUID: destination.uid | "" - requestMethod: request.method | "" - requestPath: request.path | "" - requestScheme: request.scheme | "" - requestTime: request.time - responseTime: response.time - responseCode: response.code | 200 - reporter: conditional((context.reporter.kind | "inbound") == "outbound", "source", "destination") - apiProtocol: api.protocol | "" -{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/templates/istio-adapter/rule.yaml b/install/kubernetes/helm/skywalking/templates/istio-adapter/rule.yaml deleted file mode 100644 index 5949dc2de0..0000000000 --- a/install/kubernetes/helm/skywalking/templates/istio-adapter/rule.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# 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. - -# rule to dispatch to handler sw -{{- if .Values.oap.istio.adapter.enabled }} -apiVersion: "config.istio.io/v1alpha2" -kind: rule -metadata: - name: swmetric-rule -spec: - actions: - - handler: skywalking-handler.istio-system - instances: - - skywalking-metric -{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/templates/oap-clusterrole.yaml b/install/kubernetes/helm/skywalking/templates/oap-clusterrole.yaml deleted file mode 100644 index 24d90c9419..0000000000 --- a/install/kubernetes/helm/skywalking/templates/oap-clusterrole.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# 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. - -{{- if .Values.oap.envoy.als.enabled }} -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: {{ template "skywalking.fullname" . }} - labels: - app: {{ template "skywalking.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -rules: -- apiGroups: [""] - resources: ["pods"] - verbs: ["get", "watch", "list"] -- apiGroups: ["extensions"] - resources: ["deployments", "replicasets"] - verbs: ["get", "watch", "list"] -{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/templates/oap-clusterrolebinding.yaml b/install/kubernetes/helm/skywalking/templates/oap-clusterrolebinding.yaml deleted file mode 100644 index 3c4b1f4a69..0000000000 --- a/install/kubernetes/helm/skywalking/templates/oap-clusterrolebinding.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -{{- if .Values.oap.envoy.als.enabled }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ template "skywalking.fullname" . }} - labels: - app: {{ template "skywalking.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "skywalking.fullname" . }} -subjects: -- kind: ServiceAccount - name: {{ template "skywalking.serviceAccountName.oap" . }} - namespace: {{ .Release.Namespace }} -{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/templates/oap-deployment.yaml b/install/kubernetes/helm/skywalking/templates/oap-deployment.yaml deleted file mode 100644 index 696e3c9a1f..0000000000 --- a/install/kubernetes/helm/skywalking/templates/oap-deployment.yaml +++ /dev/null @@ -1,118 +0,0 @@ -# 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: apps/v1 -kind: Deployment -metadata: - labels: - app: {{ template "skywalking.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - component: "{{ .Values.oap.name }}" - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - name: {{ template "skywalking.oap.fullname" . }} -spec: - replicas: {{ .Values.oap.replicas }} - selector: - matchLabels: - app: {{ template "skywalking.name" . }} - component: "{{ .Values.oap.name }}" - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "skywalking.name" . }} - component: "{{ .Values.oap.name }}" - release: {{ .Release.Name }} - {{- if .Values.oap.podAnnotations }} - annotations: -{{ toYaml .Values.oap.podAnnotations | indent 8 }} - {{- end }} - spec: - serviceAccountName: {{ template "skywalking.serviceAccountName.oap" . }} - affinity: - {{- if eq .Values.oap.antiAffinity "hard" }} - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - topologyKey: "kubernetes.io/hostname" - labelSelector: - matchLabels: - app: "{{ template "skywalking.name" . }}" - release: "{{ .Release.Name }}" - component: "{{ .Values.oap.name }}" - {{- else if eq .Values.oap.antiAffinity "soft" }} - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - topologyKey: kubernetes.io/hostname - labelSelector: - matchLabels: - app: "{{ template "skywalking.name" . }}" - release: "{{ .Release.Name }}" - component: "{{ .Values.oap.name }}" - {{- end }} - {{- with .Values.oap.nodeAffinity }} - nodeAffinity: -{{ toYaml . | indent 10 }} - {{- end }} -{{- if .Values.oap.nodeSelector }} - nodeSelector: -{{ toYaml .Values.oap.nodeSelector | indent 8 }} -{{- end }} -{{- if .Values.oap.tolerations }} - tolerations: -{{ toYaml .Values.oap.tolerations | indent 8 }} -{{- end }} - initContainers: - {{- include "skywalking.containers.wait-for-es" . | nindent 6 }} - containers: - - name: {{ .Values.oap.name }} - image: "{{ .Values.oap.image.repository }}:{{ .Values.oap.image.tag }}" - imagePullPolicy: {{ .Values.oap.image.pullPolicy }} - ports: - - containerPort: 11800 - name: grpc - - containerPort: 12800 - name: rest -{{- if .Values.oap.resources }} - resources: -{{ toYaml .Values.oap.resources | indent 10 }} -{{- end }} - env: - - name: JAVA_OPTS - value: "{{ .Values.oap.javaOpts }} -Dmode=no-init" - - name: SW_CLUSTER - value: kubernetes - - name: SW_CLUSTER_K8S_NAMESPACE - value: "{{ .Release.Namespace }}" - - name: SW_CLUSTER_K8S_LABEL - value: "app={{ template "skywalking.name" . }},release={{ .Release.Name }},component={{ .Values.oap.name }}" - - name: SKYWALKING_COLLECTOR_UID - valueFrom: - fieldRef: - fieldPath: metadata.uid - - name: SW_STORAGE - value: elasticsearch - {{- if .Values.oap.envoy.als.enabled }} - - name: SW_ENVOY_ALS_ENABLED - value: {{ .Values.oap.envoy.als.enabled | quote}} - {{- end }} - - name: SW_STORAGE_ES_CLUSTER_NODES - value: "{{ include "call-nested" (list . "elasticsearch" "elasticsearch.fullname") }}:9200" - {{- range $key, $value := .Values.oap.env }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} diff --git a/install/kubernetes/helm/skywalking/templates/oap-role.yaml b/install/kubernetes/helm/skywalking/templates/oap-role.yaml deleted file mode 100644 index 2d96463060..0000000000 --- a/install/kubernetes/helm/skywalking/templates/oap-role.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# 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. - -{{- if not .Values.oap.envoy.als.enabled }} -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: {{ template "skywalking.fullname" . }} - labels: - app: {{ template "skywalking.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -rules: - - apiGroups: [""] - resources: ["pods"] - verbs: ["get", "watch", "list"] -{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/templates/oap-rolebinding.yaml b/install/kubernetes/helm/skywalking/templates/oap-rolebinding.yaml deleted file mode 100644 index 186dee3b5d..0000000000 --- a/install/kubernetes/helm/skywalking/templates/oap-rolebinding.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -{{- if not .Values.oap.envoy.als.enabled }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ template "skywalking.fullname" . }} - labels: - app: {{ template "skywalking.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ template "skywalking.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "skywalking.serviceAccountName.oap" . }} - namespace: {{ .Release.Namespace }} -{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/skywalking/templates/oap-svc.yaml b/install/kubernetes/helm/skywalking/templates/oap-svc.yaml deleted file mode 100644 index aefe78a81b..0000000000 --- a/install/kubernetes/helm/skywalking/templates/oap-svc.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# 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: Service -metadata: - name: {{ template "skywalking.oap.fullname" . }} - labels: - app: {{ template "skywalking.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - component: "{{ .Values.oap.name }}" - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} -spec: - type: {{ .Values.oap.service.type }} - ports: - - port: {{ .Values.oap.ports.rest }} - name: rest - - port: {{ .Values.oap.ports.grpc }} - name: grpc - selector: - app: {{ template "skywalking.name" . }} - component: "{{ .Values.oap.name }}" - release: {{ .Release.Name }} diff --git a/install/kubernetes/helm/skywalking/values.yaml b/install/kubernetes/helm/skywalking/values.yaml deleted file mode 100644 index 8201c37346..0000000000 --- a/install/kubernetes/helm/skywalking/values.yaml +++ /dev/null @@ -1,269 +0,0 @@ -# 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. - -# Default values for skywalking. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -serviceAccounts: - oap: - -oap: - name: skywalking-oap - image: - repository: apache/skywalking-oap-server - tag: latest - pullPolicy: IfNotPresent - ports: - grpc: 11800 - rest: 12800 - replicas: 2 - service: - type: ClusterIP - javaOpts: -Xmx2g -Xms2g - antiAffinity: "soft" - nodeAffinity: {} - nodeSelector: {} - tolerations: [] - resources: {} - # limits: - # cpu: 8 - # memory: 8Gi - # requests: - # cpu: 8 - # memory: 4Gi - # podAnnotations: - # example: oap-foo - envoy: - als: - enabled: false - # more envoy ALS ,please refer to https://github.com/apache/skywalking/blob/master/docs/en/setup/envoy/als_setting.md#observe-service-mesh-through-als - istio: - adapter: - enabled: false - env: - # more env, please refer to https://hub.docker.com/r/apache/skywalking-oap-server - # or https://github.com/apache/skywalking-docker/blob/master/6/6.4/oap/README.md#sw_telemetry -ui: - name: skywalking-ui - replicas: 1 - image: - repository: apache/skywalking-ui - tag: latest - pullPolicy: IfNotPresent - # podAnnotations: - # example: oap-foo - ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - path: / - hosts: [] - # - skywalking.local - tls: [] - # - secretName: skywalking-tls - # hosts: - # - skywalking.local - service: - type: ClusterIP - # clusterIP: None - externalPort: 80 - internalPort: 8080 - ## External IP addresses of service - ## Default: nil - ## - # externalIPs: - # - 192.168.0.1 - # - ## LoadBalancer IP if service.type is LoadBalancer - ## Default: nil - ## - # loadBalancerIP: 10.2.2.2 - # Annotation example: setup ssl with aws cert when service.type is LoadBalancer - # service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:EXAMPLE_CERT - annotations: {} - ## Limit load balancer source ips to list of CIDRs (where available) - # loadBalancerSourceRanges: [] - -elasticsearch: - enabled: true - # If elasticsearch,enabled=true values for elasticsearch. - - ## Define serviceAccount names for components. Defaults to component's fully qualified name. - serviceAccounts: - client: - create: true - name: - master: - create: true - name: - data: - create: true - name: - - client: - name: client - replicas: 2 - serviceType: ClusterIP - ## If coupled with serviceType = "NodePort", this will set a specific nodePort to the client HTTP port - # httpNodePort: 30920 - loadBalancerIP: {} - loadBalancerSourceRanges: {} - ## (dict) If specified, apply these annotations to the client service - # serviceAnnotations: - # example: client-svc-foo - heapSize: "512m" - # additionalJavaOpts: "-XX:MaxRAM=512m" - antiAffinity: "soft" - nodeAffinity: {} - nodeSelector: {} - tolerations: [] - initResources: {} - # limits: - # cpu: "25m" - # # memory: "128Mi" - # requests: - # cpu: "25m" - # memory: "128Mi" - resources: - limits: - cpu: "1" - # memory: "1024Mi" - requests: - cpu: "25m" - memory: "512Mi" - priorityClassName: "" - ## (dict) If specified, apply these annotations to each client Pod - # podAnnotations: - # example: client-foo - podDisruptionBudget: - enabled: false - minAvailable: 1 - # maxUnavailable: 1 - ingress: - enabled: false - # user: NAME - # password: PASSWORD - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - path: / - hosts: - - chart-example.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - master: - name: master - exposeHttp: false - replicas: 3 - heapSize: "512m" - # additionalJavaOpts: "-XX:MaxRAM=512m" - persistence: - enabled: false - accessMode: ReadWriteOnce - name: data - size: "4Gi" - # storageClass: "ssd" - readinessProbe: - httpGet: - path: /_cluster/health?local=true - port: 9200 - initialDelaySeconds: 5 - antiAffinity: "soft" - nodeAffinity: {} - nodeSelector: {} - tolerations: [] - initResources: {} - # limits: - # cpu: "25m" - # # memory: "128Mi" - # requests: - # cpu: "25m" - # memory: "128Mi" - resources: - limits: - cpu: "1" - # memory: "1024Mi" - requests: - cpu: "25m" - memory: "512Mi" - priorityClassName: "" - ## (dict) If specified, apply these annotations to each master Pod - # podAnnotations: - # example: master-foo - podManagementPolicy: OrderedReady - podDisruptionBudget: - enabled: false - minAvailable: 2 # Same as `cluster.env.MINIMUM_MASTER_NODES` - # maxUnavailable: 1 - updateStrategy: - type: OnDelete - - data: - name: data - exposeHttp: false - replicas: 2 - heapSize: "1536m" - # additionalJavaOpts: "-XX:MaxRAM=1536m" - persistence: - enabled: false - accessMode: ReadWriteOnce - name: data - size: "30Gi" - # storageClass: "ssd" - readinessProbe: - httpGet: - path: /_cluster/health?local=true - port: 9200 - initialDelaySeconds: 5 - terminationGracePeriodSeconds: 3600 - antiAffinity: "soft" - nodeAffinity: {} - nodeSelector: {} - tolerations: [] - initResources: {} - # limits: - # cpu: "25m" - # # memory: "128Mi" - # requests: - # cpu: "25m" - # memory: "128Mi" - resources: - limits: - cpu: "1" - # memory: "2048Mi" - requests: - cpu: "25m" - memory: "1536Mi" - priorityClassName: "" - ## (dict) If specified, apply these annotations to each data Pod - # podAnnotations: - # example: data-foo - podDisruptionBudget: - enabled: false - # minAvailable: 1 - maxUnavailable: 1 - podManagementPolicy: OrderedReady - updateStrategy: - type: OnDelete - hooks: # post-start and pre-stop hooks - drain: # drain the node before stopping it and re-integrate it into the cluster after start - enabled: true - -nameOverride: "" diff --git a/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java b/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java index 0371a3b529..0b4c93fe9f 100644 --- a/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java +++ b/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java @@ -36,6 +36,8 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; +import static java.util.Objects.isNull; + @Slf4j public enum NamespacedPodListInformer { @@ -92,7 +94,9 @@ public enum NamespacedPodListInformer { } public Optional> listPods() { - + if (isNull(podLister)) { + return Optional.empty(); + } return Optional.ofNullable(podLister.list().size() != 0 ? podLister.list() .stream() diff --git a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java index 72e6b8607a..6d1e3dc61c 100644 --- a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java +++ b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/K8sALSServiceMeshHTTPAnalysis.java @@ -67,8 +67,6 @@ import org.slf4j.LoggerFactory; public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis { private static final Logger LOGGER = LoggerFactory.getLogger(K8sALSServiceMeshHTTPAnalysis.class); - private static final String ADDRESS_TYPE_INTERNAL_IP = "InternalIP"; - private static final String VALID_PHASE = "Running"; private static final String NON_TLS = "NONE"; diff --git a/test/e2e-mesh/e2e-istio/scripts/clean.sh b/test/e2e-mesh/e2e-istio/scripts/demo.sh old mode 100755 new mode 100644 similarity index 71% rename from test/e2e-mesh/e2e-istio/scripts/clean.sh rename to test/e2e-mesh/e2e-istio/scripts/demo.sh index 9de476bffd..778616fa24 --- a/test/e2e-mesh/e2e-istio/scripts/clean.sh +++ b/test/e2e-mesh/e2e-istio/scripts/demo.sh @@ -19,10 +19,12 @@ # under the License. # ---------------------------------------------------------------------------- -set -e +set -ex -CONTAINER_NAME=$1 -[[ "${CONTAINER_NAME}" == "" ]] && exit 1 +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 -docker ps | grep -e ${CONTAINER_NAME} | awk '{print $1}' | xargs docker stop -docker ps -a | grep -e ${CONTAINER_NAME} | awk '{print $1}' | xargs docker rm +sleep 3 +kubectl wait --for=condition=Ready pods --all --timeout=1200s +kubectl get pods -A -o wide --show-labels +kubectl get rs -A diff --git a/test/e2e-mesh/e2e-istio/scripts/compile_build.sh b/test/e2e-mesh/e2e-istio/scripts/istio.sh old mode 100755 new mode 100644 similarity index 83% rename from test/e2e-mesh/e2e-istio/scripts/compile_build.sh rename to test/e2e-mesh/e2e-istio/scripts/istio.sh index 860c09141b..ffd432c302 --- a/test/e2e-mesh/e2e-istio/scripts/compile_build.sh +++ b/test/e2e-mesh/e2e-istio/scripts/istio.sh @@ -19,12 +19,9 @@ # under the License. # ---------------------------------------------------------------------------- -set -e +set -ex -TAG="ci" - -git rev-parse HEAD -git submodule init -git submodule update - -SKIP_TEST=true make build.all && make docker.oap -e TAG=$TAG +curl -L https://istio.io/downloadIstio | sh - +sudo mv $PWD/istio-$ISTIO_VERSION/bin/istioctl /usr/local/bin/ +istioctl install $@ +kubectl label namespace default istio-injection=enabled diff --git a/test/e2e-mesh/e2e-istio/scripts/minikube.sh b/test/e2e-mesh/e2e-istio/scripts/minikube.sh index 73daf67ca9..521ef9f282 100755 --- a/test/e2e-mesh/e2e-istio/scripts/minikube.sh +++ b/test/e2e-mesh/e2e-istio/scripts/minikube.sh @@ -21,10 +21,7 @@ set -x -K8S_VER=$2 -if [[ "${K8S_VER}" == "" ]]; then - K8S_VER="k8s-v1.15.4" -fi +K8S_VER=${K8S_VER:-'k8s-v1.18.0'} function waitMinikube() { set +e @@ -74,30 +71,6 @@ function startMinikubeNone() { export MINIKUBE_HOME=$HOME export CHANGE_MINIKUBE_NONE_USER=true - # Troubleshoot problem with Docker build on some CircleCI machines. - if [ -f /proc/sys/net/ipv4/ip_forward ]; then - echo "IP forwarding setting: $(cat /proc/sys/net/ipv4/ip_forward)" - echo "My hostname is:" - hostname - echo "My distro is:" - cat /etc/*-release - echo "Contents of /etc/sysctl.d/" - ls -l /etc/sysctl.d/ || true - echo "Contents of /etc/sysctl.conf" - grep ip_forward /etc/sysctl.conf - echo "Config files setting ip_forward" - find /etc/sysctl.d/ -type f -exec grep ip_forward \{\} \; -print - if [ "$(cat /proc/sys/net/ipv4/ip_forward)" -eq 0 ]; then - whoami - echo "Cannot build images without IPv4 forwarding, attempting to turn on forwarding" - sudo sysctl -w net.ipv4.ip_forward=1 - if [ "$(cat /proc/sys/net/ipv4/ip_forward)" -eq 0 ]; then - echo "Cannot build images without IPv4 forwarding" - exit 1 - fi - fi - fi - sudo -E minikube config set WantUpdateNotification false sudo -E minikube config set WantReportErrorPrompt false sudo -E minikube start --kubernetes-version=${K8S_VER#k8s-} --driver=none diff --git a/test/e2e-mesh/e2e-istio/scripts/pre.sh b/test/e2e-mesh/e2e-istio/scripts/pre.sh index d9f48d8372..9319020b5b 100755 --- a/test/e2e-mesh/e2e-istio/scripts/pre.sh +++ b/test/e2e-mesh/e2e-istio/scripts/pre.sh @@ -21,33 +21,9 @@ set -ex -HELMVERSION=$1 -if [[ "${HELMVERSION}" == "" ]]; then - HELMVERSION="helm-v3.0.0" -fi - -MINIKUBEVERESION=$2 -if [[ "${MINIKUBEVERESION}" == "" ]]; then - MINIKUBEVERESION="minikube-v1.8.0" -fi - -K8SVERSION=$3 -if [[ "${K8SVERSION}" == "" ]]; then - K8SVERSION="k8s-v1.15.4" -fi - -# Remove strict host checking. The rest of the file is already populated by the 'add_ssh_keys' step. -mkdir -p ~/.ssh -echo -e "\tStrictHostKeyChecking no" >> ~/.ssh/config -echo -e "\tControlMaster auto" >> ~/.ssh/config -echo -e "\tControlPersist 3600" >> ~/.ssh/config -echo -e "\tControlPath ~/.ssh/%r@%h:%p" >> ~/.ssh/config - -# Create directory for logs. -mkdir -p ~/logs - -# create directory for e2e artifacts. -mkdir -p ~/skywalking/test/e2e/artifacts +HELMVERSION=${HELMVERSION:-'helm-v3.0.0'} +MINIKUBEVERESION=${MINIKUBEVERESION:-'minikube-v1.13.1'} +K8SVERSION=${K8SVERSION:-'k8s-v1.19.2'} curl -sSL https://get.helm.sh/${HELMVERSION}-linux-amd64.tar.gz | \ sudo tar xz -C /usr/local/bin --strip-components=1 linux-amd64/helm @@ -61,23 +37,5 @@ curl -sSL "https://storage.googleapis.com/kubernetes-release/release/${K8SVERSIO chmod +x /tmp/kubectl sudo mv /tmp/kubectl /usr/local/bin/kubectl -sudo apt-get remove -y --purge man-db -sudo apt-get update -sudo apt-get install -y \ - --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages \ - xvfb libgtk-3-0 libnotify4 libgconf-2-4 libnss3 libxss1 libasound2 \ - apt-transport-https \ - ca-certificates \ - curl \ - gnupg-agent \ - software-properties-common \ - openjdk-8-jdk-headless -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo apt-key fingerprint 0EBFCD88 -sudo add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) \ - stable" sudo apt-get update -sudo apt-cache madison docker-ce -sudo apt-get install -y docker-ce=5:19.03.8~3-0~ubuntu-xenial docker-ce-cli=5:19.03.8~3-0~ubuntu-xenial containerd.io +sudo apt-get install -y socat conntrack diff --git a/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/retryable/RetryableTest.java b/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/retryable/RetryableTest.java index 789214f940..0dc440a9fc 100644 --- a/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/retryable/RetryableTest.java +++ b/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/retryable/RetryableTest.java @@ -49,7 +49,7 @@ public @interface RetryableTest { /** * @return maximum times to retry, or -1 for infinite retries. {@code -1} by default. */ - int value() default -1; + int value() default 300; /** * @return the interval between any two retries, in millisecond. {@code 1000} by default. diff --git a/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/SimpleQueryClient.java b/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/SimpleQueryClient.java index f2ef797ae5..54fe975e68 100644 --- a/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/SimpleQueryClient.java +++ b/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/SimpleQueryClient.java @@ -201,6 +201,8 @@ public class SimpleQueryClient { } public Topology topo(final TopoQuery query) throws Exception { + LOGGER.info("topo {}", query); + final URL queryFileUrl = Resources.getResource("topo.gql"); final String queryString = Resources.readLines(queryFileUrl, StandardCharsets.UTF_8) .stream() @@ -209,17 +211,27 @@ public class SimpleQueryClient { .replace("{step}", query.step()) .replace("{start}", query.start()) .replace("{end}", query.end()); - final ResponseEntity> responseEntity = restTemplate.exchange( - new RequestEntity<>(queryString, HttpMethod.POST, URI.create(endpointUrl)), - new ParameterizedTypeReference>() { + + LOGGER.info("query string {}", queryString); + + try { + final ResponseEntity> responseEntity = restTemplate.exchange( + new RequestEntity<>(queryString, HttpMethod.POST, URI.create(endpointUrl)), + new ParameterizedTypeReference>() { + } + ); + + LOGGER.info("response {}", responseEntity); + + if (responseEntity.getStatusCode() != HttpStatus.OK) { + throw new RuntimeException("Response status != 200, actual: " + responseEntity.getStatusCode()); } - ); - if (responseEntity.getStatusCode() != HttpStatus.OK) { - throw new RuntimeException("Response status != 200, actual: " + responseEntity.getStatusCode()); + return Objects.requireNonNull(responseEntity.getBody()).getData().getTopo(); + } catch (Exception e) { + LOGGER.error(e.getMessage(), e); } - - return Objects.requireNonNull(responseEntity.getBody()).getData().getTopo(); + return new Topology(); } public ServiceInstanceTopology serviceInstanceTopo(final ServiceInstanceTopologyQuery query) throws Exception { diff --git a/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/verification/AbstractMatcher.java b/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/verification/AbstractMatcher.java index 0d6624e06b..61024b75c3 100644 --- a/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/verification/AbstractMatcher.java +++ b/test/e2e/e2e-data/src/main/java/org/apache/skywalking/e2e/verification/AbstractMatcher.java @@ -29,6 +29,7 @@ public abstract class AbstractMatcher { private static final Pattern GT_MATCHER = Pattern.compile("gt\\s+(?.+)"); private static final Pattern GE_MATCHER = Pattern.compile("ge\\s+(?.+)"); private static final Pattern NN_MATCHER = Pattern.compile("^not null$"); + private static final Pattern RE_MATCHER = Pattern.compile("^re\\((?.+)\\)$"); public abstract void verify(T t); @@ -72,6 +73,15 @@ public abstract class AbstractMatcher { return; } + matcher = RE_MATCHER.matcher(expected); + if (matcher.find()) { + String regexp = matcher.group("regexp"); + + assertThat(regexp).isNotBlank(); + assertThat(actual).matches(regexp); + return; + } + assertThat(actual).isEqualTo(expected); } diff --git a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/base/TrafficController.java b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/base/TrafficController.java index fc7e0b2ae1..58af4585f5 100644 --- a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/base/TrafficController.java +++ b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/base/TrafficController.java @@ -35,6 +35,8 @@ import lombok.extern.slf4j.Slf4j; public final class TrafficController { @Builder.Default private final int interval = 1000; + @Builder.Default + private final boolean logResult = true; private final String host; private final Callable sender; @@ -51,7 +53,9 @@ public final class TrafficController { future = executor.scheduleAtFixedRate(() -> { try { final Object result = sender.call(); - LOGGER.info("response: {}", result); + if (logResult) { + LOGGER.info("response: {}", result); + } } catch (final Exception e) { LOGGER.error("failed to send traffic", e); } diff --git a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/ALSE2E.java b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/ALSE2E.java new file mode 100644 index 0000000000..3442ee1753 --- /dev/null +++ b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/ALSE2E.java @@ -0,0 +1,264 @@ +/* + * 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. + * + */ + +package org.apache.skywalking.e2e.mesh; + +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.net.URL; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Predicate; +import lombok.extern.slf4j.Slf4j; +import org.apache.skywalking.e2e.base.SkyWalkingTestAdapter; +import org.apache.skywalking.e2e.base.TrafficController; +import org.apache.skywalking.e2e.common.HostAndPort; +import org.apache.skywalking.e2e.metrics.AtLeastOneOfMetricsMatcher; +import org.apache.skywalking.e2e.metrics.Metrics; +import org.apache.skywalking.e2e.metrics.MetricsQuery; +import org.apache.skywalking.e2e.metrics.MetricsValueMatcher; +import org.apache.skywalking.e2e.retryable.RetryableTest; +import org.apache.skywalking.e2e.service.Service; +import org.apache.skywalking.e2e.service.ServicesMatcher; +import org.apache.skywalking.e2e.service.ServicesQuery; +import org.apache.skywalking.e2e.service.endpoint.Endpoint; +import org.apache.skywalking.e2e.service.endpoint.EndpointQuery; +import org.apache.skywalking.e2e.service.endpoint.Endpoints; +import org.apache.skywalking.e2e.service.endpoint.EndpointsMatcher; +import org.apache.skywalking.e2e.service.instance.Instance; +import org.apache.skywalking.e2e.service.instance.Instances; +import org.apache.skywalking.e2e.service.instance.InstancesMatcher; +import org.apache.skywalking.e2e.service.instance.InstancesQuery; +import org.apache.skywalking.e2e.topo.Call; +import org.apache.skywalking.e2e.topo.TopoMatcher; +import org.apache.skywalking.e2e.topo.TopoQuery; +import org.apache.skywalking.e2e.topo.Topology; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; + +import static org.apache.skywalking.e2e.metrics.MetricsMatcher.verifyMetrics; +import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_ENDPOINT_METRICS; +import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_INSTANCE_METRICS; +import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_METRICS; +import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_RELATION_CLIENT_METRICS; +import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_RELATION_SERVER_METRICS; +import static org.apache.skywalking.e2e.utils.Times.now; +import static org.apache.skywalking.e2e.utils.Yamls.load; + +@Slf4j +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class ALSE2E extends SkyWalkingTestAdapter { + private final String swWebappHost = Optional.ofNullable(Strings.emptyToNull(System.getenv("WEBAPP_HOST"))).orElse("127.0.0.1"); + private final String swWebappPort = Optional.ofNullable(Strings.emptyToNull(System.getenv("WEBAPP_PORT"))).orElse("8080"); + protected HostAndPort swWebappHostPort = HostAndPort.builder() + .host(swWebappHost) + .port(Integer.parseInt(swWebappPort)) + .build(); + + private final Map, String> serviceEndpointExpectedDataFiles = + ImmutableMap., String>builder() + .put(service -> IDManager.ServiceID.analysisId(service.getKey()).getName().startsWith("ratings-v1"), "expected/als/endpoints-ratings.yml") + .put(service -> IDManager.ServiceID.analysisId(service.getKey()).getName().startsWith("details-v1"), "expected/als/endpoints-details.yml") + .put(service -> IDManager.ServiceID.analysisId(service.getKey()).getName().startsWith("reviews-v"), "expected/als/endpoints-reviews.yml") + .put(service -> IDManager.ServiceID.analysisId(service.getKey()).getName().startsWith("productpage-v1"), "expected/als/endpoints-productpage.yml") + .build(); + + @BeforeAll + public void setUp() throws Exception { + LOGGER.info("set up"); + + queryClient(swWebappHostPort); + + String gatewayHost = Strings.isNullOrEmpty(System.getenv("GATEWAY_HOST")) ? "127.0.0.1" : System.getenv("GATEWAY_HOST"); + String gatewayPort = Strings.isNullOrEmpty(System.getenv("GATEWAY_PORT")) ? "80" : System.getenv("GATEWAY_PORT"); + + HostAndPort serviceHostPort = HostAndPort.builder() + .host(gatewayHost) + .port(Integer.parseInt(gatewayPort)) + .build(); + + final URL url = new URL("http", serviceHostPort.host(), serviceHostPort.port(), "/productpage"); + + trafficController = + TrafficController.builder() + .logResult(false) + .sender(() -> restTemplate.getForEntity(url.toURI(), String.class)) + .build() + .start(); + + LOGGER.info("set up done"); + } + + @RetryableTest + void services() throws Exception { + LOGGER.info("services starts"); + + List services = graphql.services(new ServicesQuery().start(startTime).end(now())); + + LOGGER.info("services: {}", services); + + load("expected/als/services.yml").as(ServicesMatcher.class).verify(services); + + for (final Service service : services) { + LOGGER.info("verifying service instances: {}", service); + + verifyServiceMetrics(service); + + final Instances instances = verifyServiceInstances(service); + + verifyInstancesMetrics(instances); + + final Endpoints endpoints = verifyServiceEndpoints(service); + + verifyEndpointsMetrics(endpoints); + } + } + + @RetryableTest + void topology() throws Exception { + LOGGER.info("topology starts {} {}", graphql, startTime); + + final Topology topology = graphql.topo(new TopoQuery().stepByMinute().start(startTime.minusDays(1)).end(now())); + + LOGGER.info("topology: {}", topology); + + load("expected/als/topo.yml").as(TopoMatcher.class).verify(topology); + + verifyServiceRelationMetrics(topology.getCalls()); + } + + private Instances verifyServiceInstances(final Service service) throws Exception { + final Instances instances = graphql.instances( + new InstancesQuery().serviceId(service.getKey()).start(startTime).end(now()) + ); + + LOGGER.info("instances: {}", instances); + + load("expected/als/instances.yml").as(InstancesMatcher.class).verify(instances); + + return instances; + } + + private Endpoints verifyServiceEndpoints(final Service service) throws Exception { + final Endpoints endpoints = graphql.endpoints(new EndpointQuery().serviceId(service.getKey())); + + LOGGER.info("endpoints: {}", endpoints); + + serviceEndpointExpectedDataFiles.entrySet() + .stream() + .filter(it -> it.getKey().test(service)) + .findFirst() + .map(Map.Entry::getValue) + .ifPresent(expectedDataFile -> { + try { + load(expectedDataFile).as(EndpointsMatcher.class).verify(endpoints); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + + return endpoints; + } + + private void verifyInstancesMetrics(final Instances instances) throws Exception { + for (Instance instance : instances.getInstances()) { + for (String metricsName : ALL_INSTANCE_METRICS) { + LOGGER.info("verifying service instance response time: {}", instance); + final Metrics instanceMetrics = graphql.metrics( + new MetricsQuery().stepByMinute().metricsName(metricsName).id(instance.getKey()) + ); + + LOGGER.info("instance metrics: {}", instanceMetrics); + + final AtLeastOneOfMetricsMatcher instanceRespTimeMatcher = new AtLeastOneOfMetricsMatcher(); + final MetricsValueMatcher greaterThanZero = new MetricsValueMatcher(); + greaterThanZero.setValue("gt 0"); + instanceRespTimeMatcher.setValue(greaterThanZero); + instanceRespTimeMatcher.verify(instanceMetrics); + LOGGER.info("{}: {}", metricsName, instanceMetrics); + } + } + } + + private void verifyEndpointsMetrics(final Endpoints endpoints) throws Exception { + for (Endpoint endpoint : endpoints.getEndpoints()) { + for (final String metricName : ALL_ENDPOINT_METRICS) { + LOGGER.info("verifying endpoint {}: {}", endpoint, metricName); + + final Metrics metrics = graphql.metrics( + new MetricsQuery().stepByMinute().metricsName(metricName).id(endpoint.getKey()) + ); + + LOGGER.info("metrics: {}", metrics); + + final AtLeastOneOfMetricsMatcher instanceRespTimeMatcher = new AtLeastOneOfMetricsMatcher(); + final MetricsValueMatcher greaterThanZero = new MetricsValueMatcher(); + greaterThanZero.setValue("gt 0"); + instanceRespTimeMatcher.setValue(greaterThanZero); + instanceRespTimeMatcher.verify(metrics); + + LOGGER.info("{}: {}", metricName, metrics); + } + } + } + + private void verifyServiceMetrics(final Service service) throws Exception { + for (String metricName : ALL_SERVICE_METRICS) { + LOGGER.info("verifying service {}, metrics: {}", service, metricName); + final Metrics serviceMetrics = graphql.metrics( + new MetricsQuery().stepByMinute().metricsName(metricName).id(service.getKey()) + ); + LOGGER.info("serviceMetrics: {}", serviceMetrics); + final AtLeastOneOfMetricsMatcher instanceRespTimeMatcher = new AtLeastOneOfMetricsMatcher(); + final MetricsValueMatcher greaterThanZero = new MetricsValueMatcher(); + greaterThanZero.setValue("gt 0"); + instanceRespTimeMatcher.setValue(greaterThanZero); + instanceRespTimeMatcher.verify(serviceMetrics); + LOGGER.info("{}: {}", metricName, serviceMetrics); + } + } + + private void verifyServiceRelationMetrics(final List calls) throws Exception { + verifyRelationMetrics(calls, ALL_SERVICE_RELATION_CLIENT_METRICS, ALL_SERVICE_RELATION_SERVER_METRICS); + } + + private void verifyRelationMetrics(final List calls, + final String[] relationClientMetrics, + final String[] relationServerMetrics) throws Exception { + for (Call call : calls) { + for (String detectPoint : call.getDetectPoints()) { + switch (detectPoint) { + case "CLIENT": { + for (String metricName : relationClientMetrics) { + verifyMetrics(graphql, metricName, call.getId(), startTime); + } + break; + } + case "SERVER": { + for (String metricName : relationServerMetrics) { + verifyMetrics(graphql, metricName, call.getId(), startTime); + } + break; + } + } + } + } + } +} diff --git a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/IDManager.java b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/IDManager.java new file mode 100644 index 0000000000..ce2fb0c15e --- /dev/null +++ b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/mesh/IDManager.java @@ -0,0 +1,58 @@ +/* + * 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. + * + */ + +package org.apache.skywalking.e2e.mesh; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +public class IDManager { + public static class ServiceID { + + public static ServiceIDDefinition analysisId(String id) { + final String[] strings = id.split("\\."); + if (strings.length != 2) { + throw new RuntimeException("Can't split service id into 2 parts, " + id); + } + return new ServiceIDDefinition( + decode(strings[0]), + Integer.parseInt(strings[1]) == 1 + ); + } + + @RequiredArgsConstructor + @Getter + @EqualsAndHashCode + public static class ServiceIDDefinition { + private final String name; + + private final boolean isReal; + } + } + + /** + * @param base64text Base64 encoded UTF-8 string + * @return normal literal string + */ + private static String decode(String base64text) { + return new String(Base64.getDecoder().decode(base64text), StandardCharsets.UTF_8); + } +} diff --git a/install/kubernetes/helm/skywalking/OWNERS b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-details.yml similarity index 92% rename from install/kubernetes/helm/skywalking/OWNERS rename to test/e2e/e2e-test/src/test/resources/expected/als/endpoints-details.yml index b3b6bec1ab..d184dc5b29 100644 --- a/install/kubernetes/helm/skywalking/OWNERS +++ b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-details.yml @@ -13,9 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -approvers: -- hanahmily -- wu-sheng -reviewers: -- hanahmily -- wu-sheng +endpoints: + - key: not null + label: /details/0 diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/serviceaccount.yaml b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-productpage.yml similarity index 78% rename from install/kubernetes/helm/skywalking/charts/elasticsearch/templates/serviceaccount.yaml rename to test/e2e/e2e-test/src/test/resources/expected/als/endpoints-productpage.yml index d9a7adee2e..f22e0d290b 100644 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/templates/serviceaccount.yaml +++ b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-productpage.yml @@ -13,11 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- if .Values.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "elasticsearch.serviceAccountName" . }} - labels: -{{ include "elasticsearch.labels" . | nindent 4 }} -{{- end }} +endpoints: + - key: not null + label: /productpage diff --git a/install/kubernetes/helm/skywalking/templates/oap-serviceaccount.yaml b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-ratings.yml similarity index 70% rename from install/kubernetes/helm/skywalking/templates/oap-serviceaccount.yaml rename to test/e2e/e2e-test/src/test/resources/expected/als/endpoints-ratings.yml index fd6c2c2427..a7f0c3c8b1 100644 --- a/install/kubernetes/helm/skywalking/templates/oap-serviceaccount.yaml +++ b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-ratings.yml @@ -13,13 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app: {{ template "skywalking.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - component: "{{ .Values.oap.name }}" - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - name: {{ template "skywalking.serviceAccountName.oap" . }} +endpoints: + - key: not null + label: /ratings/0 diff --git a/install/kubernetes/helm/skywalking/.helmignore b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-reviews.yml similarity index 69% rename from install/kubernetes/helm/skywalking/.helmignore rename to test/e2e/e2e-test/src/test/resources/expected/als/endpoints-reviews.yml index 2044e65a4c..1a2f5f8266 100644 --- a/install/kubernetes/helm/skywalking/.helmignore +++ b/test/e2e/e2e-test/src/test/resources/expected/als/endpoints-reviews.yml @@ -13,25 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -OWNERS +endpoints: + - key: not null + label: /reviews/0 diff --git a/test/e2e/e2e-test/src/test/resources/expected/als/instances.yml b/test/e2e/e2e-test/src/test/resources/expected/als/instances.yml new file mode 100644 index 0000000000..7de572a775 --- /dev/null +++ b/test/e2e/e2e-test/src/test/resources/expected/als/instances.yml @@ -0,0 +1,18 @@ +# 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. + +instances: + - key: not null + label: not null diff --git a/install/kubernetes/helm/skywalking/charts/elasticsearch/.helmignore b/test/e2e/e2e-test/src/test/resources/expected/als/services.yml similarity index 69% rename from install/kubernetes/helm/skywalking/charts/elasticsearch/.helmignore rename to test/e2e/e2e-test/src/test/resources/expected/als/services.yml index 17b07a3654..bd79611af5 100644 --- a/install/kubernetes/helm/skywalking/charts/elasticsearch/.helmignore +++ b/test/e2e/e2e-test/src/test/resources/expected/als/services.yml @@ -13,25 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ +services: + - key: not null + label: re(ratings-v1.*) + - key: not null + label: re(reviews-v1.*) + - key: not null + label: re(reviews-v2.*) + - key: not null + label: re(reviews-v3.*) + - key: not null + label: re(productpage-v1.*) + - key: not null + label: re(details-v1.*) + - key: not null + label: re(istio-ingressgateway.*) diff --git a/test/e2e/e2e-test/src/test/resources/expected/als/topo.yml b/test/e2e/e2e-test/src/test/resources/expected/als/topo.yml new file mode 100644 index 0000000000..c369efd746 --- /dev/null +++ b/test/e2e/e2e-test/src/test/resources/expected/als/topo.yml @@ -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. + +nodes: + - id: not null + name: re(ratings-v1.*) + type: http + isReal: true + - id: not null + name: re(reviews-v1.*) + type: http + isReal: true + - id: not null + name: re(reviews-v2.*) + type: http + isReal: true + - id: not null + name: re(reviews-v3.*) + type: http + isReal: true + - id: not null + name: re(productpage-v1.*) + isReal: true + - id: not null + name: re(details-v1.*) + type: http + isReal: true + - id: not null + name: re(istio-ingressgateway.*) + type: http + isReal: true + - id: not null + name: UNKNOWN + isReal: true +calls: + - id: not null + source: re(VU5LTk9XTg.*) + target: re(aXN0aW8taW5ncmVzc2dhdGV3YXkt.*) + detectPoints: + - SERVER + - id: not null + source: re(cHJvZHVjdHBhZ2UtdjEt.*) + target: re(cmV2aWV3cy12MS0.*) + detectPoints: + - CLIENT + - SERVER + - id: not null + source: re(cHJvZHVjdHBhZ2UtdjEt.*) + target: re(ZGV0YWlscy12MS.*) + detectPoints: + - CLIENT + - SERVER + - id: not null + source: re(cHJvZHVjdHBhZ2UtdjEt.*) + target: re(cmV2aWV3cy12Mi.*) + detectPoints: + - CLIENT + - SERVER + - id: not null + source: re(cmV2aWV3cy12Mi.*) + target: re(cmF0aW5ncy12MS.*) + detectPoints: + - CLIENT + - SERVER + - id: not null + source: re(cmV2aWV3cy12My.*) + target: re(cmF0aW5ncy12MS.*) + detectPoints: + - CLIENT + - SERVER + - id: not null + source: re(aXN0aW8taW5ncmVzc2dhdGV3YXkt.*) + target: re(cHJvZHVjdHBhZ2UtdjEt.*) + detectPoints: + - CLIENT + - id: not null + source: re(cHJvZHVjdHBhZ2UtdjEt.*) + target: re(cmV2aWV3cy12My.*) + detectPoints: + - CLIENT + - SERVER -- GitLab