Skip to content

Commit 7fba3e5

Browse files
committed
Add test case for enterprise BGP control plane
Rendered from template version: main (56dd2ee)
1 parent 92c5aac commit 7fba3e5

26 files changed

+1212
-4
lines changed

.cruft.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"template": "https://github.com/projectsyn/commodore-component-template.git",
3-
"commit": "98d16f99766e6c6d97322dbe42e058f0e2bf73d0",
3+
"commit": "56dd2ee980f197ec2c8b3977c16458e43d0c6ef2",
44
"checkout": "main",
55
"context": {
66
"cookiecutter": {
77
"name": "Cilium",
88
"slug": "cilium",
99
"parameter_key": "cilium",
10-
"test_cases": "defaults helm-opensource olm-opensource egress-gateway bgp-control-plane kubeproxyreplacement-strict l2-announcement clustermesh",
10+
"test_cases": "defaults helm-opensource olm-opensource egress-gateway bgp-control-plane kubeproxyreplacement-strict l2-announcement clustermesh enterprise-bgp",
1111
"add_lib": "n",
1212
"add_pp": "n",
1313
"add_golden": "y",
@@ -25,7 +25,7 @@
2525
"github_name": "component-cilium",
2626
"github_url": "https://github.com/projectsyn/component-cilium",
2727
"_template": "https://github.com/projectsyn/commodore-component-template.git",
28-
"_commit": "98d16f99766e6c6d97322dbe42e058f0e2bf73d0"
28+
"_commit": "56dd2ee980f197ec2c8b3977c16458e43d0c6ef2"
2929
}
3030
},
3131
"directory": null

.github/workflows/test.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- kubeproxyreplacement-strict
4141
- l2-announcement
4242
- clustermesh
43+
- enterprise-bgp
4344
defaults:
4445
run:
4546
working-directory: ${{ env.COMPONENT_NAME }}
@@ -62,6 +63,7 @@ jobs:
6263
- kubeproxyreplacement-strict
6364
- l2-announcement
6465
- clustermesh
66+
- enterprise-bgp
6567
defaults:
6668
run:
6769
working-directory: ${{ env.COMPONENT_NAME }}

Makefile.vars.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ KUBENT_IMAGE ?= ghcr.io/doitintl/kube-no-trouble:latest
5757
KUBENT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) --entrypoint=/app/kubent $(KUBENT_IMAGE)
5858

5959
instance ?= defaults
60-
test_instances = tests/defaults.yml tests/helm-opensource.yml tests/olm-opensource.yml tests/egress-gateway.yml tests/bgp-control-plane.yml tests/kubeproxyreplacement-strict.yml tests/l2-announcement.yml tests/clustermesh.yml
60+
test_instances = tests/defaults.yml tests/helm-opensource.yml tests/olm-opensource.yml tests/egress-gateway.yml tests/bgp-control-plane.yml tests/kubeproxyreplacement-strict.yml tests/l2-announcement.yml tests/clustermesh.yml tests/enterprise-bgp.yml

tests/enterprise-bgp.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
parameters:
2+
kapitan:
3+
dependencies:
4+
- type: https
5+
source: https://raw.githubusercontent.com/appuio/component-openshift4-monitoring/v6.11.3/lib/openshift4-monitoring-prom.libsonnet
6+
output_path: vendor/lib/prom.libsonnet
7+
- type: https
8+
source: https://raw.githubusercontent.com/appuio/component-openshift4-monitoring/v6.11.3/lib/openshift4-monitoring-alert-patching.libsonnet
9+
output_path: vendor/lib/alert-patching.libsonnet
10+
11+
cilium:
12+
install_method: olm
13+
release: enterprise
14+
__mock_enterprise: true
15+
olm:
16+
source:
17+
enterprise: https://github.com/isovalent/olm-for-cilium/archive/main.tar.gz
18+
19+
bgp:
20+
enabled: true
21+
enterprise: true
22+
cluster_configs:
23+
lb-services:
24+
nodeSelector:
25+
matchLabels:
26+
node-role.kubernetes.io/infra: ''
27+
bgpInstances:
28+
lbs:
29+
localASN: 64512
30+
peers:
31+
peer1:
32+
peerAddress: 192.0.2.2
33+
peerASN: 64512
34+
peerConfigRef:
35+
name: lb-services
36+
peer2:
37+
peerAddress: 192.0.2.3
38+
peerASN: 64512
39+
peerConfigRef:
40+
name: lb-services
41+
peer_configs:
42+
lb-services:
43+
spec:
44+
gracefulRestart:
45+
enabled: true
46+
restartTimeSeconds: 30
47+
families:
48+
unicast-v4:
49+
afi: ipv4
50+
safi: unicast
51+
advertisements:
52+
matchLabels:
53+
cilium.syn.tools/advertise: bgp

