Skip to content

Commit 06036a6

Browse files
committed
Replace gRPC health probe utility with k8s built-in health probe
Kubernetes 1.23 has introduced native health probes for gRPC which can replace grpc_health_probe utility. This commit removes baking in grpc_health_probe binary into the image and updates related health checks to use k8s native gRPC. Signed-off-by: Muyassarov, Feruzjon <[email protected]>
1 parent a4cea16 commit 06036a6

File tree

6 files changed

+12
-39
lines changed

6 files changed

+12
-39
lines changed

Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ ARG BASE_IMAGE_MINIMAL
55
# Build node feature discovery
66
FROM ${BUILDER_IMAGE} as builder
77

8-
# Build and install the grpc-health-probe binary
9-
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.19 && \
10-
go install -tags osusergo,netgo -ldflags -extldflags=-static \
11-
github.com/grpc-ecosystem/grpc-health-probe@${GRPC_HEALTH_PROBE_VERSION} \
12-
# Rename it as it's referenced as grpc_health_probe in the deployment yamls
13-
# and in its own project https://github.com/grpc-ecosystem/grpc-health-probe
14-
&& mv /go/bin/grpc-health-probe /go/bin/grpc_health_probe
15-
168
# Get (cache) deps in a separate layer
179
COPY go.mod go.sum /go/node-feature-discovery/
1810

deployment/base/master-worker-combined/master-worker-daemonset.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ spec:
2121
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
2222
imagePullPolicy: Always
2323
livenessProbe:
24-
exec:
25-
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
24+
grpc:
25+
port: 8080
2626
initialDelaySeconds: 10
2727
periodSeconds: 10
2828
readinessProbe:
29-
exec:
30-
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
29+
grpc:
30+
port: 8080
3131
initialDelaySeconds: 5
3232
periodSeconds: 10
3333
failureThreshold: 10

deployment/base/master/master-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ spec:
2222
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
2323
imagePullPolicy: Always
2424
livenessProbe:
25-
exec:
26-
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
25+
grpc:
26+
port: 8080
2727
initialDelaySeconds: 10
2828
periodSeconds: 10
2929
readinessProbe:
30-
exec:
31-
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
30+
grpc:
31+
port: 8080
3232
initialDelaySeconds: 5
3333
periodSeconds: 10
3434
failureThreshold: 10

deployment/helm/node-feature-discovery/templates/cert-manager-certs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ spec:
1717
# first one is configured for use by the worker; below are for completeness
1818
- {{ include "node-feature-discovery.fullname" . }}-master.{{ include "node-feature-discovery.namespace" . }}.svc
1919
- {{ include "node-feature-discovery.fullname" . }}-master.{{ include "node-feature-discovery.namespace" . }}.svc.cluster.local
20-
# localhost needed for grpc_health_probe
21-
- localhost
2220
issuerRef:
2321
name: nfd-ca-issuer
2422
kind: Issuer

deployment/helm/node-feature-discovery/templates/master.yaml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,13 @@ spec:
4141
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4242
imagePullPolicy: {{ .Values.image.pullPolicy }}
4343
livenessProbe:
44-
exec:
45-
command:
46-
- "/usr/bin/grpc_health_probe"
47-
- "-addr=:{{ .Values.master.port | default "8080" }}"
48-
{{- if .Values.tls.enable }}
49-
- "-tls"
50-
- "-tls-ca-cert=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
51-
- "-tls-client-key=/etc/kubernetes/node-feature-discovery/certs/tls.key"
52-
- "-tls-client-cert=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
53-
{{- end }}
44+
grpc:
45+
port: 8080
5446
initialDelaySeconds: 10
5547
periodSeconds: 10
5648
readinessProbe:
57-
exec:
58-
command:
59-
- "/usr/bin/grpc_health_probe"
60-
- "-addr=:{{ .Values.master.port | default "8080" }}"
61-
{{- if .Values.tls.enable }}
62-
- "-tls"
63-
- "-tls-ca-cert=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
64-
- "-tls-client-key=/etc/kubernetes/node-feature-discovery/certs/tls.key"
65-
- "-tls-client-cert=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
66-
{{- end }}
49+
grpc:
50+
port: 8080
6751
initialDelaySeconds: 5
6852
periodSeconds: 10
6953
failureThreshold: 10

deployment/overlays/samples/cert-manager/master-cert.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ spec:
1313
- nfd-master.node-feature-discovery.svc
1414
- nfd-master.node-feature-discovery.svc.cluster.local
1515
- nfd-master
16-
- localhost # needed for grpc_health_probe
1716
issuerRef:
1817
name: nfd-ca-issuer
1918
kind: Issuer

0 commit comments

Comments
 (0)