Skip to content

Commit 0621ac2

Browse files
committed
Merge branch 'main' into v0.0
2 parents 23d0637 + 12e4dd6 commit 0621ac2

File tree

20 files changed

+174
-76
lines changed

20 files changed

+174
-76
lines changed

.github/workflows/composite/collectlogs/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
sudo chmod -R o+r /tmp/kind_logs
1616
1717
- name: Upload logs
18-
uses: actions/upload-artifact@v2
18+
uses: actions/upload-artifact@v4
1919
with:
2020
name: ${{ inputs.artifact-name }}
2121
path: /tmp/kind_logs/

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export KUBECONFIG=$(KUBECONFIG_PATH)
125125
KUSTOMIZE_VERSION ?= v5.0.0
126126
CONTROLLER_TOOLS_VERSION ?= v0.14.0
127127
KUBECTL_VERSION ?= v1.27.0
128-
GINKGO_VERSION ?= v2.11.0
128+
GINKGO_VERSION ?= v2.19.0
129129
KIND_VERSION ?= v0.23.0
130130
KIND_CLUSTER_NAME ?= frr-k8s
131131
HELM_VERSION ?= v3.12.3
@@ -237,7 +237,7 @@ $(APIDOCSGEN): $(LOCALBIN)
237237
GOBIN=$(LOCALBIN) go install github.com/elastic/crd-ref-docs@$(APIDOCSGEN_VERSION)
238238

239239
.PHONY: e2etests
240-
e2etests: ginkgo
240+
e2etests: ginkgo kubectl
241241
$(GINKGO) -v $(GINKGO_ARGS) --timeout=3h ./e2etests -- --kubectl=$(KUBECTL) $(TEST_ARGS)
242242

243243

charts/frr-k8s/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Kubernetes: `>= 1.19.0-0`
2727
| frrk8s.affinity | object | `{}` | |
2828
| frrk8s.alwaysBlock | string | `""` | |
2929
| frrk8s.disableCertRotation | bool | `false` | |
30+
| frrk8s.frr.acceptIncomingBGPConnections | bool | `false` | |
3031
| frrk8s.frr.image.pullPolicy | string | `nil` | |
3132
| frrk8s.frr.image.repository | string | `"quay.io/frrouting/frr"` | |
3233
| frrk8s.frr.image.tag | string | `"9.1.0"` | |
@@ -35,7 +36,6 @@ Kubernetes: `>= 1.19.0-0`
3536
| frrk8s.frr.resources | object | `{}` | |
3637
| frrk8s.frr.secureMetricsPort | int | `9141` | |
3738
| frrk8s.frrMetrics.resources | object | `{}` | |
38-
| frrk8s.healthPort | int | `8081` | |
3939
| frrk8s.image.pullPolicy | string | `nil` | |
4040
| frrk8s.image.repository | string | `"quay.io/metallb/frr-k8s"` | |
4141
| frrk8s.image.tag | string | `nil` | |

charts/frr-k8s/templates/controller.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ data:
5050
#
5151
vtysh_enable=yes
5252
zebra_options=" -A 127.0.0.1 -s 90000000"
53-
bgpd_options=" -A 127.0.0.1"
53+
bgpd_options=" -A 127.0.0.1 {{ if not .Values.frrk8s.frr.acceptIncomingBGPConnections }} -p 0 {{- end }}"
5454
ospfd_options=" -A 127.0.0.1"
5555
ospf6d_options=" -A ::1"
5656
ripd_options=" -A 127.0.0.1"
@@ -199,7 +199,6 @@ spec:
199199
{{- with .Values.frrk8s.logLevel }}
200200
- --log-level={{ . }}
201201
{{- end }}
202-
- --health-probe-bind-address={{.Values.prometheus.metricsBindAddress}}:{{ .Values.frrk8s.healthPort }}
203202
{{- if .Values.frrk8s.alwaysBlock }}
204203
- --always-block={{ .Values.frrk8s.alwaysBlock }}
205204
{{- end }}
@@ -222,8 +221,8 @@ spec:
222221
{{- if .Values.frrk8s.livenessProbe.enabled }}
223222
livenessProbe:
224223
httpGet:
225-
path: /healthz
226-
port: {{ .Values.frrk8s.healthPort }}
224+
path: /metrics
225+
port: monitoring
227226
host: {{ .Values.prometheus.metricsBindAddress }}
228227
initialDelaySeconds: {{ .Values.frrk8s.livenessProbe.initialDelaySeconds }}
229228
periodSeconds: {{ .Values.frrk8s.livenessProbe.periodSeconds }}
@@ -234,8 +233,8 @@ spec:
234233
{{- if .Values.frrk8s.readinessProbe.enabled }}
235234
readinessProbe:
236235
httpGet:
237-
path: /healthz
238-
port: {{ .Values.frrk8s.healthPort }}
236+
path: /metrics
237+
port: monitoring
239238
host: {{ .Values.prometheus.metricsBindAddress }}
240239
initialDelaySeconds: {{ .Values.frrk8s.readinessProbe.initialDelaySeconds }}
241240
periodSeconds: {{ .Values.frrk8s.readinessProbe.periodSeconds }}