tests/golden/enterprise-bgp/cilium/apps/cilium.yaml

Whitespace-only changes.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
annotations: {}
5+
labels:
6+
name: syn-cilium-view
7+
rbac.authorization.k8s.io/aggregate-to-admin: 'true'
8+
rbac.authorization.k8s.io/aggregate-to-edit: 'true'
9+
rbac.authorization.k8s.io/aggregate-to-view: 'true'
10+
name: syn-cilium-view
11+
rules:
12+
- apiGroups:
13+
- cilium.io
14+
resources:
15+
- ciliumnetworkpolicies
16+
- ciliumendpoints
17+
verbs:
18+
- get
19+
- list
20+
- watch
21+
---
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
kind: ClusterRole
24+
metadata:
25+
annotations: {}
26+
labels:
27+
name: syn-cilium-edit
28+
rbac.authorization.k8s.io/aggregate-to-admin: 'true'
29+
rbac.authorization.k8s.io/aggregate-to-edit: 'true'
30+
name: syn-cilium-edit
31+
rules:
32+
- apiGroups:
33+
- cilium.io
34+
resources:
35+
- ciliumnetworkpolicies
36+
verbs:
37+
- create
38+
- delete
39+
- deletecollection
40+
- patch
41+
- update
42+
---
43+
apiVersion: rbac.authorization.k8s.io/v1
44+
kind: ClusterRole
45+
metadata:
46+
annotations: {}
47+
labels:
48+
name: syn-cilium-cluster-reader
49+
rbac.authorization.k8s.io/aggregate-to-cluster-reader: 'true'
50+
name: syn-cilium-cluster-reader
51+
rules:
52+
- apiGroups:
53+
- cilium.io
54+
resources:
55+
- '*'
56+
verbs:
57+
- get
58+
- list
59+
- watch
60+
- apiGroups:
61+
- isovalent.com
62+
resources:
63+
- '*'
64+
verbs:
65+
- get
66+
- list
67+
- watch
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: PrometheusRule
3+
metadata:
4+
annotations: {}
5+
labels:
6+
name: cilium-ebpf
7+
name: cilium-ebpf
8+
spec:
9+
groups:
10+
- name: cilium-ebpf.rules
11+
rules:
12+
- alert: CiliumBpfMapUtilizationHigh
13+
annotations:
14+
description: |
15+
BPF map utilization for map {{ $labels.map_name }} has been above
16+
50% on node {{ $labels.node }} for the last 10m.
17+
message: High BPF map utilization on {{ $labels.node }}
18+
runbook_url: https://hub.syn.tools/cilium/runbooks/CiliumBpfMapPressureHigh.html
19+
expr: cilium_bpf_map_pressure > 0.5
20+
for: 10m
21+
labels:
22+
severity: warning
23+
- alert: CiliumBpfMapUtilizationExtremelyHigh
24+
annotations:
25+
description: |
26+
BPF map utilization for map {{ $labels.map_name }} has been above
27+
90% on node {{ $labels.node }} for the last 10m.
28+
message: Extremely High BPF map utilization on {{ $labels.node }}
29+
runbook_url: https://hub.syn.tools/cilium/runbooks/CiliumBpfMapPressureExtremelyHigh.html
30+
expr: cilium_bpf_map_pressure > 0.9
31+
for: 10m
32+
labels:
33+
severity: critical
34+
- alert: CiliumBpfOperationErrorRateHigh
35+
annotations:
36+
description: |
37+
BPF error rate for map {{ $labels.map_name }} has been above
38+
50% on node {{ $labels.node }} for the last 10m.
39+
message: High BPF error rate on {{ $labels.node }}
40+
runbook_url: https://hub.syn.tools/cilium/runbooks/CiliumBpfOperationErrorRateHigh.html
41+
expr: (rate(cilium_bpf_map_ops_total{outcome="fail"}[1m]) / rate(cilium_bpf_map_ops_total{}[1m]))
42+
> 0.5
43+
for: 10m
44+
labels:
45+
severity: critical
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: isovalent.com/v1alpha1
2+
kind: IsovalentBGPClusterConfig
3+
metadata:
4+
annotations:
5+
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
6+
labels:
7+
name: lb-services
8+
name: lb-services
9+
spec:
10+
bgpInstances:
11+
- localASN: 64512
12+
name: lbs
13+
peers:
14+
- name: peer1
15+
peerASN: 64512
16+
peerAddress: 192.0.2.2
17+
peerConfigRef:
18+
name: lb-services
19+
- name: peer2
20+
peerASN: 64512
21+
peerAddress: 192.0.2.3
22+
peerConfigRef:
23+
name: lb-services
24+
nodeSelector:
25+
matchLabels:
26+
node-role.kubernetes.io/infra: ''
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: isovalent.com/v1alpha1
2+
kind: IsovalentBGPPeerConfig
3+
metadata:
4+
annotations:
5+
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
6+
labels:
7+
name: lb-services
8+
name: lb-services
9+
spec:
10+
families:
11+
- advertisements:
12+
matchLabels:
13+
cilium.syn.tools/advertise: bgp
14+
afi: ipv4
15+
safi: unicast
16+
gracefulRestart:
17+
enabled: true
18+
restartTimeSeconds: 30
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
annotations:
5+
argocd.argoproj.io/hook: PreSync
6+
labels:
7+
name: cleanup-old-clusterserviceversions
8+
name: cleanup-old-clusterserviceversions
9+
namespace: cilium
10+
rules:
11+
- apiGroups:
12+
- operators.coreos.com
13+
resources:
14+
- clusterserviceversions
15+
verbs:
16+
- get
17+
- list
18+
- delete
19+
---
20+
apiVersion: v1
21+
kind: ServiceAccount
22+
metadata:
23+
annotations:
24+
argocd.argoproj.io/hook: PreSync
25+
labels:
26+
name: cleanup-old-clusterserviceversions
27+
name: cleanup-old-clusterserviceversions
28+
namespace: cilium
29+
---
30+
apiVersion: rbac.authorization.k8s.io/v1
31+
kind: RoleBinding
32+
metadata:
33+
annotations:
34+
argocd.argoproj.io/hook: PreSync
35+
labels:
36+
name: cleanup-old-clusterserviceversions
37+
name: cleanup-old-clusterserviceversions
38+
namespace: cilium
39+
roleRef:
40+
apiGroup: rbac.authorization.k8s.io
41+
kind: Role
42+
name: cleanup-old-clusterserviceversions
43+
subjects:
44+
- kind: ServiceAccount
45+
name: cleanup-old-clusterserviceversions
46+
namespace: cilium
47+
---
48+
apiVersion: batch/v1
49+
kind: Job
50+
metadata:
51+
annotations:
52+
argocd.argoproj.io/hook: PreSync
53+
argocd.argoproj.io/hook-delete-policy: HookSucceeded
54+
labels:
55+
name: cleanup-old-clusterserviceversions
56+
name: cleanup-old-clusterserviceversions
57+
namespace: cilium
58+
spec:
59+
completions: 1
60+
parallelism: 1
61+
template:
62+
metadata:
63+
labels:
64+
name: cleanup-old-clusterserviceversions
65+
spec:
66+
containers:
67+
- args:
68+
- |
69+
kubectl -n cilium get clusterserviceversion -ojson \
70+
| jq '.items[] | select(.spec.version | test("^1.15.1[+]") | not) | .metadata.name' \
71+
| xargs --no-run-if-empty kubectl -n cilium delete clusterserviceversions
72+
command:
73+
- sh
74+
- -c
75+
env:
76+
- name: HOME
77+
value: /home
78+
image: docker.io/bitnami/kubectl:1.30.7@sha256:1249fc292e84a38575ee0cadc3e28dcd7ddf5a3a4e5da401b1a8599e8ac52a1b
79+
imagePullPolicy: IfNotPresent
80+
name: cleanup-old-clusterserviceversions
81+
ports: []
82+
stdin: false
83+
tty: false
84+
volumeMounts:
85+
- mountPath: /home
86+
name: home
87+
workingDir: /home
88+
imagePullSecrets: []
89+
initContainers: []
90+
restartPolicy: OnFailure
91+
serviceAccountName: cleanup-old-clusterserviceversions
92+
terminationGracePeriodSeconds: 30
93+
volumes:
94+
- emptyDir: {}
95+
name: home

0 commit comments

Comments
 (0)