You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2023/03/26 09:27:40 UTC
[skywalking-showcase] branch main updated: Migrate to Helm Chart (#118)
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-showcase.git
The following commit(s) were added to refs/heads/main by this push:
new b7f15c9 Migrate to Helm Chart (#118)
b7f15c9 is described below
commit b7f15c9d0deaf6c281aad550388d8406aef54635
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Sun Mar 26 17:27:35 2023 +0800
Migrate to Helm Chart (#118)
---
.gitignore | 5 +
Makefile.in | 26 +-
deploy/platform/docker/Makefile | 4 +
deploy/platform/docker/Makefile.in | 2 +-
.../docker/config/otel-collector-config.yaml | 2 +-
.../docker/docker-compose.apisix-monitor.yaml | 2 +-
deploy/platform/docker/docker-compose.cluster.yaml | 6 +-
...ysql.yaml => docker-compose.mysql-monitor.yaml} | 2 +-
...yaml => docker-compose.postgresql-monitor.yaml} | 2 +-
.../platform/docker/docker-compose.satellite.yaml | 4 +-
.../docker/docker-compose.single-node.yaml | 4 +-
...pose.vm.yaml => docker-compose.vm-monitor.yaml} | 2 +-
deploy/platform/kubernetes/Chart.yaml | 59 ++++
deploy/platform/kubernetes/Makefile | 169 ++++++++---
deploy/platform/kubernetes/Makefile.in | 7 +-
.../feature-apisix-monitor/permissions.yaml | 47 ----
.../feature-apisix-monitor/resources.yaml | 104 -------
.../kubernetes/feature-cluster/permissions.yaml | 57 ----
.../kubernetes/feature-cluster/resources.yaml | 310 ---------------------
.../feature-elasticsearch/resources.yaml | 65 -----
.../feature-istiod-monitor/open-telemetry.yaml | 94 -------
.../feature-istiod-monitor/permissions.yaml | 50 ----
.../feature-kubernetes-monitor/open-telemetry.yaml | 122 --------
.../feature-kubernetes-monitor/permissions.yaml | 53 ----
.../kubernetes/feature-mysql/open-telemetry.yaml | 102 -------
.../kubernetes/feature-mysql/permissions.yaml | 47 ----
.../feature-postgresql/open-telemetry.yaml | 104 -------
.../kubernetes/feature-postgresql/permissions.yaml | 47 ----
.../kubernetes/feature-satellite/permissions.yaml | 48 ----
.../kubernetes/feature-satellite/resources.yaml | 75 -----
.../feature-single-node/permissions.yaml | 52 ----
.../kubernetes/feature-single-node/resources.yaml | 221 ---------------
.../kubernetes/feature-so11y/open-telemetry.yaml | 99 -------
.../kubernetes/feature-so11y/permissions.yaml | 47 ----
.../kubernetes/feature-vm/open-telemetry.yaml | 96 -------
.../kubernetes/feature-vm/permissions.yaml | 47 ----
deploy/platform/kubernetes/features.mk | 173 ------------
deploy/platform/kubernetes/templates/NOTES.txt | 56 ++++
deploy/platform/kubernetes/templates/_helpers.tpl | 39 +++
.../{ => templates}/feature-agent/resources.yaml | 106 ++++---
.../opentelemetry-config.yaml | 65 ++---
.../{ => templates}/feature-event/permissions.yaml | 5 +-
.../{ => templates}/feature-event/resources.yaml | 36 +--
.../{ => templates}/feature-event/scaler.yaml | 11 +-
.../{ => templates}/feature-function/resource.yaml | 13 +-
.../opentelemetry-config.yaml | 64 ++---
.../opentelemetry-config.yaml | 65 +++++
.../feature-mysql-monitor}/fluent-bit.yaml | 6 +-
.../feature-mysql-monitor}/mysql.yaml | 2 +
.../opentelemetry-config.yaml | 65 ++---
.../feature-postgresql-monitor}/fluent-bit.yaml | 5 +-
.../opentelemetry-config.yaml | 65 ++---
.../feature-postgresql-monitor}/psql.yaml | 3 +
.../feature-promql/configmaps.yaml} | 17 +-
.../{ => templates}/feature-promql/resources.yaml | 23 +-
.../{ => templates}/feature-rover/permissions.yaml | 6 +-
.../{ => templates}/feature-rover/profiling.yaml | 21 +-
.../{ => templates}/feature-rover/resources.yaml | 18 +-
.../feature-so11y/opentelemetry-config.yaml | 66 ++---
.../feature-trace-profiling/profiling.yaml | 9 +-
.../feature-vm-monitor/opentelemetry-config.yaml | 63 ++---
.../feature-vm-monitor}/vm.yaml | 3 +
.../templates/otel-collector-config.yaml | 61 ++++
.../platform/kubernetes/tmpcharts/base-1.14.4.tgz | Bin 0 -> 50208 bytes
.../tmpcharts/kube-state-metrics-5.0.1.tgz | Bin 0 -> 11604 bytes
.../tmpcharts/openfunction-v1.0.0-v0.5.0.tgz | Bin 0 -> 418403 bytes
....0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz | Bin 0 -> 103962 bytes
....0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz | Bin 0 -> 79131 bytes
deploy/platform/kubernetes/values.yaml | 310 +++++++++++++++++++++
docs/readme.md | 25 +-
scripts/wait-cert-manager-ready.sh | 59 ----
71 files changed, 1079 insertions(+), 2564 deletions(-)
diff --git a/.gitignore b/.gitignore
index 6388ee9..49fe0f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,3 +60,8 @@ out/
### VS Code ###
.vscode/
+
+deploy/platform/kubernetes/Chart.lock
+deploy/platform/kubernetes/charts/
+
+deploy/platform/kubernetes/generated
diff --git a/Makefile.in b/Makefile.in
index 6e162d1..d15d8d8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -19,15 +19,21 @@
comma := ,
.EXPORT_ALL_VARIABLES:
+DEBUG ?= false
DOCKER_BUILDKIT ?= 1
HUB ?= ghcr.io/apache/skywalking-showcase
TAG ?= $(shell git rev-parse --short HEAD)
-ES_IMAGE ?= docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.0
+ES_IMAGE ?= docker.elastic.co/elasticsearch/elasticsearch-oss
+ES_IMAGE_TAG ?= 7.10.2
+
+SW_OAP_IMAGE ?= ghcr.io/apache/skywalking/oap
+SW_OAP_IMAGE_TAG ?= af657356ed61c2595d70dd18eae5a6e5dbc39a82
+
+SW_UI_IMAGE ?= ghcr.io/apache/skywalking/ui
+SW_UI_IMAGE_TAG ?= af657356ed61c2595d70dd18eae5a6e5dbc39a82
-SW_OAP_IMAGE ?= ghcr.io/apache/skywalking/oap:e16d294bd815e78e5f1ca9d9fe3682465db3903d
-SW_UI_IMAGE ?= ghcr.io/apache/skywalking/ui:e16d294bd815e78e5f1ca9d9fe3682465db3903d
SW_CLI_IMAGE ?= ghcr.io/apache/skywalking-cli/skywalking-cli:0883266bfaa36612927b69e35781b64ea181758d
SW_EVENT_EXPORTER_IMAGE ?= ghcr.io/apache/skywalking-kubernetes-event-exporter/skywalking-kubernetes-event-exporter:8a012a3f968cb139f817189afb9b3748841bba22
SW_AGENT_JAVA_IMAGE ?= ghcr.io/apache/skywalking-java/skywalking-java:51161ae6a5b8e266eef39162cc4e23440d36ab38-java8
@@ -35,14 +41,18 @@ SW_AGENT_JAVA_IMAGE ?= ghcr.io/apache/skywalking-java/skywalking-java:51161ae6a5
SW_AGENT_NODEJS_BACKEND_VERSION ?= 59ef1aed6a404e2e8afffbb4b81ea849ae4f3026
SW_AGENT_NODEJS_FRONTEND_VERSION ?= 1e31bd17dcebb616163d848fc435f3a2d4822fb8
-SW_SATELLITE_IMAGE ?= ghcr.io/apache/skywalking-satellite/skywalking-satellite:v672ec32414c38f3589124c6131b0b4473cda0de5
-SW_ROVER_IMAGE ?= ghcr.io/apache/skywalking-rover/skywalking-rover:668abb2fbc38250d2bd825e62ec5678bb8017864
+SW_SATELLITE_IMAGE ?= ghcr.io/apache/skywalking-satellite/skywalking-satellite
+SW_SATELLITE_IMAGE_TAG ?= v672ec32414c38f3589124c6131b0b4473cda0de5
-SWCK_OPERATOR_VERSION ?= 0.7.0
-CERT_MANAGER_VERSION ?= v1.9.1
+SW_ROVER_IMAGE ?= ghcr.io/apache/skywalking-rover/skywalking-rover:668abb2fbc38250d2bd825e62ec5678bb8017864
-OPEN_FUNCTION_VERSION ?= v0.6.0
+SWCK_OPERATOR_IMAGE ?= docker.io/apache/skywalking-swck
+SWCK_OPERATOR_IMAGE_TAG ?= v0.7.0
GRAFANA_IMAGE ?= grafana/grafana:9.1.0
+
+OTEL_COLLECTOR_IMAGE ?= otel/opentelemetry-collector
+OTEL_COLLECTOR_IMAGE_TAG ?= 0.72.0
+
# ALL variables should be listed above ^^
EXPORTED_VARS := $(filter-out <%,$(.VARIABLES))
diff --git a/deploy/platform/docker/Makefile b/deploy/platform/docker/Makefile
index 4fdf867..c253b0b 100644
--- a/deploy/platform/docker/Makefile
+++ b/deploy/platform/docker/Makefile
@@ -29,7 +29,11 @@ endif
.PHONY: deploy
deploy:
+ifeq ($(DEBUG),true)
+ docker compose $(features) config
+else
docker compose $(features) up -d
+endif
.PHONY: undeploy
undeploy:
diff --git a/deploy/platform/docker/Makefile.in b/deploy/platform/docker/Makefile.in
index a0bea00..6c8ef8f 100644
--- a/deploy/platform/docker/Makefile.in
+++ b/deploy/platform/docker/Makefile.in
@@ -17,4 +17,4 @@
#
.EXPORT_ALL_VARIABLES:
-FEATURE_FLAGS ?= agent,cluster,so11y,vm,event,mysql,apisix-monitor,promql
+FEATURE_FLAGS ?= agent,cluster,so11y,vm-monitor,event,mysql-monitor,apisix-monitor,promql
diff --git a/deploy/platform/docker/config/otel-collector-config.yaml b/deploy/platform/docker/config/otel-collector-config.yaml
index 0b44a52..00c09a5 100644
--- a/deploy/platform/docker/config/otel-collector-config.yaml
+++ b/deploy/platform/docker/config/otel-collector-config.yaml
@@ -31,7 +31,7 @@ exporters:
endpoint: "oap:11800"
insecure: true
logging:
- logLevel: debug
+ verbosity: detailed
service:
pipelines:
diff --git a/deploy/platform/docker/docker-compose.apisix-monitor.yaml b/deploy/platform/docker/docker-compose.apisix-monitor.yaml
index e0586ae..bb2bbd6 100644
--- a/deploy/platform/docker/docker-compose.apisix-monitor.yaml
+++ b/deploy/platform/docker/docker-compose.apisix-monitor.yaml
@@ -23,7 +23,7 @@ version: '2.1'
services:
# frontend metrics collector
apisix-otel-collector:
- image: otel/opentelemetry-collector:0.50.0
+ image: ${OTEL_COLLECTOR_IMAGE}:${OTEL_COLLECTOR_IMAGE_TAG}
command: [ "--config=/etc/otel-collector-config.yaml" ]
volumes:
- ./config/apisix/otel-collector-config.yaml:/etc/otel-collector-config.yaml
diff --git a/deploy/platform/docker/docker-compose.cluster.yaml b/deploy/platform/docker/docker-compose.cluster.yaml
index 16ad05b..5e35746 100644
--- a/deploy/platform/docker/docker-compose.cluster.yaml
+++ b/deploy/platform/docker/docker-compose.cluster.yaml
@@ -35,7 +35,7 @@ services:
retries: 120
oap-init: # @feature: cluster; set up an init container to initialize the storage templates and indices
- image: ${SW_OAP_IMAGE}
+ image: ${SW_OAP_IMAGE}:${SW_OAP_IMAGE_TAG}
networks: [ sw ]
environment:
SW_STORAGE: elasticsearch
@@ -46,7 +46,7 @@ services:
condition: service_healthy
oap1: &oap
- image: ${SW_OAP_IMAGE}
+ image: ${SW_OAP_IMAGE}:${SW_OAP_IMAGE_TAG}
networks: [ sw ]
environment:
SW_CLUSTER: zookeeper # @feature: cluster; set up a cluster coordinator
@@ -75,7 +75,7 @@ services:
<<: *oap
ui:
- image: ${SW_UI_IMAGE}
+ image: ${SW_UI_IMAGE}:${SW_UI_IMAGE_TAG}
networks: [ sw ]
ports:
- "9999:8080"
diff --git a/deploy/platform/docker/docker-compose.mysql.yaml b/deploy/platform/docker/docker-compose.mysql-monitor.yaml
similarity index 96%
rename from deploy/platform/docker/docker-compose.mysql.yaml
rename to deploy/platform/docker/docker-compose.mysql-monitor.yaml
index 4e29e0b..6807ff9 100644
--- a/deploy/platform/docker/docker-compose.mysql.yaml
+++ b/deploy/platform/docker/docker-compose.mysql-monitor.yaml
@@ -56,7 +56,7 @@ services:
otel-collector:
- image: otel/opentelemetry-collector:0.50.0
+ image: ${OTEL_COLLECTOR_IMAGE}:${OTEL_COLLECTOR_IMAGE_TAG}
networks:
- sw
command: [ "--config=/etc/otel-collector-config.yaml" ]
diff --git a/deploy/platform/docker/docker-compose.postgresql.yaml b/deploy/platform/docker/docker-compose.postgresql-monitor.yaml
similarity index 96%
rename from deploy/platform/docker/docker-compose.postgresql.yaml
rename to deploy/platform/docker/docker-compose.postgresql-monitor.yaml
index 089f4de..2b86022 100644
--- a/deploy/platform/docker/docker-compose.postgresql.yaml
+++ b/deploy/platform/docker/docker-compose.postgresql-monitor.yaml
@@ -53,7 +53,7 @@ services:
- sw
otel-collector:
- image: otel/opentelemetry-collector:0.50.0
+ image: ${OTEL_COLLECTOR_IMAGE}:${OTEL_COLLECTOR_IMAGE_TAG}
networks:
- sw
command: [ "--config=/etc/otel-collector-config.yaml" ]
diff --git a/deploy/platform/docker/docker-compose.satellite.yaml b/deploy/platform/docker/docker-compose.satellite.yaml
index 1b34c93..16084c4 100644
--- a/deploy/platform/docker/docker-compose.satellite.yaml
+++ b/deploy/platform/docker/docker-compose.satellite.yaml
@@ -19,7 +19,7 @@ version: '2.1'
services:
satellite:
- image: ${SW_SATELLITE_IMAGE}
+ image: ${SW_SATELLITE_IMAGE}:${SW_SATELLITE_IMAGE_TAG}
networks: [ sw ]
healthcheck:
test: [ "CMD-SHELL", "sh", "-c", "nc -zn 127.0.0.1 11800" ]
@@ -35,4 +35,4 @@ services:
condition: service_healthy
networks:
- sw:
\ No newline at end of file
+ sw:
diff --git a/deploy/platform/docker/docker-compose.single-node.yaml b/deploy/platform/docker/docker-compose.single-node.yaml
index 72c076e..9ef58a4 100644
--- a/deploy/platform/docker/docker-compose.single-node.yaml
+++ b/deploy/platform/docker/docker-compose.single-node.yaml
@@ -19,7 +19,7 @@ version: '2.1'
services:
elasticsearch:
- image: ${ES_IMAGE}
+ image: ${ES_IMAGE}:${ES_IMAGE_TAG}
networks: [ sw ]
ports:
- "9200:9200"
@@ -38,7 +38,7 @@ services:
hard: -1
oap:
- image: ${SW_OAP_IMAGE}
+ image: ${SW_OAP_IMAGE}:${SW_OAP_IMAGE_TAG}
networks: [ sw ]
environment:
SW_HEALTH_CHECKER: default # @feature: health-check;
diff --git a/deploy/platform/docker/docker-compose.vm.yaml b/deploy/platform/docker/docker-compose.vm-monitor.yaml
similarity index 96%
rename from deploy/platform/docker/docker-compose.vm.yaml
rename to deploy/platform/docker/docker-compose.vm-monitor.yaml
index dded88f..b9e58ee 100644
--- a/deploy/platform/docker/docker-compose.vm.yaml
+++ b/deploy/platform/docker/docker-compose.vm-monitor.yaml
@@ -52,7 +52,7 @@ services:
condition: service_healthy
otel-collector:
- image: otel/opentelemetry-collector:0.29.0
+ image: ${OTEL_COLLECTOR_IMAGE}:${OTEL_COLLECTOR_IMAGE_TAG}
networks: [ sw ]
command: [ "--config=/etc/otel-collector-config.yaml" ]
volumes:
diff --git a/deploy/platform/kubernetes/Chart.yaml b/deploy/platform/kubernetes/Chart.yaml
new file mode 100644
index 0000000..3a8e4e8
--- /dev/null
+++ b/deploy/platform/kubernetes/Chart.yaml
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v2
+name: skywalking-showcase
+home: https://skywalking.apache.org
+version: 0.0.0
+description: Apache SkyWalking showcase
+icon: https://raw.githubusercontent.com/apache/skywalking-kubernetes/master/logo/sw-logo-for-chart.jpg
+sources:
+ - https://github.com/apache/skywalking-showcase
+dependencies:
+ - name: skywalking-helm
+ version: 0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9
+ repository: oci://ghcr.io/apache/skywalking-kubernetes
+
+ # @feature: java-agent-injector; the java agent injector is a component of the swck operator, so we need to deploy the swck operator firstly
+ - name: skywalking-helm-swck-operator
+ version: 0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9
+ repository: oci://ghcr.io/apache/skywalking-kubernetes
+ condition: features.javaAgentInjector.enabled
+
+ # @feature: function; install open function resources
+ - name: openfunction
+ version: 0.5.0
+ repository: https://openfunction.github.io/charts
+ condition: openfunction.enabled
+
+ - name: kube-state-metrics
+ version: 5.0.1
+ repository: https://prometheus-community.github.io/helm-charts
+ condition: kube-state-metrics.enabled
+
+ - name: base
+ version: 1.14.4
+ repository: https://istio-release.storage.googleapis.com/charts
+ condition: istio.enabled
+
+ - name: istiod
+ version: 1.14.4
+ repository: https://istio-release.storage.googleapis.com/charts
+ condition: istio.enabled
+
+ - name: opentelemetry-collector
+ version: 0.51.1
+ repository: https://open-telemetry.github.io/opentelemetry-helm-charts
+ condition: opentelemetry.enabled
diff --git a/deploy/platform/kubernetes/Makefile b/deploy/platform/kubernetes/Makefile
index e7c1565..6dbba13 100644
--- a/deploy/platform/kubernetes/Makefile
+++ b/deploy/platform/kubernetes/Makefile
@@ -19,54 +19,143 @@
include ../../../Makefile.in
include Makefile.in
+HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.fullnameOverride=$(RELEASE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.oap.image.repository=$(SW_OAP_IMAGE) --set skywalking-helm.oap.image.tag=$(SW_OAP_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.ui.image.repository=$(SW_UI_IMAGE) --set skywalking-helm.ui.image.tag=$(SW_UI_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.ui.env.SW_ZIPKIN_ADDRESS=http://$(RELEASE)-oap.$(NAMESPACE).svc:9412
+HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.satellite.image.repository=$(SW_SATELLITE_IMAGE) --set skywalking-helm.satellite.image.tag=$(SW_SATELLITE_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm-swck-operator.image.repository=$(SWCK_OPERATOR_IMAGE) --set skywalking-helm-swck-operator.image.tag=$(SWCK_OPERATOR_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set sampleServices.hub=$(HUB) --set sampleServices.tag=$(TAG) --set sampleServices.namespace=$(SAMPLE_SERVICES_NAMESPACE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry-collector.image.repository=$(OTEL_COLLECTOR_IMAGE) --set opentelemetry-collector.image.tag=$(OTEL_COLLECTOR_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set features.rover.swctl.image=$(SW_CLI_IMAGE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set features.traceProfiling.swctl.image=$(SW_CLI_IMAGE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set features.event.exporter.image=$(SW_EVENT_EXPORTER_IMAGE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set features.javaAgentInjector.agentImage=$(SW_AGENT_JAVA_IMAGE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set features.rover.image=$(SW_ROVER_IMAGE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set features.promql.grafana.image=$(GRAFANA_IMAGE)
+
+
features := $(subst $(comma), ,$(FEATURE_FLAGS))
features := $(foreach f,$(features),feature-$(f))
-ifneq (,$(findstring satellite,$(features)))
- BACKEND_SERVICE := satellite
+ifeq ($(DEBUG),true)
+ HELM_OPTIONS := $(HELM_OPTIONS) --dry-run
endif
-# Deploy
-deploy_features := $(foreach r,$(features),deploy.$(r))
-.PHONY: $(deploy_features)
-$(deploy_features): %: %.resources
+.PHONY: helm
+helm:
+ @helm version >/dev/null 2>&1 || (echo "No helm in PATH, please make sure helm is available in PATH."; exit 1)
-deploy_resources := $(foreach r,$(deploy_features),$(r).resources)
-.PHONY: $(deploy_resources)
-$(deploy_resources): deploy.%.resources: %
- $(eval resources := $(wildcard $(shell pwd)/$</*))
- @$(foreach resource, $(resources), docker run --rm -v "$(pwd)/$(resource)":/input \
- $(foreach v,$(EXPORTED_VARS),-e $(v)) \
- bhgedigital/envsubst sh -c "envsubst < /input" | kubectl -n $(NAMESPACE) apply -f - ; \
- )
+# @feature: java-agent-injector; use the java agent injector to inject the java agent more natively
+.PHONY: feature-java-agent-injector
+feature-java-agent-injector:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.javaAgentInjector.enabled=true)
-.PHONY: deploy
-deploy: $(deploy_features)
-ifneq ($(SHOW_TIPS),false)
- @echo
- @echo "Now wait the Pods to be ready and use the following command to expose the port of SkyWalking UI"
- @echo
- @echo " $$ kubectl port-forward svc/ui 8080:8080 --namespace $(NAMESPACE)"
- @echo
- @echo "Then open your browser and navigate to http://localhost:8080"
- @echo
-endif
+.PHONY: feature-single-node
+feature-single-node:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.oap.replicas=1)
-# Undeploy
-undeploy_features := $(foreach r,$(features),undeploy.$(r))
-.PHONY: $(undeploy_features)
-$(undeploy_features): %: %.resources
+.PHONY: feature-cluster
+feature-cluster:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.oap.replicas=2)
-undeploy_resources := $(foreach r,$(undeploy_features),$(r).resources)
-.PHONY: $(undeploy_resources)
-$(undeploy_resources): undeploy.%.resources: %
- $(eval resources := $(wildcard $(shell pwd)/$</*))
- @$(foreach resource, $(resources), docker run --rm -v "$(pwd)/$(resource)":/input \
- $(foreach v,$(EXPORTED_VARS),-e $(v)) \
- bhgedigital/envsubst sh -c "envsubst < /input" | kubectl -n $(NAMESPACE) delete --ignore-not-found -f - ; \
- )
+.PHONY: feature-elasticsearch
+feature-elasticsearch:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.oap.storageType=elasticsearch)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.elasticsearch.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.elasticsearch.image=$(ES_IMAGE))
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.elasticsearch.imageTag=$(ES_IMAGE_TAG))
-.PHONY: undeploy
-undeploy: $(undeploy_features)
+.PHONY: feature-postgresql
+feature-postgresql:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.oap.storageType=postgresql)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking-helm.postgresql.enabled=true)
+
+.PHONY: feature-so11y
+feature-so11y:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.so11y.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
+.PHONY: feature-vm-monitor
+feature-vm-monitor:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.vmMonitor.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
+.PHONY: feature-event
+feature-event:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.event.enabled=true)
+
+.PHONY: feature-istiod-monitor
+feature-istiod-monitor:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.istiodMonitor.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set istio.enabled=true --set istiod.global.istioNamespace=$(NAMESPACE) --set base.global.istioNamespace=$(NAMESPACE))
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
+.PHONY: feature-als
+feature-als:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.als.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set istio.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set istiod.meshConfig.defaultConfig.tracing.zipkin.address=$(RELEASE)-oap.$(NAMESPACE).svc:9411)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set istiod.meshConfig.defaultConfig.envoyMetricsService.address=$(RELEASE)-oap.$(NAMESPACE).svc:11800)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set istiod.meshConfig.defaultConfig.envoyAccessLogService.address=$(RELEASE)-oap.$(NAMESPACE).svc:11800)
+
+.PHONY: feature-satellite
+feature-satellite:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.satellite.enabled=true)
+
+.PHONY: feature-rover
+feature-rover:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.rover.enabled=true)
-include features.mk
+.PHONY: feature-trace-profiling
+feature-trace-profiling:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.traceProfiling.enabled=true)
+
+.PHONY: feature-mysql-monitor
+feature-mysql-monitor:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.mysqlMonitor.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
+.PHONY: feature-postgresql-monitor
+feature-postgresql-monitor:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.postgresqlMonitor.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
+.PHONY: feature-apisix-monitor
+feature-apisix-monitor:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.apisixMonitor.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
+# @feature: kubernetes-monitor; extra resources to install for kubernetes monitoring, standard kube-state-metrics
+.PHONY: feature-kubernetes-monitor
+feature-kubernetes-monitor:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.kubernetesMonitor.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set kube-state-metrics.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
+.PHONY: feature-function
+feature-function:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.function.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set openfunction.enabled=true)
+
+.PHONY: feature-promql
+feature-promql:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.promql.enabled=true)
+ @mkdir -p ./generated/promql-configs/
+ @cp ../config/promql/dashboards/*.json ./generated/promql-configs/
+
+.PHONY: feature-mesh-with-agent
+feature-mesh-with-agent:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.meshWithAgent.enabled=true)
+
+.PHONY: deploy
+deploy: $(features)
+ helm dep up .
+ helm -n $(NAMESPACE) upgrade --install $(RELEASE) . --create-namespace $(HELM_OPTIONS)
+
+ $(info rollout restart to allow the new sidecar to be injected.)
+ kubectl -n $(SAMPLE_SERVICES_NAMESPACE) get deployments -o name | xargs kubectl -n $(SAMPLE_SERVICES_NAMESPACE) rollout restart
+
+.PHONY: undeploy
+undeploy:
+ helm -n $(NAMESPACE) delete $(RELEASE)
diff --git a/deploy/platform/kubernetes/Makefile.in b/deploy/platform/kubernetes/Makefile.in
index 6ddc6e6..24ac366 100644
--- a/deploy/platform/kubernetes/Makefile.in
+++ b/deploy/platform/kubernetes/Makefile.in
@@ -18,8 +18,9 @@
.EXPORT_ALL_VARIABLES:
-NAMESPACE ?= default
+NAMESPACE ?= skywalking-showcase
+SAMPLE_SERVICES_NAMESPACE ?= sample-services
+RELEASE ?= demo
AGENTLESS ?= false
-BACKEND_SERVICE ?= oap
-FEATURE_FLAGS ?= java-agent-injector,cluster,elasticsearch,kubernetes-monitor,so11y,vm,als,event,istiod-monitor,satellite,rover,trace-profiling,mysql,apisix-monitor,promql
+FEATURE_FLAGS ?= java-agent-injector,cluster,elasticsearch,kubernetes-monitor,so11y,vm-monitor,als,event,istiod-monitor,satellite,rover,trace-profiling,mysql-monitor,postgresql-monitor,apisix-monitor,promql
diff --git a/deploy/platform/kubernetes/feature-apisix-monitor/permissions.yaml b/deploy/platform/kubernetes/feature-apisix-monitor/permissions.yaml
deleted file mode 100644
index ac17148..0000000
--- a/deploy/platform/kubernetes/feature-apisix-monitor/permissions.yaml
+++ /dev/null
@@ -1,47 +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: ServiceAccount
-metadata:
- name: otel-sa-apisix
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: otel-role-apisix
-rules:
- - apiGroups: [ "" ]
- resources:
- - "pods"
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: otel-role-binding-apisix
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: otel-role-apisix
-subjects:
- - kind: ServiceAccount
- name: otel-sa-apisix
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-apisix-monitor/resources.yaml b/deploy/platform/kubernetes/feature-apisix-monitor/resources.yaml
deleted file mode 100644
index 9c82bca..0000000
--- a/deploy/platform/kubernetes/feature-apisix-monitor/resources.yaml
+++ /dev/null
@@ -1,104 +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: ConfigMap
-metadata:
- name: otel-collector-conf-apisix
- labels:
- app: otel-apisix
-data:
- otel-collector-config: |
- receivers:
- prometheus:
- config:
- scrape_configs:
- - job_name: 'apisix-monitoring'
- scrape_interval: 5s
- metrics_path: "/apisix/prometheus/metrics"
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - source_labels: [__meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name]
- action: keep
- regex: frontend;metrics # @feature: apisix-monitor; reference the name of the metrics port
- - source_labels: [__meta_kubernetes_pod_name]
- target_label: service_instance_id
- regex: (.+)
- replacement: $$1
- - target_label: skywalking_service
- replacement: frontend
- processors:
- batch:
- exporters:
- otlp:
- endpoint: oap:11800
- tls:
- insecure: true
- service:
- pipelines:
- metrics:
- receivers:
- - prometheus
- processors:
- - batch
- exporters:
- - otlp
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: apisix-opentelemetry-deployment
- labels:
- app: apisix-opentelemetry
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: apisix-opentelemetry
- template:
- metadata:
- labels:
- app: apisix-opentelemetry
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: otel-sa-apisix
- containers:
- - name: apisix-opentelemetry
- image: otel/opentelemetry-collector:0.50.0
- imagePullPolicy: IfNotPresent
- args: [ "--config=/conf/otel-collector-config.yaml" ]
- volumeMounts:
- - name: otel-collector-conf-apisix
- mountPath: /conf
- resources:
- limits:
- cpu: 500m
- memory: "512Mi"
- requests:
- cpu: 500m
- memory: "512Mi"
- volumes:
- - name: otel-collector-conf-apisix
- configMap:
- name: otel-collector-conf-apisix
- items:
- - key: otel-collector-config
- path: otel-collector-config.yaml
diff --git a/deploy/platform/kubernetes/feature-cluster/permissions.yaml b/deploy/platform/kubernetes/feature-cluster/permissions.yaml
deleted file mode 100644
index dad1c9d..0000000
--- a/deploy/platform/kubernetes/feature-cluster/permissions.yaml
+++ /dev/null
@@ -1,57 +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: ServiceAccount
-metadata:
- name: skywalking-oap-sa-cluster
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: skywalking-oap-sa-cluster-role
-rules:
- - apiGroups: [ "" ]
- resources:
- - "pods" # @feature: cluster; OAP needs to read other OAP Pods information to form a cluster
- # @feature: als; OAP needs to read Pods metadata to analyze the access logs
- - "pods/log" # @feature: on-demand-pod-logs; in feature on demand Pod logs, OAP needs to read pods logs
- - "services" # @feature: als; OAP needs to read services metadata to analyze the access logs
- - "endpoints" # @feature: als; OAP needs to read endpoints metadata to analyze the access logs
- - "nodes" # @feature: als; OAP needs to read nodes metadata to analyze the access logs
- - "configmaps"
- verbs: [ "get", "watch", "list" ]
- - apiGroups: [ "batch" ]
- resources:
- - "jobs" # @feature: cluster; OAP needs to wait for the init job to complete
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: skywalking-oap-sa-cluster-role-binding
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: skywalking-oap-sa-cluster-role
-subjects:
- - kind: ServiceAccount
- name: skywalking-oap-sa-cluster
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-cluster/resources.yaml b/deploy/platform/kubernetes/feature-cluster/resources.yaml
deleted file mode 100644
index 0fc9099..0000000
--- a/deploy/platform/kubernetes/feature-cluster/resources.yaml
+++ /dev/null
@@ -1,310 +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
-data:
- metadata-service-mapping.yaml: |
- serviceName: mesh-svr::${LABELS."service.istio.io/canonical-name",LABELS."app.kubernetes.io/name",LABELS.app}
- serviceInstanceName: ${NAME,NAME} # Just to skip the "envsubst" replacement
- alarm-settings.yml: |
- rules:
- service_resp_time_rule:
- metrics-name: service_resp_time
- threshold: 20 # 20ms is just for demo
- op: ">"
- period: 5
- count: 1
- message: Response time of service {name} is more than 20ms.
-kind: ConfigMap
-metadata:
- name: oap-static-config
-
----
-apiVersion: v1
-data:
- core.default.log4j-xml: |-
- <Configuration status="WARN">
- <Appenders>
- <Console name="Console" target="SYSTEM_OUT">
- <PatternLayout charset="UTF-8" pattern="%d - %c - %L [%t] %-5p %x - %m%n"/>
- </Console>
- </Appenders>
- <Loggers>
- <logger name="io.grpc.netty" level="INFO"/>
- <logger name="org.apache.skywalking.oap.server.configuration.api" level="TRACE"/>
- <logger name="org.apache.skywalking.oap.server.configuration.configmap" level="DEBUG"/>
- <Root level="INFO">
- <AppenderRef ref="Console"/>
- </Root>
- </Loggers>
- </Configuration>
-kind: ConfigMap
-metadata:
- labels:
- app: oap
- name: oap-dynamic-config
-
----
-apiVersion: v1
-kind: Service
-metadata:
- name: oap
-spec:
- selector:
- app: oap
- ports:
- - name: metrics
- port: 1234
- - name: grpc
- port: 11800
- - name: http
- port: 12800
- - name: zipkin-receiver
- port: 9411
- - name: zipkin-query
- port: 9412
- - name: promql
- port: 9090
-
----
-apiVersion: batch/v1
-kind: Job
-metadata:
- name: oap-init-job # @feature: cluster; set up an init job to initialize ES templates and indices
-spec:
- template:
- metadata:
- name: oap-init-job
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: skywalking-oap-sa-cluster
- restartPolicy: Never
- initContainers:
- - name: wait-for-es
- image: busybox:1.30
- command:
- - "sh"
- - "-c"
- - "for i in $(seq 1 60); do nc -z -w3 elasticsearch 9200 && exit 0 || sleep 5; done; exit 1"
- containers:
- - name: oap-init
- image: ${SW_OAP_IMAGE}
- imagePullPolicy: Always
- env: # @feature: cluster; make sure all env vars are the same with the cluster nodes as this will affect templates / indices
- - name: JAVA_OPTS
- value: "-Dmode=init" # @feature: cluster; set the OAP mode to "init" so the job can complete
- - name: SW_OTEL_RECEIVER
- value: default
- - name: SW_OTEL_RECEIVER_ENABLED_OTEL_RULES
- # @feature: vm; enable vm rules to analyze VM metrics
- # @feature: so11y; enable oap rules to analyze OAP metrics
- # @feature: kubernetes-monitor; enable rules to analyze Kubernetes Cluster/Node/Service metrics
- # @feature: istiod-monitor; enable rules to analyze Istio control plane metrics
- # @feature: mysql; enable mysql rules to analyze MySQL metrics
- # @feature: apisix-monitor; enable APISIX rules to analyze APISIX metrics
- value: vm,oap,k8s/*,istio-controlplane,mysql/*,postgresql/*,apisix
- - name: SW_STORAGE
- value: elasticsearch
- - name: SW_STORAGE_ES_CLUSTER_NODES
- value: elasticsearch:9200
- - name: SW_STORAGE_ES_INDEX_REPLICAS_NUMBER
- value: "0"
- - name: SW_TELEMETRY
- value: prometheus
- - name: SW_METER_ANALYZER_ACTIVE_FILES
- value: datasource,threadpool,satellite,network-profiling,spring-sleuth
- - name: SW_STORAGE_ES_RESPONSE_TIMEOUT
- value: "50000"
- - name: SW_STORAGE_ES_INDEX_SHARDS_NUMBER
- value: "6"
- - name: SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR
- value: "2"
- - name: SW_RECEIVER_ZIPKIN
- value: default
- - name: SW_QUERY_ZIPKIN
- value: default
- volumeMounts:
- - name: config-volume
- mountPath: /skywalking/ext-config
- volumes:
- - name: config-volume
- configMap:
- name: oap-static-config
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: oap-deployment
- labels:
- app: oap
-spec:
- replicas: 2 # @feature: cluster; set OAP replicas to >1
- selector:
- matchLabels:
- app: oap
- template:
- metadata:
- labels:
- app: oap
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: skywalking-oap-sa-cluster # @feature: cluster; set a service account with Pod "read" permission
- initContainers:
- - name: wait-for-oap-init
- image: bitnami/kubectl:1.20.12
- command:
- - "kubectl"
- - "wait"
- - "--for=condition=complete"
- - "job/oap-init-job"
- containers:
- - name: oap
- image: ${SW_OAP_IMAGE}
- imagePullPolicy: Always
- resources:
- limits:
- cpu: 4000m
- memory: "4096Mi"
- requests:
- cpu: 1000m
- memory: "1024Mi"
- ports:
- - name: metrics # @feature: so11y; set a name for the metrics port that can be referenced in otel config
- containerPort: 1234
- - name: grpc
- containerPort: 11800
- - name: http
- containerPort: 12800
- - name: zipkin-receiver
- containerPort: 9411
- - name: zipkin-query
- containerPort: 9412
- - name: promql
- containerPort: 9090
- env:
- - name: JAVA_OPTS
- value: "-Dmode=no-init"
- - name: SW_CLUSTER
- value: kubernetes # @feature: cluster; set cluster coordinator to kubernetes
- - name: SW_CLUSTER_K8S_NAMESPACE
- value: ${NAMESPACE}
- - name: SW_CLUSTER_K8S_LABEL
- value: app=oap # @feature: cluster; set label selectors to select OAP Pods as a cluster
- - name: SKYWALKING_COLLECTOR_UID # @feature: cluster; set collector uid to identify the OAP node
- valueFrom:
- fieldRef:
- fieldPath: metadata.uid
- - name: SW_HEALTH_CHECKER
- value: default
- - name: SW_OTEL_RECEIVER
- value: default # @feature: so11y;,mysql;kubernetes-monitor enable OpenTelemetry receiver to receive OpenTelemetry metrics
- - name: SW_OTEL_RECEIVER_ENABLED_OTEL_RULES
- # @feature: vm; enable vm rules to analyze VM metrics
- # @feature: so11y; enable oap rules to analyze OAP metrics
- # @feature: kubernetes-monitor; enable rules to analyze Kubernetes Cluster/Node/Service metrics
- # @feature: istiod-monitor; enable rules to analyze Istio control plane metrics
- # @feature: mysql; enable mysql rules to analyze MySQL metrics
- # @feature: apisix-monitor; enable APISIX rules to analyze APISIX metrics
- value: vm,oap,k8s/*,istio-controlplane,mysql/*,postgresql/*,apisix
- - name: SW_STORAGE
- value: elasticsearch
- - name: SW_STORAGE_ES_CLUSTER_NODES
- value: elasticsearch:9200
- - name: SW_TELEMETRY
- value: prometheus # @feature: so11y; expose the metrics of self o11y through prometheus
- - name: SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS
- value: "mx-mesh,persistence" # @feature: als; enable mesh analyzer (mx-mesh) to analyze ALS logs
- - name: K8S_SERVICE_NAME_RULE
- value: "mesh-svr::${service.metadata.name}"
- - name: SW_CONFIGURATION
- value: k8s-configmap
- - name: SW_ENVOY_METRIC_ALS_TCP_ANALYSIS
- value: "mx-mesh"
- - name: SW_ENABLE_UPDATE_UI_TEMPLATE
- value: "false"
- - name: SW_SLOW_DB_THRESHOLD
- value: default:0,mongodb:100
- - name: SW_ENABLE_ON_DEMAND_POD_LOG
- value: "true"
- - name: SW_METER_ANALYZER_ACTIVE_FILES
- value: datasource,threadpool,satellite,network-profiling,spring-sleuth
- - name: SW_STORAGE_ES_RESPONSE_TIMEOUT
- value: "50000"
- - name: SW_STORAGE_ES_INDEX_SHARDS_NUMBER
- value: "6"
- - name: SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR
- value: "2"
- - name: SW_RECEIVER_ZIPKIN
- value: default
- - name: SW_QUERY_ZIPKIN
- value: default
- volumeMounts:
- - name: config-volume
- mountPath: /skywalking/ext-config
- volumes:
- - name: config-volume
- configMap:
- name: oap-static-config
-
----
-apiVersion: v1
-kind: Service
-metadata:
- name: ui
-spec:
- selector:
- app: ui
- ports:
- - protocol: TCP
- port: 8080
- targetPort: 8080
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: ui-deployment
- labels:
- app: ui
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: ui
- template:
- metadata:
- labels:
- app: ui
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: skywalking-oap-sa-cluster
- containers:
- - name: ui
- image: ${SW_UI_IMAGE}
- imagePullPolicy: Always
- ports:
- - containerPort: 8080
- env:
- - name: SW_OAP_ADDRESS
- value: http://oap:12800
- - name: SW_ZIPKIN_ADDRESS
- value: http://oap:9412
diff --git a/deploy/platform/kubernetes/feature-elasticsearch/resources.yaml b/deploy/platform/kubernetes/feature-elasticsearch/resources.yaml
deleted file mode 100644
index 755b362..0000000
--- a/deploy/platform/kubernetes/feature-elasticsearch/resources.yaml
+++ /dev/null
@@ -1,65 +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: elasticsearch
-spec:
- selector:
- app: elasticsearch
- ports:
- - protocol: TCP
- port: 9200
- targetPort: 9200
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: es-deployment
- labels:
- app: elasticsearch
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: elasticsearch
- template:
- metadata:
- labels:
- app: elasticsearch
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- containers:
- - name: elasticsearch
- image: ${ES_IMAGE}
- imagePullPolicy: Always
- resources:
- limits:
- cpu: 4000m
- memory: "4096Mi"
- requests:
- cpu: 4000m
- memory: "4096Mi"
- ports:
- - containerPort: 9200
- env:
- - name: "discovery.type"
- value: "single-node"
diff --git a/deploy/platform/kubernetes/feature-istiod-monitor/open-telemetry.yaml b/deploy/platform/kubernetes/feature-istiod-monitor/open-telemetry.yaml
deleted file mode 100644
index db98d5d..0000000
--- a/deploy/platform/kubernetes/feature-istiod-monitor/open-telemetry.yaml
+++ /dev/null
@@ -1,94 +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.
-#
-
-# @feature: istiod-monitor; set OpenTelemetry config to scrape the Istio control plane metrics
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: otel-collector-conf-istio-monitor
- labels:
- app: otel-istio-monitor
-data:
- otel-collector-config: |
- service:
- pipelines:
- metrics:
- receivers: [ prometheus ]
- exporters: [ logging, otlp ]
- exporters:
- otlp:
- endpoint: "oap:11800"
- tls:
- insecure: true
- logging:
- loglevel: debug
- receivers:
- prometheus:
- config:
- scrape_configs:
- # @feature: istiod-monitor; configuration to scrape Istio control plane metrics
- - job_name: 'istiod-monitor'
- kubernetes_sd_configs:
- - role: endpoints
- relabel_configs:
- - source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
- action: keep
- regex: istiod;http-monitoring
- - action: labelmap
- regex: __meta_kubernetes_service_label_(.+)
- - source_labels: []
- target_label: cluster
- replacement: skywalking-showcase
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: otel-deployment-istio-monitor
- labels:
- app: otel-istio-monitor
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: otel-istio-monitor
- template:
- metadata:
- labels:
- app: otel-istio-monitor
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: otel-sa-istio-monitor
- containers:
- - name: otel-istio-monitor
- image: otel/opentelemetry-collector:0.50.0
- command:
- - "/otelcol"
- - "--config=/conf/otel-collector-config.yaml"
- volumeMounts:
- - name: otel-collector-config-vol-istio-monitor
- mountPath: /conf
- volumes:
- - name: otel-collector-config-vol-istio-monitor
- configMap:
- name: otel-collector-conf-istio-monitor
- items:
- - key: otel-collector-config
- path: otel-collector-config.yaml
diff --git a/deploy/platform/kubernetes/feature-istiod-monitor/permissions.yaml b/deploy/platform/kubernetes/feature-istiod-monitor/permissions.yaml
deleted file mode 100644
index 34924f4..0000000
--- a/deploy/platform/kubernetes/feature-istiod-monitor/permissions.yaml
+++ /dev/null
@@ -1,50 +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: ServiceAccount
-metadata:
- name: otel-sa-istio-monitor
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: otel-role-istio-monitor
-rules:
- - apiGroups: [ "" ]
- resources:
- # @feature: istiod-monitor; permissions to read resources
- - "endpoints"
- - "pods"
- - "services"
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: otel-role-binding-istio-monitor
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: otel-role-istio-monitor
-subjects:
- - kind: ServiceAccount
- name: otel-sa-istio-monitor
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-kubernetes-monitor/open-telemetry.yaml b/deploy/platform/kubernetes/feature-kubernetes-monitor/open-telemetry.yaml
deleted file mode 100644
index e352eb9..0000000
--- a/deploy/platform/kubernetes/feature-kubernetes-monitor/open-telemetry.yaml
+++ /dev/null
@@ -1,122 +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.
-#
-
-# @feature: kubernetes-monitor; set OpenTelemetry config to scrape the Kubernetes metrics
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: otel-collector-conf-kubernetes-monitor
- labels:
- app: otel-kubernetes-monitor
-data:
- otel-collector-config: |
- service:
- pipelines:
- metrics:
- receivers: [ prometheus ]
- exporters: [ logging, otlp ]
- exporters:
- otlp:
- endpoint: "oap:11800"
- tls:
- insecure: true
- logging:
- loglevel: debug
- receivers:
- prometheus:
- config:
- scrape_configs:
- # @feature: kubernetes-monitor; configuration to scrape Kubernetes Nodes metrics
- - job_name: 'kubernetes-cadvisor'
- scheme: https
- tls_config:
- ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
- kubernetes_sd_configs:
- - role: node
- relabel_configs:
- - action: labelmap
- regex: __meta_kubernetes_node_label_(.+)
- - source_labels: []
- target_label: cluster
- replacement: skywalking-showcase
- - target_label: __address__
- replacement: kubernetes.default.svc:443
- - source_labels: [__meta_kubernetes_node_name]
- regex: (.+)
- target_label: __metrics_path__
- replacement: /api/v1/nodes/$${1}/proxy/metrics/cadvisor
- - source_labels: [instance]
- separator: ;
- regex: (.+)
- target_label: node
- replacement: $$1
- action: replace
- # @feature: kubernetes-monitor; configuration to scrape Kubernetes Endpoints metrics
- - job_name: kube-state-metrics
- metrics_path: /metrics
- kubernetes_sd_configs:
- - role: endpoints
- relabel_configs:
- - source_labels: [__meta_kubernetes_service_label_app_kubernetes_io_name]
- regex: kube-state-metrics
- replacement: $$1
- action: keep
- - action: labelmap
- regex: __meta_kubernetes_service_label_(.+)
- - source_labels: []
- target_label: cluster
- replacement: skywalking-showcase
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: otel-deployment-kubernetes-monitor
- labels:
- app: otel-kubernetes-monitor
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: otel-kubernetes-monitor
- template:
- metadata:
- labels:
- app: otel-kubernetes-monitor
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: otel-sa-kubernetes-monitor
- containers:
- - name: otel-kubernetes-monitor
- image: otel/opentelemetry-collector:0.50.0
- command:
- - "/otelcol"
- - "--config=/conf/otel-collector-config.yaml"
- volumeMounts:
- - name: otel-collector-config-vol-kubernetes-monitor
- mountPath: /conf
- volumes:
- - name: otel-collector-config-vol-kubernetes-monitor
- configMap:
- name: otel-collector-conf-kubernetes-monitor
- items:
- - key: otel-collector-config
- path: otel-collector-config.yaml
diff --git a/deploy/platform/kubernetes/feature-kubernetes-monitor/permissions.yaml b/deploy/platform/kubernetes/feature-kubernetes-monitor/permissions.yaml
deleted file mode 100644
index 80f9e93..0000000
--- a/deploy/platform/kubernetes/feature-kubernetes-monitor/permissions.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.
-#
----
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: otel-sa-kubernetes-monitor
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: otel-role-kubernetes-monitor
-rules:
- - apiGroups: [ "" ]
- resources:
- # @feature: kubernetes-monitor; permissions to read resources
- - "endpoints"
- - "pods"
- - "services"
- - "nodes"
- - "nodes/metrics"
- - "nodes/proxy"
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: otel-role-binding-kubernetes-monitor
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: otel-role-kubernetes-monitor
-subjects:
- - kind: ServiceAccount
- name: otel-sa-kubernetes-monitor
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-mysql/open-telemetry.yaml b/deploy/platform/kubernetes/feature-mysql/open-telemetry.yaml
deleted file mode 100644
index 8ec063c..0000000
--- a/deploy/platform/kubernetes/feature-mysql/open-telemetry.yaml
+++ /dev/null
@@ -1,102 +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.
-#
-
-# @feature: mysql; set OpenTelemetry config to scrape the mysql metrics
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: otel-collector-conf-mysql
- labels:
- app: otel-mysql
-data:
- otel-collector-config: |
- receivers:
- prometheus:
- config:
- scrape_configs:
- # @feature: mysql; set up the scrape configs according to your mysql instances
- - job_name: 'mysql-monitoring'
- metrics_path: '/metrics'
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - source_labels: [__meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name]
- action: keep
- regex: mysqld-exporter;metrics # @feature: mysql; reference the name of the metrics port
- - source_labels: [__meta_kubernetes_pod_name]
- target_label: host_name
- regex: (.+)
- replacement: $$1
-
- processors:
- batch:
- exporters:
- otlp:
- endpoint: oap:11800
- tls:
- insecure: true
- logging:
- logLevel: debug
- service:
- pipelines:
- metrics:
- receivers:
- - prometheus
- processors:
- - batch
- exporters:
- - otlp
- - logging
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: otel-deployment-mysql
- labels:
- app: otel-mysql
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: otel-mysql
- template:
- metadata:
- labels:
- app: otel-mysql
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: otel-sa-mysql
- containers:
- - name: otel-mysql
- image: otel/opentelemetry-collector:0.50.0
- command:
- - "/otelcol"
- - "--config=/conf/otel-collector-config.yaml"
- volumeMounts:
- - name: otel-collector-config-vol-mysql
- mountPath: /conf
- volumes:
- - name: otel-collector-config-vol-mysql
- configMap:
- name: otel-collector-conf-mysql
- items:
- - key: otel-collector-config
- path: otel-collector-config.yaml
diff --git a/deploy/platform/kubernetes/feature-mysql/permissions.yaml b/deploy/platform/kubernetes/feature-mysql/permissions.yaml
deleted file mode 100644
index d5ed9d4..0000000
--- a/deploy/platform/kubernetes/feature-mysql/permissions.yaml
+++ /dev/null
@@ -1,47 +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: ServiceAccount
-metadata:
- name: otel-sa-mysql
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: otel-role-mysql
-rules:
- - apiGroups: [ "" ]
- resources:
- - "pods"
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: otel-role-binding-mysql
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: otel-role-mysql
-subjects:
- - kind: ServiceAccount
- name: otel-sa-mysql
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-postgresql/open-telemetry.yaml b/deploy/platform/kubernetes/feature-postgresql/open-telemetry.yaml
deleted file mode 100644
index 3a55902..0000000
--- a/deploy/platform/kubernetes/feature-postgresql/open-telemetry.yaml
+++ /dev/null
@@ -1,104 +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.
-#
-
-# @feature: postgresql; set OpenTelemetry config to scrape the psql metrics
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: otel-collector-conf-psql
- labels:
- app: otel-psql
-data:
- otel-collector-config: |
- receivers:
- prometheus:
- config:
- scrape_configs:
- # @feature: postgresql; set up the scrape configs according to your postgresql instances
- - job_name: "postgresql-monitoring"
- metrics_path: '/metrics'
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - source_labels: [__meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name]
- action: keep
- regex: psql-exporter;metrics # @feature: postgresql; reference the name of the metrics port
- - source_labels: [__meta_kubernetes_pod_name]
- target_label: host_name
- regex: (.+)
- replacement: $$1
-
- processors:
- batch:
-
- exporters:
- otlp:
- endpoint: oap:11800
- tls:
- insecure: true
- logging:
- loglevel: debug
-
- service:
- pipelines:
- metrics:
- receivers:
- - prometheus
- processors:
- - batch
- exporters:
- - logging
- - otlp
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: otel-deployment-psql
- labels:
- app: otel-psql
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: otel-psql
- template:
- metadata:
- labels:
- app: otel-psql
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: otel-sa-psql
- containers:
- - name: otel-psql
- image: otel/opentelemetry-collector:0.50.0
- command:
- - "/otelcol"
- - "--config=/conf/otel-collector-config.yaml"
- volumeMounts:
- - name: otel-collector-config-vol-psql
- mountPath: /conf
- volumes:
- - name: otel-collector-config-vol-psql
- configMap:
- name: otel-collector-conf-psql
- items:
- - key: otel-collector-config
- path: otel-collector-config.yaml
diff --git a/deploy/platform/kubernetes/feature-postgresql/permissions.yaml b/deploy/platform/kubernetes/feature-postgresql/permissions.yaml
deleted file mode 100644
index 79d6b41..0000000
--- a/deploy/platform/kubernetes/feature-postgresql/permissions.yaml
+++ /dev/null
@@ -1,47 +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: ServiceAccount
-metadata:
- name: otel-sa-psql
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: otel-role-psql
-rules:
- - apiGroups: [""]
- resources:
- - "pods"
- verbs: ["get", "watch", "list"]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: otel-role-binding-psql
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: otel-role-psql
-subjects:
- - kind: ServiceAccount
- name: otel-sa-psql
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-satellite/permissions.yaml b/deploy/platform/kubernetes/feature-satellite/permissions.yaml
deleted file mode 100644
index 43f90fc..0000000
--- a/deploy/platform/kubernetes/feature-satellite/permissions.yaml
+++ /dev/null
@@ -1,48 +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: ServiceAccount
-metadata:
- name: skywalking-satellite-sa
- namespace: ${NAMESPACE}
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: skywalking-satellite-sa-role
-rules:
- - apiGroups: [ "" ]
- resources:
- - "pods"
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: skywalking-satellite-sa-role-binding
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: skywalking-satellite-sa-role
-subjects:
- - kind: ServiceAccount
- name: skywalking-satellite-sa
- namespace: ${NAMESPACE}
\ No newline at end of file
diff --git a/deploy/platform/kubernetes/feature-satellite/resources.yaml b/deploy/platform/kubernetes/feature-satellite/resources.yaml
deleted file mode 100644
index cad94d9..0000000
--- a/deploy/platform/kubernetes/feature-satellite/resources.yaml
+++ /dev/null
@@ -1,75 +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: satellite
-spec:
- selector:
- app: satellite
- ports:
- - name: grpc
- port: 11800
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: satellite-deployment
- labels:
- app: satellite
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: satellite
- template:
- metadata:
- labels:
- app: satellite
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: skywalking-satellite-sa
- containers:
- - name: satellite
- image: ${SW_SATELLITE_IMAGE}
- imagePullPolicy: Always
- resources:
- limits:
- cpu: 500m
- memory: "512Mi"
- requests:
- cpu: 500m
- memory: "512Mi"
- ports:
- - name: grpc
- containerPort: 11800
- env:
- - name: SATELLITE_GRPC_CLIENT_FINDER
- value: kubernetes
- - name: SATELLITE_GRPC_CLIENT_KUBERNETES_NAMESPACE
- value: ${NAMESPACE}
- - name: SATELLITE_GRPC_CLIENT_KUBERNETES_KIND
- value: pod
- - name: SATELLITE_GRPC_CLIENT_KUBERNETES_SELECTOR_LABEL
- value: app=oap
- - name: SATELLITE_GRPC_CLIENT_KUBERNETES_EXTRA_PORT
- value: "11800"
- - name: SATELLITE_TELEMETRY_EXPORT_TYPE
- value: metrics_service
\ No newline at end of file
diff --git a/deploy/platform/kubernetes/feature-single-node/permissions.yaml b/deploy/platform/kubernetes/feature-single-node/permissions.yaml
deleted file mode 100644
index 4b4148a..0000000
--- a/deploy/platform/kubernetes/feature-single-node/permissions.yaml
+++ /dev/null
@@ -1,52 +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: ServiceAccount
-metadata:
- name: skywalking-oap-sa
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: skywalking-oap-sa-role
-rules:
- - apiGroups: [ "" ]
- resources:
- - "pods" # @feature: als; OAP needs to read pods metadata to analyze the access logs
- - "pods/log" # @feature: on-demand-pod-logs; in feature on demand Pod logs, OAP needs to read pods logs
- - "services" # @feature: als; OAP needs to read services metadata to analyze the access logs
- - "endpoints" # @feature: als; OAP needs to read endpoints metadata to analyze the access logs
- - "nodes" # @feature: als; OAP needs to read nodes metadata to analyze the access logs
- - "configmaps"
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: skywalking-oap-sa-role-binding
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: skywalking-oap-sa-role
-subjects:
- - kind: ServiceAccount
- name: skywalking-oap-sa
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-single-node/resources.yaml b/deploy/platform/kubernetes/feature-single-node/resources.yaml
deleted file mode 100644
index 31c8149..0000000
--- a/deploy/platform/kubernetes/feature-single-node/resources.yaml
+++ /dev/null
@@ -1,221 +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
-data:
- metadata-service-mapping.yaml: |
- serviceName: mesh-svr::${LABELS."service.istio.io/canonical-name",LABELS."app.kubernetes.io/name",LABELS.app}
- serviceInstanceName: ${NAME,NAME} # Just to skip the "envsubst" replacement
- alarm-settings.yml: |
- rules:
- service_resp_time_rule:
- metrics-name: service_resp_time
- threshold: 20 # 20ms is just for demo
- op: ">"
- period: 5
- count: 1
- message: Response time of service {name} is more than 20ms.
-kind: ConfigMap
-metadata:
- name: oap-static-config
-
----
-apiVersion: v1
-data:
- core.default.log4j-xml: |-
- <Configuration status="WARN">
- <Appenders>
- <Console name="Console" target="SYSTEM_OUT">
- <PatternLayout charset="UTF-8" pattern="%d - %c - %L [%t] %-5p %x - %m%n"/>
- </Console>
- </Appenders>
- <Loggers>
- <logger name="io.grpc.netty" level="INFO"/>
- <logger name="org.apache.skywalking.oap.server.configuration.api" level="TRACE"/>
- <logger name="org.apache.skywalking.oap.server.configuration.configmap" level="DEBUG"/>
- <Root level="INFO">
- <AppenderRef ref="Console"/>
- </Root>
- </Loggers>
- </Configuration>
-kind: ConfigMap
-metadata:
- labels:
- app: oap
- name: oap-dynamic-config
-
----
-apiVersion: v1
-kind: Service
-metadata:
- name: oap
-spec:
- selector:
- app: oap
- ports:
- - name: metrics
- port: 1234
- - name: grpc
- port: 11800
- - name: http
- port: 12800
- - name: zipkin-receiver
- port: 9411
- - name: zipkin-query
- port: 9412
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: oap-deployment
- labels:
- app: oap
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: oap
- template:
- metadata:
- labels:
- app: oap
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: skywalking-oap-sa # @feature: als; set a service account with Pods/Endpoints/Services/Nodes permissions to analyze Envoy access logs
- containers:
- - name: oap
- image: ${SW_OAP_IMAGE}
- imagePullPolicy: Always
- resources:
- limits:
- cpu: 4000m
- memory: "4096Mi"
- requests:
- cpu: 1000m
- memory: "1024Mi"
- ports:
- - name: metrics # @feature: so11y; set a name for the metrics port that can be referenced in otel config
- containerPort: 1234
- - name: grpc
- containerPort: 11800
- - name: http
- containerPort: 12800
- - name: zipkin-receiver
- containerPort: 9411
- - name: zipkin-query
- containerPort: 9412
- env:
- - name: SW_CLUSTER_K8S_NAMESPACE
- value: ${NAMESPACE}
- - name: SW_CLUSTER_K8S_LABEL
- value: app=oap
- - name: SW_HEALTH_CHECKER
- value: default
- - name: SW_OTEL_RECEIVER
- value: default # @feature: so11y;mysql;vm;kubernetes-monitor enable OpenTelemetry receiver to receive OpenTelemetry metrics
- - name: SW_OTEL_RECEIVER_ENABLED_OTEL_RULES
- # @feature: vm; enable vm rules to analyze VM metrics
- # @feature: so11y; enable oap rules to analyze OAP metrics
- # @feature: kubernetes-monitor; enable rules to analyze Kubernetes Cluster/Node/Service metrics
- # @feature: istiod-monitor; enable rules to analyze Istio metrics
- # @feature: mysql; enable rules to analyze MySQL metrics
- value: vm,oap,k8s/*,istio-controlplane,mysql/*
- - name: SW_STORAGE
- value: elasticsearch
- - name: SW_STORAGE_ES_CLUSTER_NODES
- value: elasticsearch:9200
- - name: SW_STORAGE_ES_INDEX_REPLICAS_NUMBER
- value: "0"
- - name: SW_TELEMETRY
- value: prometheus # @feature: so11y; expose the metrics of self o11y through prometheus
- - name: SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS
- value: "k8s-mesh,persistence" # @feature: als; enable mesh analyzer (k8s-mesh) to analyze ALS logs
- - name: K8S_SERVICE_NAME_RULE
- value: "mesh-svr::${service.metadata.name}"
- - name: SW_CONFIGURATION
- value: k8s-configmap
- - name: SW_ENABLE_ON_DEMAND_POD_LOG
- value: "true"
- - name: SW_METER_ANALYZER_ACTIVE_FILES
- value: datasource,threadpool,satellite,network-profiling,spring-sleuth
- - name: SW_STORAGE_ES_RESPONSE_TIMEOUT
- value: "50000"
- - name: SW_RECEIVER_ZIPKIN
- value: default
- - name: SW_QUERY_ZIPKIN
- value: default
- volumeMounts:
- - name: config-volume
- mountPath: /skywalking/ext-config
- volumes:
- - name: config-volume
- configMap:
- name: oap-static-config
-
----
-apiVersion: v1
-kind: Service
-metadata:
- name: ui
-spec:
- selector:
- app: ui
- ports:
- - protocol: TCP
- port: 8080
- targetPort: 8080
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: ui-deployment
- labels:
- app: ui
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: ui
- template:
- metadata:
- labels:
- app: ui
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- containers:
- - name: ui
- image: ${SW_UI_IMAGE}
- imagePullPolicy: Always
- ports:
- - containerPort: 8080
- readinessProbe:
- httpGet:
- path: /
- port: 8080
- initialDelaySeconds: 3
- periodSeconds: 3
- failureThreshold: 10
- env:
- - name: SW_OAP_ADDRESS
- value: http://oap:12800
- - name: SW_ZIPKIN_ADDRESS
- value: http://oap:9412
diff --git a/deploy/platform/kubernetes/feature-so11y/open-telemetry.yaml b/deploy/platform/kubernetes/feature-so11y/open-telemetry.yaml
deleted file mode 100644
index afa7832..0000000
--- a/deploy/platform/kubernetes/feature-so11y/open-telemetry.yaml
+++ /dev/null
@@ -1,99 +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.
-#
-
-# @feature: so11y; in Kubernetes, it's better to set service discovery so the OAP instances are not always "localhost:1234"
-
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: otel-collector-conf-so11y
- labels:
- app: opentelemetry-so11y
-data:
- otel-collector-config: |
- receivers:
- prometheus:
- config:
- scrape_configs:
- - job_name: 'skywalking-so11y'
- metrics_path: '/metrics'
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - source_labels: [__meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name]
- action: keep
- regex: oap;metrics # @feature: so11y; reference the name of the metrics port
- - source_labels: []
- target_label: service
- replacement: oap-server
- - source_labels: [__meta_kubernetes_pod_name]
- target_label: host_name
- regex: (.+)
- replacement: $$1
-
- exporters:
- otlp:
- endpoint: "oap:11800"
- tls:
- insecure: true
- logging:
- logLevel: debug
-
- service:
- pipelines:
- metrics:
- receivers: [ prometheus ]
- exporters: [ otlp,logging ]
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: otel-deployment-so11y
- labels:
- app: otel-so11y
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: otel-so11y
- template:
- metadata:
- labels:
- app: otel-so11y
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: otel-sa-so11y
- containers:
- - name: otel
- image: otel/opentelemetry-collector:0.50.0
- command:
- - "/otelcol"
- - "--config=/conf/otel-collector-config.yaml"
- volumeMounts:
- - name: otel-collector-config-vol-so11y
- mountPath: /conf
- volumes:
- - name: otel-collector-config-vol-so11y
- configMap:
- name: otel-collector-conf-so11y
- items:
- - key: otel-collector-config
- path: otel-collector-config.yaml
diff --git a/deploy/platform/kubernetes/feature-so11y/permissions.yaml b/deploy/platform/kubernetes/feature-so11y/permissions.yaml
deleted file mode 100644
index bfdc6e5..0000000
--- a/deploy/platform/kubernetes/feature-so11y/permissions.yaml
+++ /dev/null
@@ -1,47 +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: ServiceAccount
-metadata:
- name: otel-sa-so11y
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: otel-role-so11y
-rules:
- - apiGroups: [ "" ]
- resources:
- - "pods" # @feature: so11y; OpenTelemetry needs to read OAP Pods information to get OAP details
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: otel-role-binding-so11y
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: otel-role-so11y
-subjects:
- - kind: ServiceAccount
- name: otel-sa-so11y
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/feature-vm/open-telemetry.yaml b/deploy/platform/kubernetes/feature-vm/open-telemetry.yaml
deleted file mode 100644
index a1996da..0000000
--- a/deploy/platform/kubernetes/feature-vm/open-telemetry.yaml
+++ /dev/null
@@ -1,96 +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.
-#
-
-# @feature: vm; set OpenTelemetry config to scrape the VM metrics
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: otel-collector-conf-vm
- labels:
- app: otel-vm
-data:
- otel-collector-config: |
- receivers:
- prometheus:
- config:
- scrape_configs:
- # @feature: vm; this is only for demo, in real scenarios the VM addresses should be static, not via service discovery
- - job_name: 'vm-monitoring'
- metrics_path: '/metrics'
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - source_labels: [__meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name]
- action: keep
- regex: vm;metrics # @feature: vm; reference the name of the metrics port
- - source_labels: [__meta_kubernetes_pod_name]
- target_label: host_name
- regex: (.+)
- replacement: $$1
-
- exporters:
- otlp:
- endpoint: "oap:11800"
- tls:
- insecure: true
- logging:
- logLevel: debug
-
- service:
- pipelines:
- metrics:
- receivers: [ prometheus ]
- exporters: [ otlp,logging ]
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: otel-deployment-vm
- labels:
- app: otel-vm
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: otel-vm
- template:
- metadata:
- labels:
- app: otel-vm
- annotations:
- sidecar.istio.io/inject: "false"
- spec:
- serviceAccountName: otel-sa-vm
- containers:
- - name: otel-vm
- image: otel/opentelemetry-collector:0.50.0
- command:
- - "/otelcol"
- - "--config=/conf/otel-collector-config.yaml"
- volumeMounts:
- - name: otel-collector-config-vol-vm
- mountPath: /conf
- volumes:
- - name: otel-collector-config-vol-vm
- configMap:
- name: otel-collector-conf-vm
- items:
- - key: otel-collector-config
- path: otel-collector-config.yaml
diff --git a/deploy/platform/kubernetes/feature-vm/permissions.yaml b/deploy/platform/kubernetes/feature-vm/permissions.yaml
deleted file mode 100644
index 02fb039..0000000
--- a/deploy/platform/kubernetes/feature-vm/permissions.yaml
+++ /dev/null
@@ -1,47 +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: ServiceAccount
-metadata:
- name: otel-sa-vm
-
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: otel-role-vm
-rules:
- - apiGroups: [ "" ]
- resources:
- - "pods"
- verbs: [ "get", "watch", "list" ]
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: otel-role-binding-vm
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: otel-role-vm
-subjects:
- - kind: ServiceAccount
- name: otel-sa-vm
- namespace: ${NAMESPACE}
diff --git a/deploy/platform/kubernetes/features.mk b/deploy/platform/kubernetes/features.mk
deleted file mode 100644
index 159fccb..0000000
--- a/deploy/platform/kubernetes/features.mk
+++ /dev/null
@@ -1,173 +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.
-#
-
-# This file contains the targets to deploy features that are not
-# applicable to deploy via manifest, we can deploy them via command
-# line interface here, for better maintainability.
-
-include ../../../Makefile.in
-
-.PHONY: istioctl
-istioctl:
- @istioctl version >/dev/null 2>&1 || (echo "No istioctl in PATH, please make sure istioctl is available in PATH."; exit 1)
-
-.PHONY: istio
-istio: istioctl
- @istioctl install -y --set profile=demo \
- --set meshConfig.enableEnvoyAccessLogService=true `# @feature: als; enable Envoy access log service` \
- `# @feature: als; be careful to only emit wanted metrics otherwise the traffic is HUGE` \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[0]=.*membership_healthy.*' \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[1]=.*upstream_cx_active.*' \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[2]=.*upstream_cx_total.*' \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[3]=.*upstream_rq_active.*' \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[4]=.*upstream_rq_total.*' \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[5]=.*upstream_rq_pending_active.*' \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[6]=.*lb_healthy_panic.*' \
- --set 'meshConfig.defaultConfig.proxyStatsMatcher.inclusionRegexps[7]=.*upstream_cx_none_healthy.*' \
- --set meshConfig.defaultConfig.envoyMetricsService.address=$(BACKEND_SERVICE).$(NAMESPACE):11800 `# @feature: als; set MetricsService address to Backend Service so Envoy emits metrics to Backend Service` \
- --set meshConfig.defaultConfig.envoyAccessLogService.address=$(BACKEND_SERVICE).$(NAMESPACE):11800 `# @feature: als; set AccessLogService address to Backend Service so Envoy emits logs to Backend Service` \
- --set meshConfig.defaultConfig.tracing.sampling=100 \
- --set meshConfig.defaultConfig.tracing.zipkin.address=oap.$(NAMESPACE).svc.cluster.local:9411 \
- --set meshConfig.enableTracing=true
-
-.PHONY: namespace
-namespace:
- @kubectl get namespace $(NAMESPACE)-agentless > /dev/null 2>&1 || kubectl create namespace $(NAMESPACE)-agentless
- @kubectl label namespace --overwrite $(NAMESPACE)-agentless istio-injection=enabled # @feature: als; label the namespace to allow Istio sidecar injection
-
-.PHONY: prerequisites
-prerequisites: istio namespace
-
-feature-als:
-
-.PHONY: deploy.feature-als
-deploy.feature-als: prerequisites
- $(MAKE) deploy FEATURE_FLAGS=agent TAG=$(TAG)-agentless NAMESPACE=$(NAMESPACE)-agentless AGENTLESS=true SHOW_TIPS=false
-
-.PHONY: undeploy.feature-als
-undeploy.feature-als: istioctl
- $(eval TAG := $(TAG)-agentless)
- $(MAKE) undeploy FEATURE_FLAGS=agent TAG=$(TAG)-agentless NAMESPACE=$(NAMESPACE)-agentless AGENTLESS=true
- istioctl x uninstall --purge -y
-
-.PHONY: feature-mesh-with-agent
-feature-mesh-with-agent:
-
-.PHONY: deploy.feature-mesh-with-agent
-deploy.feature-mesh-with-agent: prerequisites install-cert-manager
- @curl -Ls https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl apply -f -
- @kubectl label namespace --overwrite $(NAMESPACE) swck-injection=enabled
- @kubectl get configmap skywalking-swck-java-agent-configmap -n skywalking-swck-system -oyaml | sed "s/127.0.0.1/$(NAMESPACE)-$(BACKEND_SERVICE).$(NAMESPACE)/" | kubectl apply -f -
- @kubectl label namespace --overwrite $(NAMESPACE) istio-injection=enabled
- $(MAKE) deploy FEATURE_FLAGS=agent TAG=$(TAG) NAMESPACE=$(NAMESPACE) AGENTLESS=true SHOW_TIPS=false
-
-.PHONY: undeploy.feature-mesh-with-agent
-undeploy.feature-mesh-with-agent: istioctl
- @curl -Ls https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl delete --ignore-not-found -f -
- @kubectl delete --ignore-not-found -f https://github.com/jetstack/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml
- $(MAKE) undeploy FEATURE_FLAGS=agent TAG=$(TAG) NAMESPACE=$(NAMESPACE) AGENTLESS=true
- istioctl x uninstall --purge -y
-
-# @feature: kubernetes-monitor; extra resources to install for kubernetes monitoring, standard kube-state-metrics
-.PHONY: feature-kubernetes-monitor
-feature-kubernetes-monitor:
-
-.PHONY: deploy.feature-kubernetes-monitor
-deploy.feature-kubernetes-monitor:
- @kubectl apply -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/service-account.yaml
- @kubectl apply -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/cluster-role.yaml
- @kubectl apply -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/cluster-role-binding.yaml
- @kubectl apply -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/service.yaml
- @kubectl apply -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/deployment.yaml
-
-.PHONY: undeploy.feature-kubernetes-monitor
-undeploy.feature-kubernetes-monitor:
- @kubectl delete --ignore-not-found -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/service-account.yaml
- @kubectl delete --ignore-not-found -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/cluster-role.yaml
- @kubectl delete --ignore-not-found -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/cluster-role-binding.yaml
- @kubectl delete --ignore-not-found -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/service.yaml
- @kubectl delete --ignore-not-found -f https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.2.4/examples/standard/deployment.yaml
-
-# @feature: java-agent-injector; use the java agent injector to inject the java agent more natively
-.PHONY: feature-java-agent-injector
-feature-java-agent-injector:
-
-# @feature: java-agent-injector; the swck operator depends on the certificate management of the cert-manager
-.PHONY: install-cert-manager
-install-cert-manager:
- @kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml
- @sh ../../../scripts/wait-cert-manager-ready.sh
-
-# @feature: java-agent-injector; the java agent injector is a component of the swck operator, so we need to deploy the swck operator firstly
-.PHONY: deploy.feature-java-agent-injector
-deploy.feature-java-agent-injector: install-cert-manager
- @curl -Ls https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl apply -f -
- @kubectl label namespace --overwrite $(NAMESPACE) swck-injection=enabled
- # @feature: java-agent-injector; we can update the agent's backend address in a single-node cluster firstly so that we don't need to add the same backend env for every java agent
- @kubectl get configmap skywalking-swck-java-agent-configmap -n skywalking-swck-system -oyaml | sed "s/127.0.0.1/$(NAMESPACE)-$(BACKEND_SERVICE).$(NAMESPACE)/" | kubectl apply -f -
- $(MAKE) deploy FEATURE_FLAGS=agent AGENTLESS=false SHOW_TIPS=false BACKEND_SERVICE=$(BACKEND_SERVICE)
-
-# @feature: java-agent-injector; uninstall the swck operator and cert-manager
-.PHONY: undeploy.feature-java-agent-injector
-undeploy.feature-java-agent-injector:
- @curl -Ls https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl delete --ignore-not-found -f -
- @kubectl delete --ignore-not-found -f https://github.com/jetstack/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml
- $(MAKE) undeploy FEATURE_FLAGS=agent AGENTLESS=false SHOW_TIPS=false BACKEND_SERVICE=$(BACKEND_SERVICE)
-
-.PHONY: helm
-helm:
- @helm version >/dev/null 2>&1 || (echo "No helm in PATH, please make sure helm is available in PATH."; exit 1)
-
-.PHONY: open-function
-open-function: helm
- @helm repo add openfunction https://openfunction.github.io/charts/
- @helm repo update
- @helm upgrade openfunction openfunction/openfunction -n openfunction --version 0.3.1 --install --create-namespace \
- --set global.ShipwrightBuild.enabled=false \
- --set global.TektonPipelines.enabled=false \
- --set global.Keda.enabled=false \
- --set global.Dapr.enabled=false \
- --set contour.envoy.useHostPort=false \
- --set contour.envoy.service.type=ClusterIP \
- --set contour.envoy.service.externalTrafficPolicy="" \
- --wait
-
-# @feature: function; install open function resources
-.PHONY: deploy.feature-function
-deploy.feature-function: open-function
- @echo "deploy.feature-function"
-
-.PHONY: feature-function
-feature-function:
-
-.PHONY: undeploy.feature-function
-undeploy.feature-function: helm
- @helm uninstall openfunction -n openfunction --timeout 20m || kubectl delete namespace openfunction --ignore-not-found --timeout 20m || true
-
-# @feature: promql; extra configmaps to create for grafana dashboards
-.PHONY: feature-promql
-feature-promql:
-dashboards := $(wildcard ../config/promql/dashboards/*.json)
-
-.PHONY: deploy.feature-promql
-deploy.feature-promql:
- @$(foreach d, $(dashboards), kubectl create configmap grafana-dashboards-$(basename $(notdir $d)) --from-file=$d;)
-
-.PHONY: undeploy.feature-promql
-undeploy.feature-promql:
- @$(foreach d, $(dashboards), kubectl delete configmap grafana-dashboards-$(basename $(notdir $d)) --ignore-not-found;)
diff --git a/deploy/platform/kubernetes/templates/NOTES.txt b/deploy/platform/kubernetes/templates/NOTES.txt
new file mode 100644
index 0000000..7c13563
--- /dev/null
+++ b/deploy/platform/kubernetes/templates/NOTES.txt
@@ -0,0 +1,56 @@
+{{/*
+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.
+*/}}
+
+*************************************************************************
+* *
+* SkyWalking Showcase *
+* *
+*************************************************************************
+
+Thank you for installing {{ .Chart.Name }}.
+
+Your release is named {{ .Release.Name }}.
+
+Get the UI URL by running these commands:
+{{- if index .Values "skywalking-helm" "ui" "ingress" "enabled" }}
+{{- range index .Values "skywalking-helm" "ui" "ingress" "hosts" }}
+ http{{ if index $.Values "ui" "ingress" "tls" }}s{{ end }}://{{ . }}{{ index $.Values "ui" "ingress" "path" }}
+{{- end }}
+{{- else if contains "NodePort" (index .Values "skywalking-helm" "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" (index .Values "skywalking-helm" "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:{{ index .Values "skywalking-helm" "ui" "service" "externalPort" }}
+{{- else if contains "ClusterIP" (index .Values "skywalking-helm" "ui" "service" "type") }}
+ echo "Visit http://127.0.0.1:8080 to use your application"
+ kubectl port-forward svc/{{ printf "%s-skywalking-helm-ui" .Release.Name }} 8080:{{ index .Values "skywalking-helm" "ui" "service" "externalPort" }} --namespace {{ .Release.Namespace }}
+{{- end }}
+
+{{- if index .Values "skywalking-helm" "elasticsearch" "enabled" }}
+{{- if index .Values "skywalking-helm" "elasticsearch" "persistence" "enabled" }}
+{{- else }}
+#################################################################################
+###### WARNING: Persistence is disabled!!! You will lose your data when #####
+###### the SkyWalking's storage ES pod is terminated. #####
+#################################################################################
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/templates/_helpers.tpl b/deploy/platform/kubernetes/templates/_helpers.tpl
new file mode 100644
index 0000000..71044fa
--- /dev/null
+++ b/deploy/platform/kubernetes/templates/_helpers.tpl
@@ -0,0 +1,39 @@
+{{/*
+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.
+*/}}
+
+{{/*
+The collector address, might be OAP or Satellite
+*/}}
+{{- define "skywalking.collector.address" -}}
+{{- if index .Values "skywalking-helm" "satellite" "enabled" }}
+{{- printf "%s-satellite.%s.svc.cluster.local:%d" (index .Values "skywalking-helm" "fullnameOverride") .Release.Namespace 11800 }}
+{{- else }}
+{{- printf "%s-oap.%s.svc.cluster.local:%d" (index .Values "skywalking-helm" "fullnameOverride") .Release.Namespace 11800 }}
+{{- end -}}
+{{- end -}}
+
+{{- define "skywalking.oap.address.host" -}}
+{{- printf "%s-oap.%s.svc.cluster.local" (index .Values "skywalking-helm" "fullnameOverride") .Release.Namespace }}
+{{- end -}}
+
+{{- define "skywalking.oap.address.grpc" -}}
+{{- printf "%s-oap.%s.svc.cluster.local:%d" (index .Values "skywalking-helm" "fullnameOverride") .Release.Namespace 11800 }}
+{{- end -}}
+
+{{- define "skywalking.oap.address.http" -}}
+{{- printf "http://%s-oap.%s.svc.cluster.local:%d" (index .Values "skywalking-helm" "fullnameOverride") .Release.Namespace 12800 }}
+{{- end -}}
diff --git a/deploy/platform/kubernetes/feature-agent/resources.yaml b/deploy/platform/kubernetes/templates/feature-agent/resources.yaml
similarity index 63%
rename from deploy/platform/kubernetes/feature-agent/resources.yaml
rename to deploy/platform/kubernetes/templates/feature-agent/resources.yaml
index f62f5bc..868891d 100644
--- a/deploy/platform/kubernetes/feature-agent/resources.yaml
+++ b/deploy/platform/kubernetes/templates/feature-agent/resources.yaml
@@ -15,12 +15,27 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if or .Values.features.agent.enabled .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}
+
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: {{ .Values.sampleServices.namespace }}
+ labels:
+ {{- if .Values.features.javaAgentInjector.enabled }}
+ swck-injection: enabled
+ {{- end }}
+ {{- if or .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}
+ istio-injection: enabled
+ {{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: gateway
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
selector:
app: gateway
@@ -34,6 +49,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway-deployment
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: gateway
spec:
@@ -48,17 +64,22 @@ spec:
swck-java-agent-injected: "true"
app: gateway
annotations:
- sidecar.istio.io/inject: "${AGENTLESS}"
+ sidecar.istio.io/inject: "{{ or .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}"
# @feature: java-agent-injector; set the java agent configuration
strategy.skywalking.apache.org/inject.Container: "gateway"
strategy.skywalking.apache.org/agent.Overlay: "true"
agent.skywalking.apache.org/agent.service_name: "agent::gateway"
optional.skywalking.apache.org: "spring-cloud-gateway-3.x"
- sidecar.skywalking.apache.org/initcontainer.Image: "${SW_AGENT_JAVA_IMAGE}"
+ sidecar.skywalking.apache.org/initcontainer.Image: "{{ .Values.features.javaAgentInjector.agentImage }}"
spec:
containers:
- name: gateway
- image: ${HUB}/gateway-service:${TAG}
+ {{- if .Values.features.javaAgentInjector.enabled }}
+ # @feature: java-agent-injector; if the java agent injector is enabled, we use the agentless image and let the injector inject the agent.
+ image: "{{ .Values.sampleServices.hub }}/gateway-service:{{ .Values.sampleServices.tag }}-agentless"
+ {{- else }}
+ image: "{{ .Values.sampleServices.hub }}/gateway-service:{{ .Values.sampleServices.tag }}"
+ {{- end }}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
@@ -67,13 +88,14 @@ spec:
- name: SW_AGENT_NAME
value: agent::gateway
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
- value: ${BACKEND_SERVICE}:11800
+ value: {{ template "skywalking.collector.address" . }}
---
apiVersion: v1
kind: Service
metadata:
name: songs
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
selector:
app: songs
@@ -87,6 +109,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: songs-deployment
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: songs
spec:
@@ -101,36 +124,42 @@ spec:
swck-java-agent-injected: "true"
app: songs
annotations:
- sidecar.istio.io/inject: "${AGENTLESS}"
+ sidecar.istio.io/inject: "{{ or .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}"
# @feature: java-agent-injector; set the java agent configuration
strategy.skywalking.apache.org/inject.Container: "songs"
strategy.skywalking.apache.org/agent.Overlay: "true"
agent.skywalking.apache.org/agent.service_name: "agent::songs"
optional.skywalking.apache.org: "guava-cache-plugin"
- sidecar.skywalking.apache.org/initcontainer.Image: "${SW_AGENT_JAVA_IMAGE}"
+ sidecar.skywalking.apache.org/initcontainer.Image: "{{ .Values.features.javaAgentInjector.agentImage }}"
spec:
containers:
- name: songs
- image: ${HUB}/songs-service:${TAG}
+ {{- if .Values.features.javaAgentInjector.enabled }}
+ # @feature: java-agent-injector; if the java agent injector is enabled, we use the agentless image and let the injector inject the agent.
+ image: "{{ .Values.sampleServices.hub }}/songs-service:{{ .Values.sampleServices.tag }}-agentless"
+ {{- else }}
+ image: "{{ .Values.sampleServices.hub }}/songs-service:{{ .Values.sampleServices.tag }}"
+ {{- end }}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
- # @feature: agent; set env to configure java agent, If we use injector, we don't need to set env, only to configure java gent through annotation
+ # @feature: agent; set env to configure java agent, If we use injector, we don't need to set env, only need to configure java agent through annotation
env:
- name: SW_AGENT_NAME
value: agent::songs
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
- value: ${BACKEND_SERVICE}:11800
+ value: {{ template "skywalking.collector.address" . }}
- name: ACTIVE_MQ_URL
value: tcp://activemq:61616
- name: ACTIVE_MQ_QUEUE
- value: queue-songs-ping
+ value: queue-songs-ping
---
apiVersion: v1
kind: Service
metadata:
name: rcmd
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
selector:
app: recommendation
@@ -144,6 +173,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: recommendation-deployment
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: recommendation
spec:
@@ -156,11 +186,11 @@ spec:
labels:
app: recommendation
annotations:
- sidecar.istio.io/inject: "${AGENTLESS}"
+ sidecar.istio.io/inject: "{{ or .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}"
spec:
containers:
- name: recommendation
- image: ${HUB}/recommendation-service:${TAG}
+ image: "{{ .Values.sampleServices.hub }}/recommendation-service:{{ .Values.sampleServices.tag }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
@@ -168,13 +198,14 @@ spec:
- name: SW_AGENT_NAME
value: agent::recommendation
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
- value: ${BACKEND_SERVICE}:11800
+ value: {{ template "skywalking.collector.address" . }}
---
apiVersion: v1
kind: Service
metadata:
name: app
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
selector:
app: app
@@ -188,6 +219,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: app
spec:
@@ -200,11 +232,11 @@ spec:
labels:
app: app
annotations:
- sidecar.istio.io/inject: "${AGENTLESS}"
+ sidecar.istio.io/inject: "{{ or .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}"
spec:
containers:
- name: app
- image: ${HUB}/app:${TAG}
+ image: "{{ .Values.sampleServices.hub }}/app:{{ .Values.sampleServices.tag }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
@@ -214,13 +246,14 @@ spec:
- name: REACT_APP_SW_AGENT_NAME_UI
value: agent::ui
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
- value: ${BACKEND_SERVICE}:11800
+ value: {{ template "skywalking.collector.address" . }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: loadgen-deployment
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: loadgen
spec:
@@ -233,11 +266,11 @@ spec:
labels:
app: loadgen
annotations:
- sidecar.istio.io/inject: "${AGENTLESS}"
+ sidecar.istio.io/inject: "{{ or .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}"
spec:
containers:
- name: app
- image: ${HUB}/load-gen:${TAG}
+ image: "{{ .Values.sampleServices.hub }}/load-gen:{{ .Values.sampleServices.tag }}"
imagePullPolicy: IfNotPresent
---
@@ -245,6 +278,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: apisix-config
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: apisix-config
data:
@@ -258,16 +292,16 @@ data:
service_id: 2
plugins:
skywalking:
- service_name: "${{SW_AGENT_SERVICE}}"
- service_instance_name: "${{SW_AGENT_SERVICE_INSTANCE}}"
- endpoint_addr: http://oap:12800
+ service_name: ${{ "{{" }}SW_AGENT_SERVICE{{ "}}" }}
+ service_instance_name: ${{ "{{" }}SW_AGENT_SERVICE_INSTANCE{{ "}}" }}
+ endpoint_addr: {{ template "skywalking.oap.address.http" . }}
- uri: /test
service_id: 2
plugins:
skywalking:
- service_name: "${{SW_AGENT_SERVICE}}"
- service_instance_name: "${{SW_AGENT_SERVICE_INSTANCE}}"
- endpoint_addr: http://oap:12800
+ service_name: ${{"{{"}}SW_AGENT_SERVICE{{"}}"}}
+ service_instance_name: ${{"{{"}}SW_AGENT_SERVICE_INSTANCE{{"}}"}}
+ endpoint_addr: {{ template "skywalking.oap.address.http" . }}
services:
- id: 1
upstream_id: 1
@@ -277,7 +311,7 @@ data:
upstreams:
- id: 1
nodes:
- "oap:12800": 1
+ "{{ template "skywalking.oap.address.host" . }}:12800": 1
type: roundrobin
- id: 2
nodes:
@@ -304,9 +338,9 @@ data:
ip: "0.0.0.0"
port: 9091
skywalking:
- service_name: "${{SW_AGENT_SERVICE}}"
- service_instance_name: "${{SW_AGENT_SERVICE_INSTANCE}}"
- endpoint_addr: http://oap:12800
+ service_name: ${{"{{"}}SW_AGENT_SERVICE{{"}}"}}
+ service_instance_name: ${{"{{"}}SW_AGENT_SERVICE_INSTANCE{{"}}"}}
+ endpoint_addr: {{ template "skywalking.oap.address.http" . }}
plugins:
- prometheus
- skywalking
@@ -321,6 +355,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend-deployment
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: frontend
spec:
@@ -333,11 +368,11 @@ spec:
labels:
app: frontend
annotations:
- sidecar.istio.io/inject: "${AGENTLESS}"
+ sidecar.istio.io/inject: "{{ or .Values.features.als.enabled .Values.features.istiodMonitor.enabled .Values.features.meshWithAgent }}"
spec:
containers:
- name: frontend
- image: ${HUB}/frontend:${TAG}
+ image: "{{ .Values.sampleServices.hub }}/frontend:{{ .Values.sampleServices.tag }}"
imagePullPolicy: IfNotPresent
resources:
limits:
@@ -349,11 +384,11 @@ spec:
ports:
- containerPort: 80
name: http
- - containerPort: 9091 # APISIX Prometheus pulgin port
+ - containerPort: 9091 # APISIX Prometheus plugin port
name: metrics
env:
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
- value: ${BACKEND_SERVICE}:11800
+ value: {{ template "skywalking.collector.address" . }}
- name: SW_SERVICE_INSTANCE
valueFrom:
fieldRef:
@@ -374,6 +409,7 @@ apiVersion: v1
kind: Service
metadata:
name: frontend
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
selector:
app: frontend
@@ -387,6 +423,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: activemq-deployment
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: activemq
spec:
@@ -418,10 +455,13 @@ apiVersion: v1
kind: Service
metadata:
name: activemq
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
selector:
app: activemq
ports:
- protocol: TCP
port: 61616
- targetPort: 61616
\ No newline at end of file
+ targetPort: 61616
+
+{{- end }}
diff --git a/.gitignore b/deploy/platform/kubernetes/templates/feature-apisix-monitor/opentelemetry-config.yaml
similarity index 53%
copy from .gitignore
copy to deploy/platform/kubernetes/templates/feature-apisix-monitor/opentelemetry-config.yaml
index 6388ee9..edbfc51 100644
--- a/.gitignore
+++ b/deploy/platform/kubernetes/templates/feature-apisix-monitor/opentelemetry-config.yaml
@@ -15,48 +15,25 @@
# specific language governing permissions and limitations
# under the License.
#
-# Ignore Gradle project-specific cache directory
-.gradle
-# Ignore Gradle build output directory
-build
-
-venv
-
-.DS_Store
-
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
+{{- define "opentelemetry-config-apisix" }}
+{{- if .Values.features.apisixMonitor.enabled }}
+
+- job_name: 'apisix-monitoring'
+ scrape_interval: 5s
+ metrics_path: "/apisix/prometheus/metrics"
+ kubernetes_sd_configs:
+ - role: pod
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name ]
+ action: keep
+ regex: frontend;metrics # @feature: apisix-monitor; reference the name of the metrics port
+ - source_labels: [ __meta_kubernetes_pod_name ]
+ target_label: service_instance_id
+ regex: (.+)
+ replacement: $$1
+ - target_label: skywalking_service
+ replacement: frontend
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-event/permissions.yaml b/deploy/platform/kubernetes/templates/feature-event/permissions.yaml
similarity index 92%
rename from deploy/platform/kubernetes/feature-event/permissions.yaml
rename to deploy/platform/kubernetes/templates/feature-event/permissions.yaml
index 616661f..c06e465 100644
--- a/deploy/platform/kubernetes/feature-event/permissions.yaml
+++ b/deploy/platform/kubernetes/templates/feature-event/permissions.yaml
@@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.
#
+
+{{- if .Values.features.event.enabled }}
---
apiVersion: v1
kind: ServiceAccount
@@ -32,5 +34,6 @@ roleRef:
name: view
subjects:
- kind: ServiceAccount
- namespace: ${NAMESPACE}
+ namespace: {{ .Release.Namespace }}
name: skywalking-event-exporter-sa
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-event/resources.yaml b/deploy/platform/kubernetes/templates/feature-event/resources.yaml
similarity index 60%
rename from deploy/platform/kubernetes/feature-event/resources.yaml
rename to deploy/platform/kubernetes/templates/feature-event/resources.yaml
index c7e5065..8c87b64 100644
--- a/deploy/platform/kubernetes/feature-event/resources.yaml
+++ b/deploy/platform/kubernetes/templates/feature-event/resources.yaml
@@ -15,35 +15,17 @@
# specific language governing permissions and limitations
# under the License.
#
-#
-# 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.features.event.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: skywalking-event-exporter-cm
- namespace: ${NAMESPACE}
data:
config.yaml: |
filters:
- - namespace: ${NAMESPACE}
+ - namespace: {{ .Release.Namespace }}
exporters:
- skywalking
@@ -51,18 +33,17 @@ data:
skywalking:
template:
source:
- service: "agent::{{ .Service.Name }}"
- serviceInstance: "{{ .Pod.Name }}"
+ service: "agent::{{"{{"}} .Service.Name {{"}}"}}"
+ serviceInstance: "{{"{{"}} .Pod.Name {{"}}"}}"
endpoint: ""
- message: "{{ .Event.Message }}"
- address: "oap:11800"
+ message: "{{"{{"}} .Event.Message {{"}}"}}"
+ address: "{{ .Release.Name }}-skywalking-helm:11800"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: skywalking-event-exporter-deployment
- namespace: ${NAMESPACE}
spec:
replicas: 1
template:
@@ -73,8 +54,8 @@ spec:
serviceAccountName: skywalking-event-exporter-sa
containers:
- name: skywalking-event-exporter
- image: ${SW_EVENT_EXPORTER_IMAGE}
- imagePullPolicy: Always
+ image: "{{ .Values.features.event.exporter.image }}"
+ imagePullPolicy: IfNotPresent
args:
- start
- -v=debug
@@ -89,3 +70,4 @@ spec:
selector:
matchLabels:
app: skywalking-event-exporter
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-event/scaler.yaml b/deploy/platform/kubernetes/templates/feature-event/scaler.yaml
similarity index 80%
rename from deploy/platform/kubernetes/feature-event/scaler.yaml
rename to deploy/platform/kubernetes/templates/feature-event/scaler.yaml
index 03cd3a3..b991aa4 100644
--- a/deploy/platform/kubernetes/feature-event/scaler.yaml
+++ b/deploy/platform/kubernetes/templates/feature-event/scaler.yaml
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.event.enabled }}
---
# @feature: event; a cron job to mimic the restart of Pods
@@ -22,6 +23,7 @@ kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: event-role
+ namespace: {{ .Values.sampleServices.namespace }}
rules:
- apiGroups:
- ""
@@ -37,6 +39,7 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: event-role-binding
+ namespace: {{ .Values.sampleServices.namespace }}
subjects:
- kind: ServiceAccount
name: event-scaler-sa
@@ -50,12 +53,14 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: event-scaler-sa
+ namespace: {{ .Values.sampleServices.namespace }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: event-scale-up
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
schedule: "0,10,20,30,40,50 * * * *"
successfulJobsHistoryLimit: 1
@@ -74,7 +79,7 @@ spec:
command:
- sh
- -c
- - kubectl -n ${NAMESPACE} scale deployment songs-deployment gateway-deployment app-deployment --replicas=2
+ - kubectl -n {{ .Values.sampleServices.namespace }} scale deployment songs-deployment gateway-deployment app-deployment --replicas=2
restartPolicy: Never
---
@@ -82,6 +87,7 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: event-scale-down
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
schedule: "5,15,25,35,45,55 * * * *"
successfulJobsHistoryLimit: 1
@@ -100,5 +106,6 @@ spec:
command:
- sh
- -c
- - kubectl -n ${NAMESPACE} scale deployment songs-deployment gateway-deployment app-deployment --replicas=1
+ - kubectl -n {{ .Values.sampleServices.namespace }} scale deployment songs-deployment gateway-deployment app-deployment --replicas=1
restartPolicy: Never
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-function/resource.yaml b/deploy/platform/kubernetes/templates/feature-function/resource.yaml
similarity index 81%
rename from deploy/platform/kubernetes/feature-function/resource.yaml
rename to deploy/platform/kubernetes/templates/feature-function/resource.yaml
index c70b13c..af182b4 100644
--- a/deploy/platform/kubernetes/feature-function/resource.yaml
+++ b/deploy/platform/kubernetes/templates/feature-function/resource.yaml
@@ -15,6 +15,9 @@
# specific language governing permissions and limitations
# under the License.
#
+
+{{- if .Values.features.function.enabled }}
+
---
apiVersion: apps/v1
kind: Deployment
@@ -34,11 +37,11 @@ spec:
spec:
containers:
- name: app
- image: ${HUB}/function-load-gen:${TAG}
+ image: "{{ .Values.sampleServices.hub }}/function-load-gen:{{ .Values.sampleServices.tag }}"
imagePullPolicy: IfNotPresent
env:
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
- value: ${BACKEND_SERVICE}:11800
+ value: {{ template "skywalking.collector.address" . }}
- name: URL
value: http://function.default.svc.cluster.local/World
- name: SW_AGENT_LAYER
@@ -53,10 +56,10 @@ metadata:
enabled: true
provider:
name: "skywalking"
- oapServer: ${BACKEND_SERVICE}:11800
+ oapServer: {{ template "skywalking.collector.address" . }}
spec:
version: "v2.0.0"
- image: ${HUB}/function:${TAG}
+ image: {{ .Values.sampleServices.hub }}/function:{{ .Values.sampleServices.tag }}
port: 8080
serving:
template:
@@ -64,3 +67,5 @@ spec:
- name: function
imagePullPolicy: IfNotPresent
runtime: "knative"
+
+{{- end }}
diff --git a/.gitignore b/deploy/platform/kubernetes/templates/feature-istiod-monitor/opentelemetry-config.yaml
similarity index 56%
copy from .gitignore
copy to deploy/platform/kubernetes/templates/feature-istiod-monitor/opentelemetry-config.yaml
index 6388ee9..2f85217 100644
--- a/.gitignore
+++ b/deploy/platform/kubernetes/templates/feature-istiod-monitor/opentelemetry-config.yaml
@@ -15,48 +15,22 @@
# specific language governing permissions and limitations
# under the License.
#
-# Ignore Gradle project-specific cache directory
-.gradle
-
-# Ignore Gradle build output directory
-build
-
-venv
-
-.DS_Store
-
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
+{{- define "opentelemetry-config-istiod-monitor" -}}
+{{- if .Values.features.istiodMonitor.enabled }}
+
+# @feature: istiod-monitor; configuration to scrape Istio control plane metrics
+- job_name: 'istiod-monitor'
+ kubernetes_sd_configs:
+ - role: endpoints
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name ]
+ action: keep
+ regex: istiod;http-monitoring
+ - action: labelmap
+ regex: __meta_kubernetes_service_label_(.+)
+ - source_labels: [ ]
+ target_label: cluster
+ replacement: skywalking-showcase
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/templates/feature-kubernetes-monitor/opentelemetry-config.yaml b/deploy/platform/kubernetes/templates/feature-kubernetes-monitor/opentelemetry-config.yaml
new file mode 100644
index 0000000..6d878a6
--- /dev/null
+++ b/deploy/platform/kubernetes/templates/feature-kubernetes-monitor/opentelemetry-config.yaml
@@ -0,0 +1,65 @@
+# 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.
+#
+{{- define "opentelemetry-config-kubernetes-monitor" }}
+{{- if .Values.features.kubernetesMonitor.enabled }}
+
+# @feature: kubernetes-monitor; set OpenTelemetry config to scrape the Kubernetes metrics
+# @feature: kubernetes-monitor; configuration to scrape Kubernetes Nodes metrics
+- job_name: 'kubernetes-cadvisor'
+ scheme: https
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+ kubernetes_sd_configs:
+ - role: node
+ relabel_configs:
+ - action: labelmap
+ regex: __meta_kubernetes_node_label_(.+)
+ - source_labels: [ ]
+ target_label: cluster
+ replacement: skywalking-showcase
+ - target_label: __address__
+ replacement: kubernetes.default.svc:443
+ - source_labels: [ __meta_kubernetes_node_name ]
+ regex: (.+)
+ target_label: __metrics_path__
+ replacement: /api/v1/nodes/$${1}/proxy/metrics/cadvisor
+ - source_labels: [ instance ]
+ separator: ;
+ regex: (.+)
+ target_label: node
+ replacement: $$1
+ action: replace
+# @feature: kubernetes-monitor; configuration to scrape Kubernetes Endpoints metrics
+- job_name: kube-state-metrics
+ metrics_path: /metrics
+ kubernetes_sd_configs:
+ - role: endpoints
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_service_label_app_kubernetes_io_name ]
+ regex: kube-state-metrics
+ replacement: $$1
+ action: keep
+ - action: labelmap
+ regex: __meta_kubernetes_service_label_(.+)
+ - source_labels: [ ]
+ target_label: cluster
+ replacement: skywalking-showcase
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-mysql/fluent-bit.yaml b/deploy/platform/kubernetes/templates/feature-mysql-monitor/fluent-bit.yaml
similarity index 97%
rename from deploy/platform/kubernetes/feature-mysql/fluent-bit.yaml
rename to deploy/platform/kubernetes/templates/feature-mysql-monitor/fluent-bit.yaml
index 6a48c40..adc2685 100644
--- a/deploy/platform/kubernetes/feature-mysql/fluent-bit.yaml
+++ b/deploy/platform/kubernetes/templates/feature-mysql-monitor/fluent-bit.yaml
@@ -16,6 +16,8 @@
# under the License.
#
+{{- if .Values.features.mysqlMonitor.enabled }}
+
# @feature: slowsql-mysql; fluent bit log configurations
---
apiVersion: v1
@@ -69,7 +71,7 @@ data:
log = record["log"]
record["log"] = nil
record["date"] = nil
- record["tags"] = {data={{key="LOG_KIND", value="SLOW_SQL"}}}
+ record["tags"] = { data={ { key="LOG_KIND", value="SLOW_SQL" } } }
arr = split(log,"\n")
re1 = {}
@@ -170,3 +172,5 @@ data:
rule "second_state" "^(# User@Host.*)" "third_state"
rule "third_state" "^(# Query_time: .*)" "statement"
rule "statement" "^\w+.*" "statement"
+
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-mysql/mysql.yaml b/deploy/platform/kubernetes/templates/feature-mysql-monitor/mysql.yaml
similarity index 98%
rename from deploy/platform/kubernetes/feature-mysql/mysql.yaml
rename to deploy/platform/kubernetes/templates/feature-mysql-monitor/mysql.yaml
index 795cdca..b5f15f5 100644
--- a/deploy/platform/kubernetes/feature-mysql/mysql.yaml
+++ b/deploy/platform/kubernetes/templates/feature-mysql-monitor/mysql.yaml
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.mysqlMonitor.enabled }}
apiVersion: v1
kind: ConfigMap
@@ -197,3 +198,4 @@ spec:
items:
- key: mock-sql
path: mock.sql
+{{- end }}
diff --git a/.gitignore b/deploy/platform/kubernetes/templates/feature-mysql-monitor/opentelemetry-config.yaml
similarity index 51%
copy from .gitignore
copy to deploy/platform/kubernetes/templates/feature-mysql-monitor/opentelemetry-config.yaml
index 6388ee9..c79697c 100644
--- a/.gitignore
+++ b/deploy/platform/kubernetes/templates/feature-mysql-monitor/opentelemetry-config.yaml
@@ -15,48 +15,23 @@
# specific language governing permissions and limitations
# under the License.
#
-# Ignore Gradle project-specific cache directory
-.gradle
-
-# Ignore Gradle build output directory
-build
-
-venv
-
-.DS_Store
-
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
+{{- define "opentelemetry-config-mysql-monitor" }}
+{{- if .Values.features.mysqlMonitor.enabled }}
+
+# @feature: mysql; set OpenTelemetry config to scrape the mysql metrics
+# @feature: mysql; set up the scrape configs according to your mysql instances
+- job_name: 'mysql-monitoring'
+ metrics_path: '/metrics'
+ kubernetes_sd_configs:
+ - role: pod
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name ]
+ action: keep
+ regex: mysqld-exporter;metrics # @feature: mysql; reference the name of the metrics port
+ - source_labels: [ __meta_kubernetes_pod_name ]
+ target_label: host_name
+ regex: (.+)
+ replacement: $$1
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-postgresql/fluent-bit.yaml b/deploy/platform/kubernetes/templates/feature-postgresql-monitor/fluent-bit.yaml
similarity index 97%
rename from deploy/platform/kubernetes/feature-postgresql/fluent-bit.yaml
rename to deploy/platform/kubernetes/templates/feature-postgresql-monitor/fluent-bit.yaml
index f69acae..b58f0a0 100644
--- a/deploy/platform/kubernetes/feature-postgresql/fluent-bit.yaml
+++ b/deploy/platform/kubernetes/templates/feature-postgresql-monitor/fluent-bit.yaml
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.postgresqlMonitor.enabled }}
# @feature: slowsql-psql; fluent bit log configurations
---
@@ -60,7 +61,7 @@ data:
log = record["log"]
record["log"] = nil
record["date"] = nil
- record["tags"] = {data={{key="LOG_KIND", value="SLOW_SQL"}}}
+ record["tags"] = { data={ { key="LOG_KIND", value="SLOW_SQL" } } }
arr = split(log,"\n")
re1 = {}
@@ -145,3 +146,5 @@ data:
name my-log-format
format regex
regex \w*-\w*-\w* \w*:\w*:\w*.\w* UTCLOG: duration: \w*.\w* ms statement.*
+
+{{- end }}
diff --git a/.gitignore b/deploy/platform/kubernetes/templates/feature-postgresql-monitor/opentelemetry-config.yaml
similarity index 50%
copy from .gitignore
copy to deploy/platform/kubernetes/templates/feature-postgresql-monitor/opentelemetry-config.yaml
index 6388ee9..46b2a76 100644
--- a/.gitignore
+++ b/deploy/platform/kubernetes/templates/feature-postgresql-monitor/opentelemetry-config.yaml
@@ -15,48 +15,23 @@
# specific language governing permissions and limitations
# under the License.
#
-# Ignore Gradle project-specific cache directory
-.gradle
-
-# Ignore Gradle build output directory
-build
-
-venv
-
-.DS_Store
-
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
+{{- define "opentelemetry-config-postgresql-monitor" }}
+{{- if .Values.features.postgresqlMonitor.enabled }}
+
+# @feature: postgresql; set OpenTelemetry config to scrape the psql metrics
+# @feature: postgresql; set up the scrape configs according to your postgresql instances
+- job_name: "postgresql-monitoring"
+ metrics_path: '/metrics'
+ kubernetes_sd_configs:
+ - role: pod
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name ]
+ action: keep
+ regex: psql-exporter;metrics # @feature: postgresql; reference the name of the metrics port
+ - source_labels: [ __meta_kubernetes_pod_name ]
+ target_label: host_name
+ regex: (.+)
+ replacement: $$1
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-postgresql/psql.yaml b/deploy/platform/kubernetes/templates/feature-postgresql-monitor/psql.yaml
similarity index 98%
rename from deploy/platform/kubernetes/feature-postgresql/psql.yaml
rename to deploy/platform/kubernetes/templates/feature-postgresql-monitor/psql.yaml
index 047f173..122b796 100644
--- a/deploy/platform/kubernetes/feature-postgresql/psql.yaml
+++ b/deploy/platform/kubernetes/templates/feature-postgresql-monitor/psql.yaml
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.postgresqlMonitor.enabled }}
---
apiVersion: v1
@@ -220,3 +221,5 @@ spec:
items:
- key: mock-sql
path: mock.sql
+
+{{- end }}
diff --git a/deploy/platform/kubernetes/Makefile.in b/deploy/platform/kubernetes/templates/feature-promql/configmaps.yaml
similarity index 71%
copy from deploy/platform/kubernetes/Makefile.in
copy to deploy/platform/kubernetes/templates/feature-promql/configmaps.yaml
index 6ddc6e6..d12d9c1 100644
--- a/deploy/platform/kubernetes/Makefile.in
+++ b/deploy/platform/kubernetes/templates/feature-promql/configmaps.yaml
@@ -15,11 +15,16 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.promql.enabled }}
-.EXPORT_ALL_VARIABLES:
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: promql-configs
+data:
+{{ range $path, $bytes := .Files.Glob "generated/promql-configs/*.json" }}
+{{- $path | replace "generated/promql-configs/" "" | indent 2 }}: |
+{{ $.Files.Get $path | indent 4 }}
+{{ end }}
-NAMESPACE ?= default
-AGENTLESS ?= false
-BACKEND_SERVICE ?= oap
-
-FEATURE_FLAGS ?= java-agent-injector,cluster,elasticsearch,kubernetes-monitor,so11y,vm,als,event,istiod-monitor,satellite,rover,trace-profiling,mysql,apisix-monitor,promql
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-promql/resources.yaml b/deploy/platform/kubernetes/templates/feature-promql/resources.yaml
similarity index 87%
rename from deploy/platform/kubernetes/feature-promql/resources.yaml
rename to deploy/platform/kubernetes/templates/feature-promql/resources.yaml
index 6c66cf3..6a3ac03 100644
--- a/deploy/platform/kubernetes/feature-promql/resources.yaml
+++ b/deploy/platform/kubernetes/templates/feature-promql/resources.yaml
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.promql.enabled }}
#This config is for the showcase, when deploy your own environment fell free to modify it.
---
@@ -64,7 +65,7 @@ data:
name: SkyWalking
orgId: 1
type: prometheus
- url: http://oap:9090
+ url: http://{{ include "skywalking.oap.address.host" . }}:9090
---
apiVersion: apps/v1
@@ -84,7 +85,7 @@ spec:
spec:
containers:
- name: grafana
- image: ${GRAFANA_IMAGE}
+ image: {{ .Values.features.promql.grafana.image }}
imagePullPolicy: IfNotPresent
ports:
- name: http-grafana
@@ -99,28 +100,22 @@ spec:
- name: grafana-config
mountPath: /etc/grafana/provisioning/dashboards/providers.yaml
subPath: providers.yaml
- - name: dashboards-general-service
+ - name: promql-configs
mountPath: /var/lib/grafana/dashboards/skywalking/general-service.json
subPath: general-service.json
- - name: dashboards-service-mesh
+ - name: promql-configs
mountPath: /var/lib/grafana/dashboards/skywalking/service-mesh.json
subPath: service-mesh.json
- - name: dashboards-virtual-database
+ - name: promql-configs
mountPath: /var/lib/grafana/dashboards/skywalking/virtual-database.json
subPath: virtual-database.json
volumes: # require create configmap from deploy/platform/config/promql/dashboards
- name: grafana-config
configMap:
name: grafana-config
- - name: dashboards-general-service
+ - name: promql-configs
configMap:
- name: grafana-dashboards-general-service
- - name: dashboards-service-mesh
- configMap:
- name: grafana-dashboards-service-mesh
- - name: dashboards-virtual-database
- configMap:
- name: grafana-dashboards-virtual-database
+ name: promql-configs
---
apiVersion: v1
@@ -134,3 +129,5 @@ spec:
- port: 3000
protocol: TCP
targetPort: http-grafana
+
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-rover/permissions.yaml b/deploy/platform/kubernetes/templates/feature-rover/permissions.yaml
similarity index 93%
rename from deploy/platform/kubernetes/feature-rover/permissions.yaml
rename to deploy/platform/kubernetes/templates/feature-rover/permissions.yaml
index 8b1da58..6542cd5 100644
--- a/deploy/platform/kubernetes/feature-rover/permissions.yaml
+++ b/deploy/platform/kubernetes/templates/feature-rover/permissions.yaml
@@ -15,12 +15,12 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.rover.enabled}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: skywalking-rover-sa
- namespace: ${NAMESPACE}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
@@ -42,4 +42,6 @@ roleRef:
subjects:
- kind: ServiceAccount
name: skywalking-rover-sa
- namespace: ${NAMESPACE}
+ namespace: {{ .Release.Namespace }}
+
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-rover/profiling.yaml b/deploy/platform/kubernetes/templates/feature-rover/profiling.yaml
similarity index 68%
rename from deploy/platform/kubernetes/feature-rover/profiling.yaml
rename to deploy/platform/kubernetes/templates/feature-rover/profiling.yaml
index 9a1d005..d01fbbb 100644
--- a/deploy/platform/kubernetes/feature-rover/profiling.yaml
+++ b/deploy/platform/kubernetes/templates/feature-rover/profiling.yaml
@@ -15,11 +15,13 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.rover.enabled}}
apiVersion: v1
kind: ConfigMap
metadata:
name: profiling-config
+ namespace: {{ .Values.sampleServices.namespace }}
labels:
app: profiling-config
data:
@@ -37,6 +39,7 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: ebpf-profiling-trgigger
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
schedule: "10 */2 * * *"
successfulJobsHistoryLimit: 1
@@ -50,28 +53,29 @@ spec:
spec:
containers:
- name: ebpf-profiling-trigger
- image: ${SW_CLI_IMAGE}
+ image: "{{ .Values.features.rover.swctl.image }}"
+ imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- >
- /swctl --base-url=http://oap:12800/graphql profiling ebpf create fixed \
+ /swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql profiling ebpf create fixed \
--service-name mesh-svr::recommendation --labels mesh-envoy --duration=9m --target-type ON_CPU;
- /swctl --base-url=http://oap:12800/graphql profiling ebpf create fixed \
+ /swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql profiling ebpf create fixed \
--service-name mesh-svr::app --labels mesh-envoy --duration=9m --target-type ON_CPU;
- /swctl --base-url=http://oap:12800/graphql profiling ebpf create fixed \
+ /swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql profiling ebpf create fixed \
--service-name mesh-svr::songs --labels mesh-envoy --duration=9m --target-type ON_CPU;
- /swctl --base-url=http://oap:12800/graphql profiling ebpf create fixed \
+ /swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql profiling ebpf create fixed \
--service-name mesh-svr::gateway --labels mesh-envoy --duration=9m --target-type ON_CPU;
- /swctl --base-url=http://oap:12800/graphql profiling ebpf create fixed \
+ /swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql profiling ebpf create fixed \
--service-name mesh-svr::songs --labels mesh-envoy --duration=9m --target-type OFF_CPU;
apk update && apk add yq;
- /swctl --base-url=http://oap:12800/graphql profiling ebpf create network \
+ /swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql profiling ebpf create network \
--sampling-config=/profiling/network-profiling-sampling.yaml \
--service-name=mesh-svr::recommendation \
- --instance-name=$(/swctl --base-url=http://oap:12800/graphql instance ls --service-name mesh-svr::recommendation|yq e '.[0].name' -);
+ --instance-name=$(/swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql instance ls --service-name mesh-svr::recommendation|yq e '.[0].name' -);
volumeMounts:
- name: profiling-config
mountPath: /profiling
@@ -80,3 +84,4 @@ spec:
- name: profiling-config
configMap:
name: profiling-config
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-rover/resources.yaml b/deploy/platform/kubernetes/templates/feature-rover/resources.yaml
similarity index 78%
rename from deploy/platform/kubernetes/feature-rover/resources.yaml
rename to deploy/platform/kubernetes/templates/feature-rover/resources.yaml
index a7fa9f8..f2c3700 100644
--- a/deploy/platform/kubernetes/feature-rover/resources.yaml
+++ b/deploy/platform/kubernetes/templates/feature-rover/resources.yaml
@@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.rover.enabled}}
+
apiVersion: apps/v1
kind: DaemonSet
metadata:
@@ -33,8 +35,8 @@ spec:
serviceAccountName: skywalking-rover-sa
containers:
- name: rover
- image: ${SW_ROVER_IMAGE}
- imagePullPolicy: Always
+ image: {{ .Values.features.rover.image }}
+ imagePullPolicy: IfNotPresent
securityContext:
capabilities:
add:
@@ -53,13 +55,13 @@ spec:
fieldRef:
fieldPath: spec.nodeName
- name: ROVER_BACKEND_ADDR
- value: ${BACKEND_SERVICE}:11800
+ value: {{ template "skywalking.collector.address" . }}
- name: ROVER_PROCESS_DISCOVERY_KUBERNETES_ANALYZER_ISTIO_ENVOY_SERVICE_NAME
- value: mesh-svr::{{.Pod.LabelValue "service.istio.io/canonical-name,app.kubernetes.io/name,app"}}
+ value: mesh-svr::{{"{{"}}.Pod.LabelValue "service.istio.io/canonical-name,app.kubernetes.io/name,app"{{"}}"}}
- name: ROVER_PROCESS_DISCOVERY_KUBERNETES_ANALYZER_ISTIO_APPLICATION_SERVICE_NAME
- value: mesh-svr::{{.Pod.LabelValue "service.istio.io/canonical-name,app.kubernetes.io/name,app"}}
+ value: mesh-svr::{{"{{"}}.Pod.LabelValue "service.istio.io/canonical-name,app.kubernetes.io/name,app"{{"}}"}}
- name: ROVER_PROCESS_DISCOVERY_KUBERNETES_ANALYZER_K8S_SERVICE_NAME
- value: skywalking-showcase::{{.Pod.ServiceName}}.{{.Pod.Namespace}}
+ value: skywalking-showcase::{{"{{"}}.Pod.ServiceName{{"}}"}}.{{"{{"}}.Pod.Namespace{{"}}"}}
- name: ROVER_HOST_MAPPING
value: /host
hostPID: true
@@ -69,4 +71,6 @@ spec:
- name: host
hostPath:
path: /
- type: Directory
\ No newline at end of file
+ type: Directory
+
+{{- end }}
diff --git a/.gitignore b/deploy/platform/kubernetes/templates/feature-so11y/opentelemetry-config.yaml
similarity index 55%
copy from .gitignore
copy to deploy/platform/kubernetes/templates/feature-so11y/opentelemetry-config.yaml
index 6388ee9..50c31da 100644
--- a/.gitignore
+++ b/deploy/platform/kubernetes/templates/feature-so11y/opentelemetry-config.yaml
@@ -15,48 +15,24 @@
# specific language governing permissions and limitations
# under the License.
#
-# Ignore Gradle project-specific cache directory
-.gradle
-
-# Ignore Gradle build output directory
-build
-
-venv
-
-.DS_Store
-
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
+{{- define "opentelemetry-config-so11y" }}
+{{- if .Values.features.so11y.enabled }}
+
+- job_name: 'skywalking-so11y'
+ metrics_path: '/metrics'
+ kubernetes_sd_configs:
+ - role: pod
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name ]
+ action: keep
+ regex: oap;metrics # @feature: so11y; reference the name of the metrics port
+ - source_labels: [ ]
+ target_label: service
+ replacement: oap-server
+ - source_labels: [ __meta_kubernetes_pod_name ]
+ target_label: host_name
+ regex: (.+)
+ replacement: $$1
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-trace-profiling/profiling.yaml b/deploy/platform/kubernetes/templates/feature-trace-profiling/profiling.yaml
similarity index 80%
rename from deploy/platform/kubernetes/feature-trace-profiling/profiling.yaml
rename to deploy/platform/kubernetes/templates/feature-trace-profiling/profiling.yaml
index 797da6c..269a98e 100644
--- a/deploy/platform/kubernetes/feature-trace-profiling/profiling.yaml
+++ b/deploy/platform/kubernetes/templates/feature-trace-profiling/profiling.yaml
@@ -16,10 +16,13 @@
# under the License.
#
+{{- if .Values.features.traceProfiling.enabled }}
+
apiVersion: batch/v1
kind: CronJob
metadata:
name: trace-profiling-trgigger
+ namespace: {{ .Values.sampleServices.namespace }}
spec:
schedule: "8 0 * * *"
successfulJobsHistoryLimit: 1
@@ -33,11 +36,13 @@ spec:
spec:
containers:
- name: trace-profiling-trigger
- image: ${SW_CLI_IMAGE}
+ image: "{{ .Values.features.traceProfiling.swctl.image }}"
command:
- /bin/sh
- -c
- >
- /swctl --base-url=http://oap:12800/graphql profiling trace create --service-name agent::songs \
+ /swctl --base-url={{ template "skywalking.oap.address.http" . }}/graphql profiling trace create --service-name agent::songs \
--endpoint-name GET:/songs --duration=15 --min-duration-threshold=0 --dump-period=10 --max-sampling-count=9
restartPolicy: Never
+
+{{- end }}
diff --git a/.gitignore b/deploy/platform/kubernetes/templates/feature-vm-monitor/opentelemetry-config.yaml
similarity index 52%
copy from .gitignore
copy to deploy/platform/kubernetes/templates/feature-vm-monitor/opentelemetry-config.yaml
index 6388ee9..e8b85ce 100644
--- a/.gitignore
+++ b/deploy/platform/kubernetes/templates/feature-vm-monitor/opentelemetry-config.yaml
@@ -15,48 +15,23 @@
# specific language governing permissions and limitations
# under the License.
#
-# Ignore Gradle project-specific cache directory
-.gradle
-# Ignore Gradle build output directory
-build
-
-venv
-
-.DS_Store
-
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
+{{- define "opentelemetry-config-vm" }}
+{{- if .Values.features.vmMonitor.enabled }}
+
+# @feature: vm; set OpenTelemetry config to scrape the VM metrics, this is only for demo, in real scenarios the VM addresses should be static, not via service discovery
+- job_name: 'vm-monitoring'
+ metrics_path: '/metrics'
+ kubernetes_sd_configs:
+ - role: pod
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_pod_container_name, __meta_kubernetes_pod_container_port_name ]
+ action: keep
+ regex: vm;metrics # @feature: vm; reference the name of the metrics port
+ - source_labels: [ __meta_kubernetes_pod_name ]
+ target_label: host_name
+ regex: (.+)
+ replacement: $$1
+
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/feature-vm/vm.yaml b/deploy/platform/kubernetes/templates/feature-vm-monitor/vm.yaml
similarity index 96%
rename from deploy/platform/kubernetes/feature-vm/vm.yaml
rename to deploy/platform/kubernetes/templates/feature-vm-monitor/vm.yaml
index b7844e1..c5b2f05 100644
--- a/deploy/platform/kubernetes/feature-vm/vm.yaml
+++ b/deploy/platform/kubernetes/templates/feature-vm-monitor/vm.yaml
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
#
+{{- if .Values.features.vmMonitor.enabled }}
# @feature: pretend these Pods are virtual machines
@@ -59,3 +60,5 @@ spec:
ports:
- containerPort: 9100
name: metrics
+
+{{- end }}
diff --git a/deploy/platform/kubernetes/templates/otel-collector-config.yaml b/deploy/platform/kubernetes/templates/otel-collector-config.yaml
new file mode 100644
index 0000000..3831ee2
--- /dev/null
+++ b/deploy/platform/kubernetes/templates/otel-collector-config.yaml
@@ -0,0 +1,61 @@
+# 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.opentelemetry.enabled }}
+
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: otel-collector-config
+data:
+ config.yaml: |
+ receivers:
+ prometheus:
+ config:
+ scrape_configs:
+ {{- include "opentelemetry-config-apisix" . | indent 12 }}
+ {{- include "opentelemetry-config-istiod-monitor" . | indent 12 }}
+ {{- include "opentelemetry-config-kubernetes-monitor" . | indent 12 }}
+ {{- include "opentelemetry-config-mysql-monitor" . | indent 12 }}
+ {{- include "opentelemetry-config-postgresql-monitor" . | indent 12 }}
+ {{- include "opentelemetry-config-so11y" . | indent 12 }}
+ {{- include "opentelemetry-config-vm" . | indent 12 }}
+
+ exporters:
+ otlp:
+ endpoint: "{{ include "skywalking.oap.address.grpc" . }}"
+ tls:
+ insecure: true
+ logging:
+ verbosity: detailed
+
+ extensions:
+ # The health_check extension is mandatory for this chart.
+ # Without the health_check extension the collector will fail the readiness and liveliness probes.
+ # The health_check extension can be modified, but should never be removed.
+ health_check: {}
+
+ service:
+ pipelines:
+ metrics:
+ receivers: [ prometheus ]
+ exporters: [ otlp,logging ]
+ extensions:
+ - health_check
+
+{{- end }}
diff --git a/deploy/platform/kubernetes/tmpcharts/base-1.14.4.tgz b/deploy/platform/kubernetes/tmpcharts/base-1.14.4.tgz
new file mode 100644
index 0000000..8c30efd
Binary files /dev/null and b/deploy/platform/kubernetes/tmpcharts/base-1.14.4.tgz differ
diff --git a/deploy/platform/kubernetes/tmpcharts/kube-state-metrics-5.0.1.tgz b/deploy/platform/kubernetes/tmpcharts/kube-state-metrics-5.0.1.tgz
new file mode 100644
index 0000000..fe80735
Binary files /dev/null and b/deploy/platform/kubernetes/tmpcharts/kube-state-metrics-5.0.1.tgz differ
diff --git a/deploy/platform/kubernetes/tmpcharts/openfunction-v1.0.0-v0.5.0.tgz b/deploy/platform/kubernetes/tmpcharts/openfunction-v1.0.0-v0.5.0.tgz
new file mode 100644
index 0000000..6ad4d12
Binary files /dev/null and b/deploy/platform/kubernetes/tmpcharts/openfunction-v1.0.0-v0.5.0.tgz differ
diff --git a/deploy/platform/kubernetes/tmpcharts/skywalking-helm-0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz b/deploy/platform/kubernetes/tmpcharts/skywalking-helm-0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz
new file mode 100644
index 0000000..eba7d3f
Binary files /dev/null and b/deploy/platform/kubernetes/tmpcharts/skywalking-helm-0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz differ
diff --git a/deploy/platform/kubernetes/tmpcharts/skywalking-helm-swck-operator-0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz b/deploy/platform/kubernetes/tmpcharts/skywalking-helm-swck-operator-0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz
new file mode 100644
index 0000000..8e9e2ee
Binary files /dev/null and b/deploy/platform/kubernetes/tmpcharts/skywalking-helm-swck-operator-0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9.tgz differ
diff --git a/deploy/platform/kubernetes/values.yaml b/deploy/platform/kubernetes/values.yaml
new file mode 100644
index 0000000..2f2d762
--- /dev/null
+++ b/deploy/platform/kubernetes/values.yaml
@@ -0,0 +1,310 @@
+# 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.
+
+skywalking-helm:
+ fullnameOverride: "sw-demo"
+ oap:
+ name: oap
+ image:
+ repository: ~
+ tag: ~
+ pullPolicy: IfNotPresent
+ replicas: 1
+ storageType: ~
+ ports:
+ grpc: 11800
+ rest: 12800
+ promql: 9090
+ zipkin: 9411
+ zipkin-query: 9412
+ metrics: 1234
+ env:
+ SW_HEALTH_CHECKER: default
+ SW_OTEL_RECEIVER: default # @feature: so11y;,mysql;kubernetes-monitor enable OpenTelemetry receiver to receive OpenTelemetry metrics
+ # @feature: vm; enable vm rules to analyze VM metrics
+ # @feature: so11y; enable oap rules to analyze OAP metrics
+ # @feature: kubernetes-monitor; enable rules to analyze Kubernetes Cluster/Node/Service metrics
+ # @feature: istiod-monitor; enable rules to analyze Istio control plane metrics
+ # @feature: mysql; enable mysql rules to analyze MySQL metrics
+ # @feature: apisix-monitor; enable APISIX rules to analyze APISIX metrics
+ SW_OTEL_RECEIVER_ENABLED_OTEL_RULES: vm,oap,k8s/*,istio-controlplane,mysql/*,postgresql/*,apisix
+ SW_TELEMETRY: prometheus # @feature: so11y; expose the metrics of self o11y through prometheus
+ SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS: "mx-mesh,persistence" # @feature: als; enable mesh analyzer (mx-mesh) to analyze ALS logs
+ K8S_SERVICE_NAME_RULE: "mesh-svr::${service.metadata.name}"
+ SW_CONFIGURATION: k8s-configmap
+ SW_ENVOY_METRIC_ALS_TCP_ANALYSIS: "mx-mesh"
+ SW_ENABLE_UPDATE_UI_TEMPLATE: "false"
+ SW_SLOW_DB_THRESHOLD: default:0,mongodb:100
+ SW_ENABLE_ON_DEMAND_POD_LOG: "true"
+ SW_METER_ANALYZER_ACTIVE_FILES: datasource,threadpool,satellite,network-profiling,spring-sleuth
+ SW_STORAGE_ES_RESPONSE_TIMEOUT: "50000"
+ SW_STORAGE_ES_INDEX_SHARDS_NUMBER: "6"
+ SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR: "2"
+ SW_RECEIVER_ZIPKIN: default
+ SW_QUERY_ZIPKIN: default
+
+ config:
+ metadata-service-mapping.yaml: |
+ serviceName: mesh-svr::${LABELS."service.istio.io/canonical-name",LABELS."app.kubernetes.io/name",LABELS.app}
+ serviceInstanceName: ${NAME}
+ alarm-settings.yml: |
+ rules:
+ service_resp_time_rule:
+ metrics-name: service_resp_time
+ threshold: 20 # 20ms is just for demo
+ op: ">"
+ period: 5
+ count: 1
+ message: Response time of service {name} is more than 20ms.
+ core.default.log4j-xml: |-
+ <Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout charset="UTF-8" pattern="%d - %c - %L [%t] %-5p %x - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <logger name="io.grpc.netty" level="INFO"/>
+ <logger name="org.apache.skywalking.oap.server.configuration.api" level="TRACE"/>
+ <logger name="org.apache.skywalking.oap.server.configuration.configmap" level="DEBUG"/>
+ <logger name="org.apache.skywalking.oap.server.storage.plugin.jdbc" level="DEBUG"/>
+ <Root level="INFO">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+ </Configuration>
+ ui:
+ name: ui
+ replicas: 1
+ image:
+ repository: ~
+ tag: ~
+ pullPolicy: IfNotPresent
+ env:
+ SW_ZIPKIN_ADDRESS: ""
+
+ elasticsearch:
+ enabled: false
+ image: ~
+ imageTag: ~
+ imagePullPolicy: "IfNotPresent"
+
+ postgresql:
+ enabled: false # Whether to start a demo postgresql deployment, don't use this for production.
+ config:
+ # The hostname of your own postgresql service, this only takes effect when postgresql.enabled is false.
+ host: postgresql-service.your-awesome-company.com
+ auth:
+ username: postgres
+ password: "123456"
+ postgresPassword: "123456"
+ database: skywalking
+ containerPorts:
+ postgresql: 5432
+ primary:
+ persistence:
+ enabled: false
+ readReplicas:
+ persistence:
+ enabled: false
+
+ satellite:
+ name: satellite
+ replicas: 1
+ enabled: true
+ image:
+ repository: ~
+ tag: ~
+ pullPolicy: IfNotPresent
+ ports:
+ grpc: 11800
+ prometheus: 1234
+ env:
+ SATELLITE_TELEMETRY_EXPORT_TYPE: metrics_service
+ podAnnotations:
+ sidecar.istio.io/inject: "false"
+
+sampleServices:
+ hub: ~
+ tag: ~
+ namespace: sample-services
+
+# @feature: java-agent-injector; the java agent injector is a component of the swck operator, so we need to deploy the swck operator firstly
+skywalking-helm-swck-operator:
+ image:
+ repository: ~
+ tag: ~
+ # @feature: java-agent-injector; the swck operator depends on the certificate management of the cert-manager
+ cert-manager:
+ enabled: true
+ fullnameOverride: "swck-demo"
+
+# @feature: function; install open function resources
+openfunction:
+ enabled: false
+ global:
+ ShipwrightBuild:
+ enabled: false
+ TektonPipelines:
+ enabled: false
+ Keda:
+ enabled: false
+ Dapr:
+ enabled: false
+ contour:
+ envoy:
+ useHostPort: false
+ service:
+ type: ClusterIP
+ externalTrafficPolicy: ""
+
+istio:
+ enabled: false
+
+base:
+ global:
+ istioNamespace: demo
+
+istiod:
+ global:
+ istioNamespace: demo
+ meshConfig:
+ enableEnvoyAccessLogService: true
+ enableTracing: true
+ defaultConfig:
+ tracing:
+ sampling: 100
+ zipkin:
+ address: ~
+ envoyMetricsService:
+ address: ~
+ envoyAccessLogService:
+ address: ~
+ proxyStatsMatcher:
+ inclusionRegexps:
+ - ".*membership_healthy.*"
+ - ".*upstream_cx_active.*"
+ - ".*upstream_cx_total.*"
+ - ".*upstream_rq_active.*"
+ - ".*upstream_rq_total.*"
+ - ".*upstream_rq_pending_active.*"
+ - ".*lb_healthy_panic.*"
+ - ".*upstream_cx_none_healthy.*"
+
+# @feature: kubernetes-monitor; extra resources to install for kubernetes monitoring, standard kube-state-metrics
+kube-state-metrics:
+ enabled: false
+
+opentelemetry:
+ enabled: false
+
+opentelemetry-collector:
+ mode: deployment
+ clusterRole:
+ create: true
+ rules:
+ - apiGroups: [ "" ]
+ resources:
+ # @feature: kubernetes-monitor; permissions to read resources
+ - "endpoints"
+ - "pods"
+ - "services"
+ - "nodes"
+ - "nodes/metrics"
+ - "nodes/proxy"
+ verbs: [ "get", "watch", "list" ]
+ resources:
+ limits:
+ cpu: 100m
+ memory: 200M
+ image:
+ repository: ~
+ tag: ~
+
+ configMap:
+ create: false
+
+ command:
+ name: otelcol
+ extraArgs: [ "--config=/conf/config.yaml" ]
+
+ extraVolumes:
+ - name: otelcol-configmap
+ configMap:
+ name: otel-collector-config
+ defaultMode: 420
+ extraVolumeMounts:
+ - name: otelcol-configmap
+ mountPath: /conf
+
+features:
+ kubernetesMonitor:
+ enabled: false
+
+ mysqlMonitor:
+ enabled: false
+
+ postgresqlMonitor:
+ enabled: false
+
+ event:
+ enabled: false
+ exporter:
+ image: ~
+
+ istiodMonitor:
+ enabled: false
+
+ apisixMonitor:
+ enabled: false
+
+ traceProfiling:
+ enabled: false
+ swctl:
+ image: ~
+
+ rover:
+ enabled: false
+ image: ~
+ swctl:
+ image: ~
+
+ vmMonitor:
+ enabled: false
+
+ promql:
+ enabled: false
+ grafana:
+ image: ~
+
+ function:
+ enabled: false
+
+ so11y:
+ enabled: false
+
+ als:
+ enabled: false
+
+ meshWithAgent:
+ enabled: false
+
+ agent:
+ enabled: false
+
+ # @feature: java-agent-injector; enable java agent injector and set the java agent image
+ javaAgentInjector:
+ enabled: false
+ agentImage: ~
diff --git a/docs/readme.md b/docs/readme.md
index cd99032..cefcab8 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -87,12 +87,13 @@ Currently, the features supported are:
| Name | Description | Note |
|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `java-agent-injector` | Use the java agent injector to inject the Skywalking Java agent and deploy microservices with other SkyWalking agent enabled. | The microservices include agents for Java, NodeJS server, browser, Python. |
-| `agent` | Deploy microservices with SkyWalking agent pre-installed. | In Kubernetes sceanarios, please use `java-agent-injector` instead of this, if possible. |
+| `agent` | Deploy microservices with SkyWalking agent pre-installed. | In Kubernetes scenarios, please use `java-agent-injector` instead of this, if possible. |
| `cluster` | Deploy SkyWalking OAP in cluster mode, with 2 nodes, and SkyWalking UI. | Only one of `cluster` or `single-node` can be enabled. |
| `single-node` | Deploy only one single node of SkyWalking OAP, and SkyWalking UI, ElasticSearch as storage. | Only one of `cluster` or `single-node` can be enabled. |
-| `elasticsearch` | Deploy a single-node ElasticSearch as storage, you may want to disable this if you want to use your own ElasticSearch deployments. | |
+| `elasticsearch` | Deploy ElasticSearch as storage, you may want to disable this if you want to use your own ElasticSearch deployments. | |
+| `postgresql` | Deploy PostgreSQL as storage, you may want to disable this if you want to use your own PostgreSQL deployments. | |
| `so11y` | Enable SkyWalking self observability. | This is enabled by default for platform [Docker Compose](#docker-compose). |
-| `vm` | Start 2 virtual machines and export their metrics to SkyWalking. | The "virtual machines" are mimicked by Docker containers or Pods. |
+| `vm-monitor` | Start 2 virtual machines and export their metrics to SkyWalking. | The "virtual machines" are mimicked by Docker containers or Pods. |
| `als` | Start microservices WITHOUT SkyWalking agent enabled, and configure SkyWalking to analyze the topology and metrics from their access logs. | Command `istioctl` is required to run this feature. The agentless microservices will be running at namespace `${NAMESPACE}-agentless` |
| `kubernetes-monitor` | Deploy OpenTelemetry and export Kubernetes monitoring metrics to SkyWalking for analysis and display on UI. | |
| `istiod-monitor` | Deploy OpenTelemetry and export Istio control plane metrics to SkyWalking for analysis and display on UI. | |
@@ -101,11 +102,11 @@ Currently, the features supported are:
| `function` | Deploy [OpenFunction](https://openfunction.dev/) and export trace to SkyWalking. | Command `helm` is required to run this feature. |
| `trace-profiling` | Deploy tools to submit trace profiling tasks. | Only support deployment with SkyWalking agents installed, currently Java agent and Python agent support trace profiling. |
| `rover` | Deploy SkyWalking Rover and detect the processes in the Kubernetes environment. | Only support deployment in the Kubernetes environment, docker is not supported. |
-| `mysql` | Start a MySQL server and load generator to execute the sample SQLs periodically, set up fluent bit to fetch slow logs and export to OAP, and export their metrics to SkyWalking. | |
-| `postgresql` | Start a PostgreSQL server, and load generator to execute the sample SQLs periodically, set up fluent bit to fetch slow logs and export to OAP, and export their metrics to SkyWalking. | |
+| `mysql-monitor` | Start a MySQL server and load generator to execute the sample SQLs periodically, set up fluent bit to fetch slow logs and export to OAP, and export their metrics to SkyWalking. | |
+| `postgresql-monitor` | Start a PostgreSQL server, and load generator to execute the sample SQLs periodically, set up fluent bit to fetch slow logs and export to OAP, and export their metrics to SkyWalking. | |
| `apisix-monitor` | Deploy OpenTelemetry and export APISIX metrics to SkyWalking for analysis and display on UI | |
| `mesh-with-agent` | Deploy services with java agent in the service mesh environment. | Only support deployment in the Kubernetes environment, docker is not supported. |
-| `promql` | Deploy a Grafana to use promql service and show SkyWalking UI on the Grafana. | Feel free to modify the Grafana config when deploy your own environment. |
+| `promql` | Deploy a Grafana to use promql service and show SkyWalking UI on the Grafana. | Feel free to modify the Grafana config when deploy your own environment. |
### Kubernetes
@@ -161,3 +162,15 @@ graph LR;
agent["business app(agent)"] --> satellite("satellite") --> oap("oap");
envoy["sidecar(envoy)"] --> satellite;
```
+
+## Troubleshooting
+
+If you encounter any problems, please add `DEBUG=true` to the command line to get the output of the resources that will be applied.
+
+```shell
+make deploy.kubernetes DEBUG=true # this will print the resources that will be applied to Kubernetes
+```
+
+```shell
+make deploy.docker DEBUG=true # this will print the merged docker-compose.yaml content that will be used to run in Docker Compose
+```
diff --git a/scripts/wait-cert-manager-ready.sh b/scripts/wait-cert-manager-ready.sh
deleted file mode 100644
index 2067170..0000000
--- a/scripts/wait-cert-manager-ready.sh
+++ /dev/null
@@ -1,59 +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.
-#
-
-TIMEOUT=120
-
-MANIFEST=$(mktemp)
-
-cat << EOF > $MANIFEST
-apiVersion: cert-manager.io/v1
-kind: Issuer
-metadata:
- name: test-selfsigned
- namespace: default
-spec:
- selfSigned: {}
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: selfsigned-cert
- namespace: default
-spec:
- dnsNames:
- - example.com
- secretName: selfsigned-cert-tls
- issuerRef:
- name: test-selfsigned
-EOF
-
-( bash -c -- "\
- while ! kubectl apply -f $MANIFEST 2> /dev/null; \
- do \
- sleep 0.1; \
- done" ) & pid=$!
-( sleep $TIMEOUT && pkill -HUP $pid ) 2>/dev/null & watcher=$!
-if wait $pid 2>/dev/null; then
- pkill -HUP -P $watcher
- wait $watcher
-fi
-
-# make sure the dummy Issuer and Certificate will be deleted
-trap "kubectl delete -f $MANIFEST; rm $MANIFEST" 0 2 3 15