charts/frr-k8s/templates/webhooks.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
- "--restart-on-rotator-secret-refresh=true"
4343
{{- end }}
4444
- "--namespace=$(NAMESPACE)"
45-
- --health-probe-bind-address=:8081
45+
- "--metrics-bind-address=:{{ .Values.prometheus.metricsPort }}"
4646
env:
4747
- name: NAMESPACE
4848
valueFrom:
@@ -59,20 +59,23 @@ spec:
5959
drop:
6060
- ALL
6161
readOnlyRootFilesystem: true
62+
ports:
63+
- containerPort: {{ .Values.prometheus.metricsPort }}
64+
name: monitoring
6265
{{- if .Values.frrk8s.livenessProbe.enabled }}
6366
livenessProbe:
6467
httpGet:
65-
path: /healthz
66-
port: 8081
68+
path: /metrics
69+
port: monitoring
6770
initialDelaySeconds: {{ .Values.frrk8s.livenessProbe.initialDelaySeconds }}
6871
periodSeconds: {{ .Values.frrk8s.livenessProbe.periodSeconds }}
6972
failureThreshold: {{ .Values.frrk8s.livenessProbe.failureThreshold }}
7073
{{- end }}
7174
{{- if .Values.frrk8s.readinessProbe.enabled }}
7275
readinessProbe:
7376
httpGet:
74-
path: /readyz
75-
port: 8081
77+
path: /metrics
78+
port: monitoring
7679
initialDelaySeconds: {{ .Values.frrk8s.readinessProbe.initialDelaySeconds }}
7780
periodSeconds: {{ .Values.frrk8s.readinessProbe.periodSeconds }}
7881
failureThreshold: {{ .Values.frrk8s.readinessProbe.failureThreshold }}

charts/frr-k8s/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ frrk8s:
128128
podAnnotations: {}
129129
labels:
130130
app: frr-k8s
131-
healthPort: 8081
132131
livenessProbe:
133132
enabled: true
134133
failureThreshold: 3
@@ -164,6 +163,7 @@ frrk8s:
164163
metricsPort: 7573
165164
resources: {}
166165
secureMetricsPort: 9141
166+
acceptIncomingBGPConnections: false
167167
reloader:
168168
resources: {}
169169
frrMetrics:

