Skip to content

Commit

Permalink
Add the swck e2e test.
Browse files Browse the repository at this point in the history
Signed-off-by: Ye Cao <[email protected]>
  • Loading branch information
dashanji committed Apr 27, 2024
1 parent fe9c62a commit cc8a6b6
Show file tree
Hide file tree
Showing 18 changed files with 626 additions and 20 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/e2e.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@ jobs:
config: test/e2e/e2e-banyandb-standalone.yaml
- name: Run Skywalking E2E Test (BanyanDB cluster as database)
config: test/e2e/e2e-banyandb-cluster.yaml
- name: Run SWCK E2E Test
config: test/e2e/swck/e2e.yaml
- name: Run SWCK oap-agent-adapter-hpa Test
config: test/e2e/swck/oap-agent-adapter-hpa.yaml
- name: Run SWCK oap-agent-banyandb Test
config: test/e2e/swck/oap-agent-banyandb.yaml
- name: Run SWCK oap-ui-agent-elasticsearch Test
config: test/e2e/swck/oap-ui-agent-elasticsearch.yaml
- name: Run SWCK oap-ui-agent-oapserverconfig Test
config: test/e2e/swck/oap-ui-agent-oapserverconfig.yaml
- name: Run SWCK oap-ui-agent-satellite Test
config: test/e2e/swck/oap-ui-agent-satellite.yaml
name: ${{ matrix.test.name }}
env:
OAP_TAG: 965dea898986ed2ab1343559fb20d6faed11ada9
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Release Notes.
------------------

- Integrate BanyanDB as storage solution
- Bump up swck to v0.8.0
- Bump up swck to v0.9.0

4.5.0
------------------
Expand Down
2 changes: 1 addition & 1 deletion chart/adapter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
apiVersion: v2
name: skywalking-helm-swck-adapter
home: https://github.com/apache/skywalking-swck/tree/master/adapter
version: 0.8.0
version: 0.9.0
description: Provide custom metrics coming from SkyWalking OAP cluster for autoscaling by Kubernetes HPA
icon: https://raw.githubusercontent.com/apache/skywalking-kubernetes/master/logo/sw-logo-for-chart.jpg
sources:
Expand Down
2 changes: 1 addition & 1 deletion chart/adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following table lists the configurable parameters of the adapter chart and t
| `.serviceAccountName` | The service account name of adapter | `skywalking-custom-metrics-apiserver` |
| `.image.repository` | Adapter container image name | `docker.io/apache/skywalking-swck` |
| `.image.pullPolicy` | Adapter container image pull policy | `IfNotPresent` |
| `.image.tag` | Adapter container image tag | `v0.8.0` |
| `.image.tag` | Adapter container image tag | `v0.9.0` |
| `.service.port` | The port for the adapter service | `6.1.0` |
| `.oap.service.name` | The service name of OAP | `skywalking-system-oap` |
| `.oap.service.namespace` | The service namespace of OAP | `skywalking-system` |
Expand Down
1 change: 0 additions & 1 deletion chart/adapter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ spec:
containers:
- args:
- --secure-port={{ .Values.service.port }}
- --logtostderr=true
- --v=10
- --oap-addr=http://{{ .Values.oap.service.name }}.{{ .Values.oap.service.namespace }}:{{ .Values.oap.service.port }}/graphql
- --cert-dir=/tmp
Expand Down
2 changes: 1 addition & 1 deletion chart/adapter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ serviceAccountName: skywalking-custom-metrics-apiserver
image:
repository: docker.io/apache/skywalking-swck
pullPolicy: IfNotPresent
tag: "v0.8.0"
tag: "v0.9.0"
service:
port: 6443
oap:
Expand Down
2 changes: 1 addition & 1 deletion chart/operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
apiVersion: v2
name: skywalking-helm-swck-operator
home: https://github.com/apache/skywalking-swck/tree/master/operator
version: 0.8.0
version: 0.9.0
description: Provision and maintain SkyWalking backend components
icon: https://raw.githubusercontent.com/apache/skywalking-kubernetes/master/logo/sw-logo-for-chart.jpg
sources:
Expand Down
2 changes: 1 addition & 1 deletion chart/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The following table lists the configurable parameters of the operator chart and
| `.serviceAccountName` | The service account name of operator | `skywalking-swck-controller-manager` |
| `.image.repository` | Operator container image name | `docker.io/apache/skywalking-swck` |
| `.image.pullPolicy` | Operator container image pull policy | `IfNotPresent` |
| `.image.tag` | Operator container image tag | `v0.8.0` |
| `.image.tag` | Operator container image tag | `v0.9.0` |
| `.metrics.service.port` | The port for the operator metrics service | `8443` |
| `.webhook.service.port` | The port for the operator web hook service | `9443` |
| `.resources.limits.cpu` | The limits of cpu in the operator | `200m` |
Expand Down
43 changes: 37 additions & 6 deletions chart/operator/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: {{ include "operator.fullname" . | trunc (int (sub 63 (len "-manager-role"))) | printf "%s-manager-role" }}
name: skywalking-swck-manager-role
rules:
- apiGroups:
- certificates.k8s.io
Expand All @@ -86,18 +85,24 @@ rules:
- apiGroups:
- ""
resources:
- configmaps/status
- events
verbs:
- get
- create
- patch
- update
- apiGroups:
- ""
resources:
- events
- persistentvolumeclaims
- serviceaccounts
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -196,6 +201,32 @@ rules:
- patch
- update
- watch
- apiGroups:
- operator.skywalking.apache.org
resources:
- banyandbs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- operator.skywalking.apache.org
resources:
- banyandbs/finalizers
verbs:
- update
- apiGroups:
- operator.skywalking.apache.org
resources:
- banyandbs/status
verbs:
- get
- patch
- update
- apiGroups:
- operator.skywalking.apache.org
resources:
Expand Down
19 changes: 19 additions & 0 deletions test/e2e/expected/endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.

