Liveness probe: specify 401 is OK

2,267 views
Skip to first unread message

adam.dau...@gmail.com

unread,
Dec 14, 2016, 1:33:29 PM12/14/16
to Kubernetes user discussion and Q&A
Hello there,

I'm looking around for a way to specify that HTTP 401 is okay (since it tells me that the app is working).

Is there a way to do this?

Thanks,

Adam

Tim Hockin

unread,
Dec 14, 2016, 1:46:25 PM12/14/16
to kubernet...@googlegroups.com
No, the probes look specifically for 200s, I think. Is there a reason
you can't return 200?
> --
> You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
> To post to this group, send email to kubernet...@googlegroups.com.
> Visit this group at https://groups.google.com/group/kubernetes-users.
> For more options, visit https://groups.google.com/d/optout.

Adam Daughterson

unread,
Dec 15, 2016, 4:08:12 PM12/15/16
to kubernet...@googlegroups.com
Because the request requires authentication, and a 401 is a good indicator that the microservice is running.
It would be nice to be able to customize it.

Thanks!

On Wed, Dec 14, 2016 at 11:46 AM, 'Tim Hockin' via Kubernetes user discussion and Q&A <kubernet...@googlegroups.com> wrote:
No, the probes look specifically for 200s, I think.  Is there a reason
you can't return 200?

On Wed, Dec 14, 2016 at 10:33 AM,  <adam.dau...@gmail.com> wrote:
> Hello there,
>
> I'm looking around for a way to specify that HTTP 401 is okay (since it tells me that the app is working).
>
> Is there a way to do this?
>
> Thanks,
>
> Adam
>
> --
> You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscribe@googlegroups.com.
> To post to this group, send email to kubernetes-users@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.

Tim Hockin

unread,
Dec 15, 2016, 4:11:11 PM12/15/16
to kubernet...@googlegroups.com
Please file a github feature request

On Thu, Dec 15, 2016 at 1:08 PM, Adam Daughterson
<adam.dau...@gmail.com> wrote:
> Because the request requires authentication, and a 401 is a good indicator
> that the microservice is running.
> It would be nice to be able to customize it.
>
> Thanks!
>
> On Wed, Dec 14, 2016 at 11:46 AM, 'Tim Hockin' via Kubernetes user
> discussion and Q&A <kubernet...@googlegroups.com> wrote:
>>
>> No, the probes look specifically for 200s, I think. Is there a reason
>> you can't return 200?
>>
>> On Wed, Dec 14, 2016 at 10:33 AM, <adam.dau...@gmail.com> wrote:
>> > Hello there,
>> >
>> > I'm looking around for a way to specify that HTTP 401 is okay (since it
>> > tells me that the app is working).
>> >
>> > Is there a way to do this?
>> >
>> > Thanks,
>> >
>> > Adam
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Kubernetes user discussion and Q&A" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to kubernetes-use...@googlegroups.com.
>> > To post to this group, send email to kubernet...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/kubernetes-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Kubernetes user discussion and Q&A" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> kubernetes-use...@googlegroups.com.
>> To post to this group, send email to kubernet...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/kubernetes-users.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kubernetes-use...@googlegroups.com.
> To post to this group, send email to kubernet...@googlegroups.com.

Adam Daughterson

unread,
Dec 15, 2016, 4:30:48 PM12/15/16
to kubernet...@googlegroups.com
Will do, thanks for the quick response!

On Thu, Dec 15, 2016 at 2:10 PM, 'Tim Hockin' via Kubernetes user discussion and Q&A <kubernet...@googlegroups.com> wrote:
Please file a github feature request

On Thu, Dec 15, 2016 at 1:08 PM, Adam Daughterson
<adam.dau...@gmail.com> wrote:
> Because the request requires authentication, and a 401 is a good indicator
> that the microservice is running.
> It would be nice to be able to customize it.
>
> Thanks!
>
> On Wed, Dec 14, 2016 at 11:46 AM, 'Tim Hockin' via Kubernetes user
> discussion and Q&A <kubernetes-users@googlegroups.com> wrote:
>>
>> No, the probes look specifically for 200s, I think.  Is there a reason
>> you can't return 200?
>>
>> On Wed, Dec 14, 2016 at 10:33 AM,  <adam.dau...@gmail.com> wrote:
>> > Hello there,
>> >
>> > I'm looking around for a way to specify that HTTP 401 is okay (since it
>> > tells me that the app is working).
>> >
>> > Is there a way to do this?
>> >
>> > Thanks,
>> >
>> > Adam
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Kubernetes user discussion and Q&A" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to kubernetes-users+unsubscribe@googlegroups.com.
>> > To post to this group, send email to kubernetes-users@googlegroups.com.

>> > Visit this group at https://groups.google.com/group/kubernetes-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Kubernetes user discussion and Q&A" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to

