Skip to content

Commit 0f6157d

Browse files
authored
Add baseline feature into Kubernetes (apache#205)
1 parent 0c64e7c commit 0f6157d

File tree

4 files changed

+100
-0
lines changed

4 files changed

+100
-0
lines changed

Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,7 @@ SW_R3_IMAGE_TAG ?= 0.1.0
6666
CILIUM_VERSION ?= 1.13.4
6767
CILIUM_CLI_VERSION ?= v0.15.0
6868

69+
SW_PREDICTOR_IMAGE ?= ghcr.io/skyapm/skypredictor:66cd881d8316e7bd958a2172a99d2fc33f707150
70+
6971
# ALL variables should be listed above ^^
7072
EXPORTED_VARS := $(filter-out <%,$(.VARIABLES))

deploy/platform/kubernetes/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ HELM_OPTIONS := $(HELM_OPTIONS) --set features.rover.image=$(SW_ROVER_IMAGE)
6161
HELM_OPTIONS := $(HELM_OPTIONS) --set features.grafana.image=$(GRAFANA_IMAGE)
6262
HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking.grafana.plugin.version=$(SW_GRAFANA_PLUGIN_VERSION)
6363
HELM_OPTIONS := $(HELM_OPTIONS) --set features.r3.image=$(SW_R3_IMAGE):$(SW_R3_IMAGE_TAG)
64+
HELM_OPTIONS := $(HELM_OPTIONS) --set features.baseline.image=$(SW_PREDICTOR_IMAGE)
6465

6566
ifeq ($(DEBUG),true)
6667
HELM_OPTIONS := $(HELM_OPTIONS) --dry-run --debug
@@ -220,6 +221,10 @@ feature-activemq-monitor:
220221
$(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.activemqMonitor.enabled=true)
221222
$(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
222223

224+
.PHONY: feature-baseline
225+
feature-baseline:
226+
$(eval HELM_OPTIONS := $(HELM_OPTIONS) --set features.baseline.enabled=true --set skywalking.oap.env.SW_API_PIPELINE_BASELINE_SERVICE_HOST=$(RELEASE)-baseline.$(NAMESPACE).svc.cluster.local)
227+
223228
.PHONY: cilium
224229
cilium:
225230
ifeq (, $(shell which cilium))
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright 2025 SkyAPM org
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
{{- if .Values.features.baseline.enabled }}
16+
apiVersion: v1
17+
kind: PersistentVolumeClaim
18+
metadata:
19+
name: predictor-data
20+
spec:
21+
accessModes:
22+
- ReadWriteOnce
23+
resources:
24+
requests:
25+
# PVC storage size
26+
storage: "10Gi"
27+
28+
---
29+
30+
apiVersion: apps/v1
31+
kind: Deployment
32+
metadata:
33+
name: skywalking-predictor
34+
namespace: {{ .Release.Namespace }}
35+
spec:
36+
selector:
37+
matchLabels:
38+
name: skywalking-predictor
39+
template:
40+
metadata:
41+
labels:
42+
name: skywalking-predictor
43+
spec:
44+
containers:
45+
- name: skywalking-predictor
46+
image: {{ .Values.features.baseline.image }}
47+
ports:
48+
- containerPort: 18080
49+
name: grpc
50+
- containerPort: 8000
51+
name: prometheus
52+
env:
53+
- name: BASELINE_FETCH_SERVER_ENDPOINT
54+
value: {{ template "skywalking.oap.address.http" . }}
55+
- name: BASELINE_FETCH_CRON
56+
value: "10 */8 * * *"
57+
- name: BASELINE_FETCH_METRICS
58+
value: "service_resp_time,service_sla,service_cpm,service_percentile,service_apdex"
59+
- name: BASELINE_FETCH_SERVER_LAYERS
60+
value: "GENERAL,MESH"
61+
- name: LOGGING_LEVEL
62+
value: DEBUG
63+
livenessProbe:
64+
initialDelaySeconds: 30
65+
periodSeconds: 30
66+
tcpSocket:
67+
port: grpc
68+
timeoutSeconds: 1
69+
volumeMounts:
70+
- mountPath: /predictor-data
71+
name: predictor-data
72+
volumes:
73+
- name: predictor-data
74+
persistentVolumeClaim:
75+
claimName: predictor-data
76+
77+
---
78+
79+
apiVersion: v1
80+
kind: Service
81+
metadata:
82+
name: {{ .Values.skywalking.fullnameOverride }}-baseline
83+
namespace: {{ .Release.Namespace }}
84+
spec:
85+
selector:
86+
name: skywalking-predictor
87+
ports:
88+
- port: 18080
89+
protocol: TCP
90+
targetPort: grpc
91+
92+
{{- end }}

docs/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Currently, the features supported are:
116116
| `rabbitmq-monitor` | Deploy OpenTelemetry and export RabbitMQ monitoring metrics to SkyWalking for analysis and display on UI. | |
117117
| `activemq-monitor` | Deploy OpenTelemetry and export [ActiveMQ classic](https://activemq.apache.org/components/classic/) monitoring metrics to SkyWalking for analysis and display on UI. | |
118118
| `cilium` | Deploy Cilium and showcase services in a separate namespace, SkyWalking fetch Cilium Services Traffic to analysis and display on UI. | Only support deployment in the Kubernetes environment, docker is not supported. |
119+
| `baseline` | Deploy [SkyPredictor](https://github.com/SkyAPM/SkyPredictor) as baseline calculator to predict metrics. | Only support deployment in the Kubernetes environment, docker is not supported. |
119120

120121
### Kubernetes
121122

0 commit comments

Comments
 (0)