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 bd44ad8 Add R3 to showcase (#156) bd44ad8 is described below commit bd44ad8803e242043c59f5d3d4d9b1435ec95a1f Author: kezhenxu94 <kezhenx...@apache.org> AuthorDate: Tue Jan 23 21:37:26 2024 +0800 Add R3 to showcase (#156) --- Makefile.in | 3 + deploy/platform/kubernetes/Makefile | 8 ++- deploy/platform/kubernetes/Makefile.in | 2 +- .../kubernetes/templates/feature-r3/resources.yaml | 83 ++++++++++++++++++++++ deploy/platform/kubernetes/values.yaml | 8 +++ docs/readme.md | 1 + 6 files changed, 103 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index b5f8852..d01c419 100644 --- a/Makefile.in +++ b/Makefile.in @@ -56,5 +56,8 @@ GRAFANA_IMAGE ?= grafana/grafana:9.5.2 OTEL_COLLECTOR_IMAGE ?= otel/opentelemetry-collector OTEL_COLLECTOR_IMAGE_TAG ?= 0.72.0 +SW_R3_IMAGE ?= ghcr.io/skyapm/r3 +SW_R3_IMAGE_TAG ?= 0.1.0 + # ALL variables should be listed above ^^ EXPORTED_VARS := $(filter-out <%,$(.VARIABLES)) diff --git a/deploy/platform/kubernetes/Makefile b/deploy/platform/kubernetes/Makefile index 13f071f..275c94b 100644 --- a/deploy/platform/kubernetes/Makefile +++ b/deploy/platform/kubernetes/Makefile @@ -39,6 +39,7 @@ HELM_OPTIONS := $(HELM_OPTIONS) --set features.javaAgentInjector.agentImage=$(SW HELM_OPTIONS := $(HELM_OPTIONS) --set features.rover.image=$(SW_ROVER_IMAGE) HELM_OPTIONS := $(HELM_OPTIONS) --set features.grafana.image=$(GRAFANA_IMAGE) HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking.grafana.plugin.version=$(SW_GRAFANA_PLUGIN_VERSION) +HELM_OPTIONS := $(HELM_OPTIONS) --set features.r3.image=$(SW_R3_IMAGE):$(SW_R3_IMAGE_TAG) ifeq ($(DEBUG),true) HELM_OPTIONS := $(HELM_OPTIONS) --dry-run --debug @@ -99,7 +100,7 @@ feature-istiod-monitor: .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 istio.enabled=true --set istiod.global.istioNamespace=$(NAMESPACE) --set base.global.istioNamespace=$(NAMESPACE)) $(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=$(BACKEND_SERVICE)) $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set istiod.meshConfig.defaultConfig.envoyAccessLogService.address=$(BACKEND_SERVICE)) @@ -171,6 +172,11 @@ feature-grafana: feature-mesh-with-agent: $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.meshWithAgent.enabled=true) +.PHONY: feature-r3 +feature-r3: + $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.r3.enabled=true) + $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking.oap.env.SW_AI_PIPELINE_URI_RECOGNITION_SERVER_ADDR=r3) + .PHONY: deploy deploy: $(features) helm dep up . diff --git a/deploy/platform/kubernetes/Makefile.in b/deploy/platform/kubernetes/Makefile.in index e126b9e..5eb6bbe 100644 --- a/deploy/platform/kubernetes/Makefile.in +++ b/deploy/platform/kubernetes/Makefile.in @@ -23,4 +23,4 @@ SAMPLE_SERVICES_NAMESPACE ?= sample-services RELEASE ?= demo AGENTLESS ?= false -FEATURE_FLAGS ?= java-agent-injector,cluster,elasticsearch,kubernetes-monitor,so11y,vm-monitor,als,event,istiod-monitor,satellite,rover,trace-profiling,mysql-monitor,postgresql-monitor,nginx-monitor,apisix-monitor,grafana,elasticsearch-monitor,rabbitmq-monitor,mongodb-monitor +FEATURE_FLAGS ?= java-agent-injector,cluster,elasticsearch,kubernetes-monitor,so11y,vm-monitor,als,event,istiod-monitor,satellite,rover,trace-profiling,mysql-monitor,postgresql-monitor,nginx-monitor,apisix-monitor,grafana,elasticsearch-monitor,rabbitmq-monitor,mongodb-monitor,r3 diff --git a/deploy/platform/kubernetes/templates/feature-r3/resources.yaml b/deploy/platform/kubernetes/templates/feature-r3/resources.yaml new file mode 100644 index 0000000..8becfa2 --- /dev/null +++ b/deploy/platform/kubernetes/templates/feature-r3/resources.yaml @@ -0,0 +1,83 @@ +# 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.r3.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: r3 +spec: + selector: + app: r3 + ports: + - protocol: TCP + port: 17128 + name: r3-port + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: r3-deployment + labels: + app: r3 +spec: + replicas: 1 + selector: + matchLabels: + app: r3 + template: + metadata: + labels: + app: r3 + annotations: + sidecar.istio.io/inject: "false" + spec: + containers: + - name: r3 + image: {{ .Values.features.r3.image }} + ports: + - containerPort: 17128 + +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: r3-load + namespace: {{ .Values.sampleServices.namespace }} + labels: + app: r3-load +spec: + schedule: "0,10,20,30,40,50 * * * *" + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 + jobTemplate: + spec: + template: + spec: + shareProcessNamespace: true + containers: + - name: r3-load + image: curlimages/curl + command: ["/bin/sh"] + args: ["-c", "for i in $(seq 1 200); do curl http://rating/songs/$i/reviews/$((i+1)); sleep 1; done; curl -X POST http://localhost:15000/quitquitquit;"] + securityContext: + capabilities: + add: + - SYS_PTRACE + restartPolicy: Never +{{- end }} diff --git a/deploy/platform/kubernetes/values.yaml b/deploy/platform/kubernetes/values.yaml index f9fa608..dac22a7 100644 --- a/deploy/platform/kubernetes/values.yaml +++ b/deploy/platform/kubernetes/values.yaml @@ -55,6 +55,10 @@ skywalking: SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR: "2" SW_RECEIVER_ZIPKIN: default SW_QUERY_ZIPKIN: default + # @feature: r3; some basic settings for R3 + SW_CORE_ENABLE_ENDPOINT_NAME_GROUPING_BY_OPENAPI: "false" + SW_CORE_MAX_HTTP_URIS_NUMBER_PER_SVR: "3000" + SW_AI_PIPELINE_URI_RECOGNITION_SERVER_PORT: "17128" config: metadata-service-mapping.yaml: | @@ -343,3 +347,7 @@ features: javaAgentInjector: enabled: false agentImage: ~ + + r3: + enabled: false + image: ~ diff --git a/docs/readme.md b/docs/readme.md index e9fbcdf..f563542 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -110,6 +110,7 @@ Currently, the features supported are: | `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. | | `grafana` | Deploy a Grafana to show SkyWalking metrics and logs on the Grafana UI. | Feel free to modify the Grafana config when deploy your own environment. | +| `r3` | Deploy [R3](https://github.com/SkyAPM/R3) as RESTful URL recognition service. | | ### Kubernetes