mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
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 <feruzjon.muyassarov@intel.com>
This commit is contained in:
parent
a4cea16119
commit
06036a62ce
6 changed files with 12 additions and 39 deletions
|
@ -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/
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue