From 33ed7d21b54621bf47ecf789142371f32c9852be Mon Sep 17 00:00:00 2001 From: Tuna Date: Sun, 14 May 2017 01:54:20 +0700 Subject: [PATCH] temporary remove liveness probe check for pubsub func --- pkg/utils/k8sutil.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkg/utils/k8sutil.go b/pkg/utils/k8sutil.go index 2234cee85..6161e8910 100644 --- a/pkg/utils/k8sutil.go +++ b/pkg/utils/k8sutil.go @@ -58,6 +58,7 @@ const ( pubsubRuntime = "skippbox/kubeless-event-consumer:0.0.5" nodejsRuntime = "rosskukulinski/kubeless-nodejs:0.0.0" rubyRuntime = "jbianquettibitnami/kubeless-ruby:0.0.0" + pubsubFunc = "PubSub" ) // GetClient returns a k8s clientset to the request from inside of cluster @@ -306,16 +307,6 @@ func CreateK8sResources(ns, name string, spec *spec.FunctionSpec, client *kubern MountPath: "/kubeless", }, }, - LivenessProbe: &v1.Probe{ - InitialDelaySeconds: int32(3), - PeriodSeconds: int32(3), - Handler: v1.Handler{ - HTTPGet: &v1.HTTPGetAction{ - Path: "/healthz", - Port: intstr.FromInt(8080), - }, - }, - }, }, }, Volumes: []v1.Volume{ @@ -347,6 +338,20 @@ func CreateK8sResources(ns, name string, spec *spec.FunctionSpec, client *kubern addInitContainerAnnotation(dpm) } + if spec.Type != pubsubFunc { + livenessProbe := &v1.Probe{ + InitialDelaySeconds: int32(3), + PeriodSeconds: int32(3), + Handler: v1.Handler{ + HTTPGet: &v1.HTTPGetAction{ + Path: "/healthz", + Port: intstr.FromInt(8080), + }, + }, + } + dpm.Spec.Template.Spec.Containers[0].LivenessProbe = livenessProbe + } + _, err = client.Extensions().Deployments(ns).Create(dpm) if err != nil { return err