{{- contains .}}
- id: {{ b64enc "Your_ApplicationName" }}.1_{{ b64enc "GET:/hello" }}
name: 'GET:/hello'
{{- end}}
25 changes: 25 additions & 0 deletions test/e2e/expected/metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.

{{- contains . }}
- key: {{ notEmpty .key }}
value:
value: {{ gt .value.value 0 }}
isemptyvalue: false
- key: {{ notEmpty .key }}
value:
value: 0
isemptyvalue: true
{{- end }}
25 changes: 25 additions & 0 deletions test/e2e/expected/service-apdex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.

{{- contains . }}
- key: {{ notEmpty .key }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ gt .value.value 0 }}
isemptyvalue: false
{{- end }}
26 changes: 26 additions & 0 deletions test/e2e/expected/swck-demo-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Licensed to 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. Apache Software Foundation (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.

{{- contains . }}
- id: {{ b64enc "Your_ApplicationName" }}.1
name: Your_ApplicationName
group: ""
shortname: "Your_ApplicationName"
layers:
- GENERAL
normal: true
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

setup:
env: kind
file: ../kind.yaml
Expand Down Expand Up @@ -51,22 +66,22 @@ setup:
- name: Setup oapserver and ui
command: |
kubectl create namespace skywalking-system
curl https://raw.githubusercontent.com/apache/skywalking-swck/v0.8.0/test/e2e/skywalking-components.yaml | grep -B20 "\-\-\-" | kubectl apply -f -
curl https://raw.githubusercontent.com/apache/skywalking-swck/v0.9.0/test/e2e/skywalking-components.yaml | grep -B20 "\-\-\-" | kubectl apply -f -
wait:
- namespace: skywalking-system
resource: OAPServer/skywalking-system
for: condition=Available
- name: Setup java agent demo
command: |
kubectl label namespace skywalking-system swck-injection=enabled
curl https://raw.githubusercontent.com/apache/skywalking-swck/v0.8.0/test/e2e/demo.yaml | sed 's/oap-service/skywalking-system-oap.skywalking-system/' | kubectl apply -f -
curl https://raw.githubusercontent.com/apache/skywalking-swck/v0.9.0/test/e2e/demo.yaml | sed 's/oap-service/skywalking-system-oap.skywalking-system/' | kubectl apply -f -
wait:
- namespace: skywalking-system
resource: deployment/demo
for: condition=Available
- name: Setup the hpa of java agent demo
command: |
curl https://raw.githubusercontent.com/apache/skywalking-swck/v0.8.0/test/e2e/hpa-demo.yaml | kubectl apply -f -
curl https://raw.githubusercontent.com/apache/skywalking-swck/v0.9.0/test/e2e/hpa-demo.yaml | kubectl apply -f -
timeout: 20m

cleanup:
Expand All @@ -84,9 +99,9 @@ verify:
# verify with retry strategy
retry:
# max retry count
count: 20
count: 30
# the interval between two attempts, e.g. 10s, 1m.
interval: 20s
interval: 10s
cases:
- query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name service_cpm --service-name Your_ApplicationName | yq e 'to_entries' -
expected: ../expected/hpa-metrics.yaml
Expand Down
Loading

0 comments on commit cc8a6b6

Please sign in to comment.