Skip to content

Commit

Permalink
Merge pull request #1046 from fmuyassarov/native-grpc-probe
Browse files Browse the repository at this point in the history
Replace gRPC health probe utility with k8s built-in health probe
  • Loading branch information
k8s-ci-robot authored Sep 20, 2023
2 parents a4cea16 + 06036a6 commit 7847edb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 39 deletions.
8 changes: 0 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ ARG BASE_IMAGE_MINIMAL
# Build node feature discovery
FROM ${BUILDER_IMAGE} as builder

# Build and install the grpc-health-probe binary
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.19 && \
go install -tags osusergo,netgo -ldflags -extldflags=-static \
github.com/grpc-ecosystem/grpc-health-probe@${GRPC_HEALTH_PROBE_VERSION} \
# Rename it as it's referenced as grpc_health_probe in the deployment yamls
# and in its own project https://github.com/grpc-ecosystem/grpc-health-probe
&& mv /go/bin/grpc-health-probe /go/bin/grpc_health_probe

# Get (cache) deps in a separate layer
COPY go.mod go.sum /go/node-feature-discovery/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ spec:
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
imagePullPolicy: Always
livenessProbe:
exec:
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
grpc:
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
exec:
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
grpc:
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 10
Expand Down
8 changes: 4 additions & 4 deletions deployment/base/master/master-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ spec:
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
imagePullPolicy: Always
livenessProbe:
exec:
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
grpc:
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
exec:
command: ["/usr/bin/grpc_health_probe", "-addr=:8080"]
grpc:
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ spec:
# first one is configured for use by the worker; below are for completeness
- {{ include "node-feature-discovery.fullname" . }}-master.{{ include "node-feature-discovery.namespace" . }}.svc
- {{ include "node-feature-discovery.fullname" . }}-master.{{ include "node-feature-discovery.namespace" . }}.svc.cluster.local
# localhost needed for grpc_health_probe
- localhost
issuerRef:
name: nfd-ca-issuer
kind: Issuer
Expand Down
24 changes: 4 additions & 20 deletions deployment/helm/node-feature-discovery/templates/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,13 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
livenessProbe:
exec:
command:
- "/usr/bin/grpc_health_probe"
- "-addr=:{{ .Values.master.port | default "8080" }}"
{{- if .Values.tls.enable }}
- "-tls"
- "-tls-ca-cert=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
- "-tls-client-key=/etc/kubernetes/node-feature-discovery/certs/tls.key"
- "-tls-client-cert=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
{{- end }}
grpc:
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
exec:
command:
- "/usr/bin/grpc_health_probe"
- "-addr=:{{ .Values.master.port | default "8080" }}"
{{- if .Values.tls.enable }}
- "-tls"
- "-tls-ca-cert=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
- "-tls-client-key=/etc/kubernetes/node-feature-discovery/certs/tls.key"
- "-tls-client-cert=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
{{- end }}
grpc:
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 10
Expand Down
1 change: 0 additions & 1 deletion deployment/overlays/samples/cert-manager/master-cert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ spec:
- nfd-master.node-feature-discovery.svc
- nfd-master.node-feature-discovery.svc.cluster.local
- nfd-master
- localhost # needed for grpc_health_probe
issuerRef:
name: nfd-ca-issuer
kind: Issuer
Expand Down

0 comments on commit 7847edb

Please sign in to comment.