cmd/main.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
"sigs.k8s.io/controller-runtime/pkg/cache"
3838
"sigs.k8s.io/controller-runtime/pkg/client"
3939
"sigs.k8s.io/controller-runtime/pkg/event"
40-
"sigs.k8s.io/controller-runtime/pkg/healthz"
4140
"sigs.k8s.io/controller-runtime/pkg/log/zap"
4241
"sigs.k8s.io/controller-runtime/pkg/manager"
4342
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
@@ -70,7 +69,6 @@ func init() {
7069
func main() {
7170
var (
7271
metricsAddr string
73-
probeAddr string
7472
logLevel string
7573
nodeName string
7674
namespace string
@@ -84,7 +82,6 @@ func main() {
8482
)
8583

8684
flag.StringVar(&metricsAddr, "metrics-bind-address", "127.0.0.1:7572", "The address the metric endpoint binds to.")
87-
flag.StringVar(&probeAddr, "health-probe-bind-address", "127.0.0.1:8081", "The address the probe endpoint binds to.")
8885
flag.StringVar(&logLevel, "log-level", "info", fmt.Sprintf("log level. must be one of: [%s]", logging.Levels.String()))
8986
flag.StringVar(&nodeName, "node-name", "", "The node this daemon is running on.")
9087
flag.StringVar(&namespace, "namespace", "", "The namespace this daemon is deployed in")
@@ -114,7 +111,7 @@ func main() {
114111

115112
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
116113
Scheme: scheme,
117-
HealthProbeBindAddress: probeAddr,
114+
HealthProbeBindAddress: "", // we use the metrics endpoint for healthchecks
118115
Cache: cache.Options{
119116
ByObject: map[client.Object]cache.ByObject{
120117
&corev1.Secret{}: namespaceSelector,
@@ -139,15 +136,6 @@ func main() {
139136

140137
//+kubebuilder:scaffold:builder
141138

142-
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
143-
setupLog.Error(err, "unable to set up health check")
144-
os.Exit(1)
145-
}
146-
if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
147-
setupLog.Error(err, "unable to set up ready check")
148-
os.Exit(1)
149-
}
150-
151139
enableWebhook := webhookMode == "onlywebhook"
152140
startListeners := make(chan struct{})
153141
if enableWebhook && !disableCertRotation {

config/all-in-one/frr-k8s-prometheus.yaml

+13-11
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ data:
836836
#
837837
vtysh_enable=yes
838838
zebra_options=" -A 127.0.0.1 -s 90000000"
839-
bgpd_options=" -A 127.0.0.1"
839+
bgpd_options=" -A 127.0.0.1 -p 0"
840840
ospfd_options=" -A 127.0.0.1"
841841
ospf6d_options=" -A ::1"
842842
ripd_options=" -A 127.0.0.1"
@@ -963,7 +963,7 @@ spec:
963963
- --log-level=info
964964
- --webhook-mode=onlywebhook
965965
- --namespace=$(NAMESPACE)
966-
- --health-probe-bind-address=:8081
966+
- --metrics-bind-address=:7572
967967
command:
968968
- /frr-k8s
969969
env:
@@ -975,15 +975,18 @@ spec:
975975
imagePullPolicy: IfNotPresent
976976
livenessProbe:
977977
httpGet:
978-
path: /healthz
979-
port: 8081
978+
path: /metrics
979+
port: monitoring
980980
initialDelaySeconds: 15
981981
periodSeconds: 20
982982
name: frr-k8s-webhook-server
983+
ports:
984+
- containerPort: 7572
985+
name: monitoring
983986
readinessProbe:
984987
httpGet:
985-
path: /readyz
986-
port: 8081
988+
path: /metrics
989+
port: monitoring
987990
initialDelaySeconds: 5
988991
periodSeconds: 10
989992
resources:
@@ -1107,7 +1110,6 @@ spec:
11071110
drop:
11081111
- ALL
11091112
- args:
1110-
- --health-probe-bind-address=127.0.0.1:8081
11111113
- --metrics-bind-address=127.0.0.1:7572
11121114
- --node-name=$(NODE_NAME)
11131115
- --namespace=$(NAMESPACE)
@@ -1132,8 +1134,8 @@ spec:
11321134
livenessProbe:
11331135
httpGet:
11341136
host: 127.0.0.1
1135-
path: /healthz
1136-
port: 8081
1137+
path: /metrics
1138+
port: monitoring
11371139
initialDelaySeconds: 15
11381140
periodSeconds: 20
11391141
name: frr-k8s
@@ -1143,8 +1145,8 @@ spec:
11431145
readinessProbe:
11441146
httpGet:
11451147
host: 127.0.0.1
1146-
path: /readyz
1147-
port: 8081
1148+
path: /metrics
1149+
port: monitoring
11481150
initialDelaySeconds: 5
11491151
periodSeconds: 10
11501152
resources:

config/all-in-one/frr-k8s.yaml

+13-11
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ data:
805805
#
806806
vtysh_enable=yes
807807
zebra_options=" -A 127.0.0.1 -s 90000000"
808-
bgpd_options=" -A 127.0.0.1"
808+
bgpd_options=" -A 127.0.0.1 -p 0"
809809
ospfd_options=" -A 127.0.0.1"
810810
ospf6d_options=" -A ::1"
811811
ripd_options=" -A 127.0.0.1"
@@ -932,7 +932,7 @@ spec:
932932
- --log-level=info
933933
- --webhook-mode=onlywebhook
934934
- --namespace=$(NAMESPACE)
935-
- --health-probe-bind-address=:8081
935+
- --metrics-bind-address=:7572
936936
command:
937937
- /frr-k8s
938938
env:
@@ -944,15 +944,18 @@ spec:
944944
imagePullPolicy: IfNotPresent
945945
livenessProbe:
946946
httpGet:
947-
path: /healthz
948-
port: 8081
947+
path: /metrics
948+
port: monitoring
949949
initialDelaySeconds: 15
950950
periodSeconds: 20
951951
name: frr-k8s-webhook-server
952+
ports:
953+
- containerPort: 7572
954+
name: monitoring
952955
readinessProbe:
953956
httpGet:
954-
path: /readyz
955-
port: 8081
957+
path: /metrics
958+
port: monitoring
956959
initialDelaySeconds: 5
957960
periodSeconds: 10
958961
resources:
@@ -1076,7 +1079,6 @@ spec:
10761079
drop:
10771080
- ALL
10781081
- args:
1079-
- --health-probe-bind-address=127.0.0.1:8081
10801082
- --metrics-bind-address=127.0.0.1:7572
10811083
- --node-name=$(NODE_NAME)
10821084
- --namespace=$(NAMESPACE)
@@ -1101,8 +1103,8 @@ spec:
11011103
livenessProbe:
11021104
httpGet:
11031105
host: 127.0.0.1
1104-
path: /healthz
1105-
port: 8081
1106+
path: /metrics
1107+
port: monitoring
11061108
initialDelaySeconds: 15
11071109
periodSeconds: 20
11081110
name: frr-k8s
@@ -1112,8 +1114,8 @@ spec:
11121114
readinessProbe:
11131115
httpGet:
11141116
host: 127.0.0.1
1115-
path: /readyz
1116-
port: 8081
1117+
path: /metrics
1118+
port: monitoring
11171119
initialDelaySeconds: 5
11181120
periodSeconds: 10
11191121
resources:

config/default/frr-k8s_auth_proxy_patch.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ spec:
7373
- ALL
7474
- name: frr-k8s
7575
args:
76-
- "--health-probe-bind-address=127.0.0.1:8081"
7776
- "--metrics-bind-address=127.0.0.1:7572"
7877
- "--node-name=$(NODE_NAME)"
7978
- "--namespace=$(NAMESPACE)"

config/frr-k8s/frr-cm.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ data:
4646
#
4747
vtysh_enable=yes
4848
zebra_options=" -A 127.0.0.1 -s 90000000"
49-
bgpd_options=" -A 127.0.0.1"
49+
bgpd_options=" -A 127.0.0.1 -p 0"
5050
ospfd_options=" -A 127.0.0.1"
5151
ospf6d_options=" -A ::1"
5252
ripd_options=" -A 127.0.0.1"

config/frr-k8s/frr-k8s.yaml

+12-9
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ spec:
5757
readOnlyRootFilesystem: true
5858
livenessProbe:
5959
httpGet:
60-
path: /healthz
61-
port: 8081
60+
path: /metrics
61+
port: monitoring
6262
host: 127.0.0.1
6363
initialDelaySeconds: 15
6464
periodSeconds: 20
6565
readinessProbe:
6666
httpGet:
67-
path: /readyz
68-
port: 8081
67+
path: /metrics
68+
port: monitoring
6969
host: 127.0.0.1
7070
initialDelaySeconds: 5
7171
periodSeconds: 10
@@ -243,7 +243,7 @@ spec:
243243
- "--log-level=info"
244244
- "--webhook-mode=onlywebhook"
245245
- "--namespace=$(NAMESPACE)"
246-
- "--health-probe-bind-address=:8081"
246+
- "--metrics-bind-address=:7572"
247247
env:
248248
- name: NAMESPACE
249249
valueFrom:
@@ -258,16 +258,19 @@ spec:
258258
drop:
259259
- ALL
260260
readOnlyRootFilesystem: true
261+
ports:
262+
- containerPort: 7572
263+
name: monitoring
261264
livenessProbe:
262265
httpGet:
263-
path: /healthz
264-
port: 8081
266+
path: /metrics
267+
port: monitoring
265268
initialDelaySeconds: 15
266269
periodSeconds: 20
267270
readinessProbe:
268271
httpGet:
269-
path: /readyz
270-
port: 8081
272+
path: /metrics
273+
port: monitoring
271274
initialDelaySeconds: 5
272275
periodSeconds: 10
273276
# TODO(user): Configure the resources accordingly based on the project requirements.

0 commit comments

Comments
 (0)