Kubernetes - Deployment - Configure livenessProbe

6/18/2018

I can't configure a livenessProbe with attributes for a k8s Deployment, I tried apiVersion: apps/v1beta1, or apps/v1 or apps/v1beta2 or apps/v1beta3.

I want to add the attributes :

  • initialDelaySeconds
  • periodSeconds
  • timeoutSeconds

If I define any of these attributes I get an error

unknown field "periodSeconds" in io.k8s.api.core.v1.HTTPGetAction

-- Alex Pavy
kubernetes

2 Answers

6/18/2018

Yes it was the indent level thanks a lot, and it's correct on the documentation so I think this question isn't useful in general sorry

-- Alex Pavy
Source: StackOverflow

6/18/2018

This should work: extensions/v1beta1 for kind Deployment. It is working well for me.

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
    labels:
    app: myapp
    name: appapppod
    .
    .
    .
       livenessProbe:
         httpGet:
           path: /com/livenessstatus
           port: 7080
           scheme: HTTPS
           httpHeaders:
           - name: Your_customer_header_if_any
             value: my_customer_header_value
         initialDelaySeconds: 120
         timeoutSeconds: 40
         periodSeconds: 90
-- Nitb
Source: StackOverflow