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

liuhan 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 cc9cb90  Add `mesh-with-agent` feature for deploy agent service in 
service mesh (#90)
cc9cb90 is described below

commit cc9cb9015df149229505d52fe683b353b5634eab
Author: mrproliu <[email protected]>
AuthorDate: Wed Nov 16 16:03:48 2022 +0800

    Add `mesh-with-agent` feature for deploy agent service in service mesh (#90)
---
 .../platform/kubernetes/feature-cluster/resources.yaml |  4 ++--
 .../platform/kubernetes/feature-rover/profiling.yaml   | 14 +++++++-------
 .../platform/kubernetes/feature-rover/resources.yaml   |  4 ++--
 .../kubernetes/feature-single-node/resources.yaml      |  4 ++--
 deploy/platform/kubernetes/features.mk                 | 18 ++++++++++++++++++
 docs/readme.md                                         |  3 ++-
 6 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/deploy/platform/kubernetes/feature-cluster/resources.yaml 
b/deploy/platform/kubernetes/feature-cluster/resources.yaml
index 0dde196..ed91e5d 100644
--- a/deploy/platform/kubernetes/feature-cluster/resources.yaml
+++ b/deploy/platform/kubernetes/feature-cluster/resources.yaml
@@ -20,7 +20,7 @@
 apiVersion: v1
 data:
   metadata-service-mapping.yaml: |
-    serviceName: 
agentless::${LABELS."service.istio.io/canonical-name",LABELS."app.kubernetes.io/name",LABELS.app}
+    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:
@@ -210,7 +210,7 @@ spec:
             - 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: "agentless::${service.metadata.name}"
+              value: "mesh-svr::${service.metadata.name}"
             - name: SW_CONFIGURATION
               value: k8s-configmap
             - name: SW_ENVOY_METRIC_ALS_TCP_ANALYSIS
diff --git a/deploy/platform/kubernetes/feature-rover/profiling.yaml 
b/deploy/platform/kubernetes/feature-rover/profiling.yaml
index b3b29c2..a66e305 100644
--- a/deploy/platform/kubernetes/feature-rover/profiling.yaml
+++ b/deploy/platform/kubernetes/feature-rover/profiling.yaml
@@ -39,19 +39,19 @@ spec:
                 - -c
                 - >
                   /swctl --base-url=http://oap:12800/graphql profiling ebpf 
create fixed \
-                    --service-name agentless::recommendation --labels 
mesh-envoy --duration=9m --target-type ON_CPU;
+                    --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 \
-                    --service-name agentless::app --labels mesh-envoy 
--duration=9m --target-type ON_CPU;
+                    --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 \
-                    --service-name agentless::songs --labels mesh-envoy 
--duration=9m --target-type ON_CPU;
+                    --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 \
-                    --service-name agentless::gateway --labels mesh-envoy 
--duration=9m --target-type ON_CPU;
+                    --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 \
-                    --service-name agentless::songs --labels mesh-envoy 
--duration=9m --target-type OFF_CPU;
+                    --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 \
-                    --service-name=agentless::recommendation \
-                    --instance-name=$(/swctl 
--base-url=http://oap:12800/graphql instance ls --service-name 
agentless::recommendation|yq e '.[0].name' -);
+                    --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' -);
           restartPolicy: Never
diff --git a/deploy/platform/kubernetes/feature-rover/resources.yaml 
b/deploy/platform/kubernetes/feature-rover/resources.yaml
index f86bac1..a7fa9f8 100644
--- a/deploy/platform/kubernetes/feature-rover/resources.yaml
+++ b/deploy/platform/kubernetes/feature-rover/resources.yaml
@@ -55,9 +55,9 @@ spec:
             - name: ROVER_BACKEND_ADDR
               value: ${BACKEND_SERVICE}:11800
             - name: 
ROVER_PROCESS_DISCOVERY_KUBERNETES_ANALYZER_ISTIO_ENVOY_SERVICE_NAME
-              value: agentless::{{.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: agentless::{{.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}}
             - name: ROVER_HOST_MAPPING
diff --git a/deploy/platform/kubernetes/feature-single-node/resources.yaml 
b/deploy/platform/kubernetes/feature-single-node/resources.yaml
index 5d4a2ab..b5323d0 100644
--- a/deploy/platform/kubernetes/feature-single-node/resources.yaml
+++ b/deploy/platform/kubernetes/feature-single-node/resources.yaml
@@ -19,7 +19,7 @@
 apiVersion: v1
 data:
   metadata-service-mapping.yaml: |
-    serviceName: 
agentless::${LABELS."service.istio.io/canonical-name",LABELS."app.kubernetes.io/name",LABELS.app}
+    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:
@@ -139,7 +139,7 @@ spec:
             - 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: "agentless::${service.metadata.name}"
+              value: "mesh-svr::${service.metadata.name}"
             - name: SW_CONFIGURATION
               value: k8s-configmap
             - name: SW_ENABLE_ON_DEMAND_POD_LOG
diff --git a/deploy/platform/kubernetes/features.mk 
b/deploy/platform/kubernetes/features.mk
index 6b0e4b5..6e740f0 100644
--- a/deploy/platform/kubernetes/features.mk
+++ b/deploy/platform/kubernetes/features.mk
@@ -62,6 +62,24 @@ undeploy.feature-als: istioctl
        $(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:
diff --git a/docs/readme.md b/docs/readme.md
index e8c3762..6a616f3 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -103,7 +103,8 @@ Currently, the features supported are:
 | `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.                          
        |                                                                       
                                                                |
-| `apisix-monitor`          | Deploy OpenTelemetry and export APISIX metrics 
to SkyWalking for analysis and display on UI                               |    
                                                                                
                                                   |
+| `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.|
 
 ### Kubernetes
 

Reply via email to