>> Visit this group at https://groups.google.com/group/kubernetes-users.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kubernetes-users+unsubscribe@googlegroups.com.
> To post to this group, send email to kubernetes-users@googlegroups.com.

> Visit this group at https://groups.google.com/group/kubernetes-users.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.

Tim Hockin

unread,
Dec 15, 2016, 4:54:19 PM12/15/16
to kubernet...@googlegroups.com
No promises, but it doesn't seem unreasonable to me...

On Thu, Dec 15, 2016 at 1:30 PM, Adam Daughterson
>> >> > an email to kubernetes-use...@googlegroups.com.
>> >> > To post to this group, send email to
>> >> > kubernet...@googlegroups.com.
>> >> > Visit this group at https://groups.google.com/group/kubernetes-users.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >>
>> >> --
>> >> You received this message because you are subscribed to a topic in the
>> >> Google Groups "Kubernetes user discussion and Q&A" group.
>> >> To unsubscribe from this topic, visit
>> >>
>> >> https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
>> >> To unsubscribe from this group and all its topics, send an email to
>> >> kubernetes-use...@googlegroups.com.
>> >> To post to this group, send email to kubernet...@googlegroups.com.
>> >> Visit this group at https://groups.google.com/group/kubernetes-users.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Kubernetes user discussion and Q&A" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to kubernetes-use...@googlegroups.com.
>> > To post to this group, send email to kubernet...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/kubernetes-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Kubernetes user discussion and Q&A" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> kubernetes-use...@googlegroups.com.
>> To post to this group, send email to kubernet...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/kubernetes-users.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kubernetes-use...@googlegroups.com.
> To post to this group, send email to kubernet...@googlegroups.com.

Rodrigo Campos

unread,
Dec 15, 2016, 11:57:27 PM12/15/16
to kubernet...@googlegroups.com
Ans what do you do with the readiness probe?

I mean, 401 might not be a good indication that is ready and you may want and endpoint without auth just for it.


On Thursday, December 15, 2016, Adam Daughterson <adam.dau...@gmail.com> wrote:
Because the request requires authentication, and a 401 is a good indicator that the microservice is running.
It would be nice to be able to customize it.

Thanks!

Adam Daughterson

unread,
Dec 16, 2016, 2:09:10 PM12/16/16
to kubernet...@googlegroups.com
The microservice is entirely set up to prevent access without auth, and I don't have control over that. In our use-case, 401 is perfect because it means we are ready, and the service is doing what it is supposed to be doing.

Make sense?

Matthias Rampke

unread,
Dec 16, 2016, 2:18:10 PM12/16/16
to kubernet...@googlegroups.com

As an alternative approach to "401 OK", what would you need to make authenticated probe requests?


On Fri, Dec 16, 2016, 20:09 Adam Daughterson <adam.dau...@gmail.com> wrote:
The microservice is entirely set up to prevent access without auth, and I don't have control over that. In our use-case, 401 is perfect because it means we are ready, and the service is doing what it is supposed to be doing.

Make sense?
On Thu, Dec 15, 2016 at 9:57 PM, Rodrigo Campos <rodr...@gmail.com> wrote:
Ans what do you do with the readiness probe?

I mean, 401 might not be a good indication that is ready and you may want and endpoint without auth just for it.


On Thursday, December 15, 2016, Adam Daughterson <adam.dau...@gmail.com> wrote:
Because the request requires authentication, and a 401 is a good indicator that the microservice is running.
It would be nice to be able to customize it.

Thanks!
On Wed, Dec 14, 2016 at 11:46 AM, 'Tim Hockin' via Kubernetes user discussion and Q&A <kubernet...@googlegroups.com> wrote:
No, the probes look specifically for 200s, I think.  Is there a reason
you can't return 200?

On Wed, Dec 14, 2016 at 10:33 AM,  <adam.dau...@gmail.com> wrote:
> Hello there,
>
> I'm looking around for a way to specify that HTTP 401 is okay (since it tells me that the app is working).
>
> Is there a way to do this?
>
> Thanks,
>
> Adam
>
> --
> You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
> To post to this group, send email to kubernet...@googlegroups.com.

> Visit this group at https://groups.google.com/group/kubernetes-users.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.

Rodrigo Campos

unread,
Dec 16, 2016, 2:28:08 PM12/16/16
to kubernet...@googlegroups.com
On Fri, Dec 16, 2016 at 07:17:55PM +0000, Matthias Rampke wrote:
> As an alternative approach to "401 OK", what would you need to make
> authenticated probe requests?

Also, as another alternative, you can run a command in te container, or a TCP
connection might be "good enough" for your use case.

Adam Daughterson

unread,
Dec 16, 2016, 4:00:40 PM12/16/16
to kubernet...@googlegroups.com
Thanks for the suggestions. Currently for the POC I'm doing, I'm running exec: command: ls
Less than good, but better than bad.  :)

--
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/Y3Y_Athhhds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages