Skip to content
Permalink
Browse files

Merge pull request #877 from sofat1989/addhealthserver

use grpc health probe for virtlet
  • Loading branch information...
ivan4th committed Jun 24, 2019
2 parents 6ef2793 + b76cc75 commit 5a0c02c1511615ff5cbda5c19e0d123df78442ed
@@ -226,7 +226,7 @@ spec:
command:
- /bin/sh
- -c
- socat - UNIX:/run/virtlet.sock </dev/null
- grpc_health_probe -addr UNIX:/run/virtlet.sock
- name: vms
image: mirantis/virtlet
imagePullPolicy: IfNotPresent
@@ -16,5 +16,8 @@ COPY _output/virtletctl /usr/local/bin
COPY _output/virtlet-longevity-tests /usr/local/bin
COPY _output/vmwrapper /
COPY _output/virtlet-e2e-tests /
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.2 && \
curl -L -s -o /usr/local/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /usr/local/bin/grpc_health_probe

CMD ["/start.sh"]
@@ -35,6 +35,8 @@ import (
"github.com/Mirantis/virtlet/pkg/stream"
"github.com/Mirantis/virtlet/pkg/tapmanager"
"github.com/Mirantis/virtlet/pkg/utils"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
)

const (
@@ -146,6 +148,9 @@ func (v *VirtletManager) Run() error {
v.server = NewServer()
v.server.Register(runtimeService, imageService)

healthServer := health.NewServer()
grpc_health_v1.RegisterHealthServer(v.server.server, healthServer)

if err := v.recoverAndGC(); err != nil {
// we consider recover / gc errors non-fatal
glog.Warning(err)
@@ -73,7 +73,7 @@ spec:
command:
- /bin/sh
- -c
- socat - UNIX:/run/virtlet.sock </dev/null
- grpc_health_probe -addr UNIX:/run/virtlet.sock
resources: {}
securityContext:
privileged: true
@@ -75,7 +75,7 @@ spec:
command:
- /bin/sh
- -c
- socat - UNIX:/run/virtlet.sock </dev/null
- grpc_health_probe -addr UNIX:/run/virtlet.sock
resources: {}
securityContext:
privileged: true
@@ -75,7 +75,7 @@ spec:
command:
- /bin/sh
- -c
- socat - UNIX:/run/virtlet.sock </dev/null
- grpc_health_probe -addr UNIX:/run/virtlet.sock
resources: {}
securityContext:
privileged: true
@@ -73,7 +73,7 @@ spec:
command:
- /bin/sh
- -c
- socat - UNIX:/run/virtlet.sock </dev/null
- grpc_health_probe -addr UNIX:/run/virtlet.sock
resources: {}
securityContext:
privileged: true
@@ -73,7 +73,7 @@ spec:
command:
- /bin/sh
- -c
- socat - UNIX:/run/virtlet.sock </dev/null
- grpc_health_probe -addr UNIX:/run/virtlet.sock
resources: {}
securityContext:
privileged: true

Large diffs are not rendered by default.

0 comments on commit 5a0c02c

Please sign in to comment.
You can’t perform that action at this time.