Skip to content

Commit

Permalink
Support E2E Testing Cilium Services (apache#12412)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu committed Jul 4, 2024
1 parent fb6f352 commit e96b75f
Show file tree
Hide file tree
Showing 19 changed files with 648 additions and 27 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/skywalking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,9 @@ jobs:

- name: OTLP Trace
config: test/e2e-v2/cases/otlp-traces/e2e.yaml

- name: Cilium Service
config: test/e2e-v2/cases/cilium/e2e.yaml
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -720,7 +723,7 @@ jobs:
if: matrix.test.docker != null
run: docker build -t ${{ matrix.test.docker.name }} -f ${{ matrix.test.docker.base }}/${{ matrix.test.docker.file }} ${{ matrix.test.docker.base }}
- name: ${{ matrix.test.name }}
uses: apache/skywalking-infra-e2e@0a5b398fc9668ccb848b16e6da4f09180955dc3e
uses: apache/skywalking-infra-e2e@7f6b0da20f170b181a79cf89ef7d47848ac34138
with:
e2e-file: $GITHUB_WORKSPACE/${{ matrix.test.config }}
- if: ${{ failure() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ private void reBuildUsingNodes(List<CiliumNode> shouldUsingNodes) {
}
});

newNodes.sort(Comparator.comparing(CiliumNode::getAddress));
this.usingNodes = ImmutableList.copyOf(newNodes);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"type": "Widget",
"expressions": [
"cilium_endpoint_protocol_http_status_1xx_cpm",
"cilium_endpoint_protocol_http_status_2xx_cpm",
"cilium_endpoint_protocol_http_status_3xx_cpm",
"cilium_endpoint_protocol_http_status_4xx_cpm",
"cilium_endpoint_protocol_http_status_5xx_cpm"
Expand All @@ -98,9 +97,6 @@
{
"label": "1xx"
},
{
"label": "2xx"
},
{
"label": "3xx"
},
Expand All @@ -112,7 +108,7 @@
}
],
"widget": {
"title": "HTTP Response Code(Count per min)"
"title": "HTTP Non-2xx Response Code(Count per min)"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"type": "Widget",
"expressions": [
"cilium_service_instance_relation_protocol_http_status_1xx_cpm",
"cilium_service_instance_relation_protocol_http_status_2xx_cpm",
"cilium_service_instance_relation_protocol_http_status_3xx_cpm",
"cilium_service_instance_relation_protocol_http_status_4xx_cpm",
"cilium_service_instance_relation_protocol_http_status_5xx_cpm"
Expand All @@ -318,15 +317,12 @@
"showYAxis": true
},
"widget": {
"title": "HTTP Response Status Server Side(Count Per Min)"
"title": "HTTP Non-2xx Response Status Server Side(Count Per Min)"
},
"metricConfig": [
{
"label": "1xx"
},
{
"label": "2xx"
},
{
"label": "3xx"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
"type": "Widget",
"expressions": [
"cilium_service_instance_protocol_http_status_1xx_cpm",
"cilium_service_instance_protocol_http_status_2xx_cpm",
"cilium_service_instance_protocol_http_status_3xx_cpm",
"cilium_service_instance_protocol_http_status_4xx_cpm",
"cilium_service_instance_protocol_http_status_5xx_cpm"
Expand All @@ -205,9 +204,6 @@
{
"label": "1xx"
},
{
"label": "2xx"
},
{
"label": "3xx"
},
Expand All @@ -219,7 +215,7 @@
}
],
"widget": {
"title": "HTTP Response Code(Count per min)"
"title": "HTTP Non-2xx Response Code(Count per min)"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"type": "Widget",
"expressions": [
"cilium_service_relation_protocol_http_status_1xx_cpm",
"cilium_service_relation_protocol_http_status_2xx_cpm",
"cilium_service_relation_protocol_http_status_3xx_cpm",
"cilium_service_relation_protocol_http_status_4xx_cpm",
"cilium_service_relation_protocol_http_status_5xx_cpm"
Expand All @@ -318,15 +317,12 @@
"showYAxis": true
},
"widget": {
"title": "HTTP Response Status Server Side(Count Per Min)"
"title": "HTTP Non-2xx Response Status Server Side(Count Per Min)"
},
"metricConfig": [
{
"label": "1xx"
},
{
"label": "2xx"
},
{
"label": "3xx"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
"type": "Widget",
"expressions": [
"cilium_service_protocol_http_status_1xx_cpm",
"cilium_service_protocol_http_status_2xx_cpm",
"cilium_service_protocol_http_status_3xx_cpm",
"cilium_service_protocol_http_status_4xx_cpm",
"cilium_service_protocol_http_status_5xx_cpm"
Expand All @@ -205,9 +204,6 @@
{
"label": "1xx"
},
{
"label": "2xx"
},
{
"label": "3xx"
},
Expand All @@ -219,7 +215,7 @@
}
],
"widget": {
"title": "HTTP Response Code(Count per min)"
"title": "HTTP Non-2xx Response Code(Count per min)"
}
},
{
Expand Down
161 changes: 161 additions & 0 deletions test/e2e-v2/cases/cilium/cilium-network-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# 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: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "rule3"
spec:
description: "L7 policy to restrict access to specific HTTP call"
endpointSelector:
matchLabels:
app: productpage
ingress:
- fromEndpoints:
- matchLabels:
"k8s:app": details
- matchLabels:
"k8s:app": reviews
- matchLabels:
"k8s:app": trafficgenerator
egress:
- toEndpoints:
- matchLabels:
"k8s:io.kubernetes.pod.namespace": kube-system
"k8s:k8s-app": kube-dns
toPorts:
- ports:
- port: "53"
protocol: ANY
rules:
dns:
- matchPattern: "*"
- toEndpoints:
- matchLabels:
"k8s:app": trafficgenerator
- matchLabels:
"k8s:app": details
- matchLabels:
"k8s:app": reviews
toPorts:
- ports:
- port: "9080"
protocol: TCP
rules:
http:
- method: ""
path: ""

---

apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "rule5"
spec:
description: "L7 policy to restrict access to specific HTTP call"
endpointSelector:
matchLabels:
app: reviews
ingress:
- fromEndpoints:
- matchLabels:
"k8s:app": productpage
- matchLabels:
"k8s:app": ratings
- matchLabels:
"k8s:io.kubernetes.pod.namespace": kube-system
"k8s:k8s-app": kube-dns
- toPorts:
- ports:
- port: "9080"
protocol: TCP
rules:
http:
- method: ""
path: ""
egress:
- toEndpoints:
- matchLabels:
"k8s:io.kubernetes.pod.namespace": kube-system
"k8s:k8s-app": kube-dns
toPorts:
- ports:
- port: "53"
protocol: ANY
rules:
dns:
- matchPattern: "*"
- toEndpoints:
- matchLabels:
"k8s:app": productpage
- matchLabels:
"k8s:app": ratings
toPorts:
- ports:
- port: "9080"
protocol: TCP
rules:
http:
- method: ""
path: ""

---

apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "rule4"
spec:
description: "L7 policy to restrict access to specific HTTP call"
endpointSelector:
matchLabels:
app: trafficgenerator
ingress:
- fromEndpoints:
- matchLabels:
"k8s:app": productpage
- toPorts:
- ports:
- port: "9080"
protocol: TCP
rules:
http:
- method: ""
path: ""
egress:
- toEndpoints:
- matchLabels:
"k8s:io.kubernetes.pod.namespace": kube-system
"k8s:k8s-app": kube-dns
toPorts:
- ports:
- port: "53"
protocol: ANY
rules:
dns:
- matchPattern: "*"
- toEndpoints:
- matchLabels:
"k8s:app": productpage
toPorts:
- ports:
- port: "9080"
protocol: TCP
rules:
http:
- method: ""
path: ""
Loading

0 comments on commit e96b75f

Please sign in to comment.