hello-kubernetes icon indicating copy to clipboard operation
hello-kubernetes copied to clipboard

Catered for liveness and readiness probe when ingress supplied

Open khetho opened this issue 3 years ago • 0 comments

Currently when deploying into a Kubernetes cluster with own ingress configured which uses specific path prefix which is not rewritten the liveness and readiness probes fail. This is because the deployment does not take into consideration the path prefix in the liveness and readiness url's even when it should. It is always your deployment.yaml

      livenessProbe:
        httpGet:
          path: /
          port: http
      readinessProbe:
        httpGet:
          path: /
          port: http

This pull request updates this section to include the path when the ingress is configured (ingress.configured=true) and the path is not being rewritten in the ingress (ingress.rewritePath=false) as per my deployment.yaml

      livenessProbe:
        httpGet:
          {{- if and .Values.ingress.configured (not .Values.ingress.rewritePath) }}
          path: "/{{ .Values.ingress.pathPrefix }}"
          {{- else }}
          path: /
          {{- end }}
          port: http
      readinessProbe:
        httpGet:
          {{- if and .Values.ingress.configured (not .Values.ingress.rewritePath) }}
          path: "/{{ .Values.ingress.pathPrefix }}"
          {{- else }}
          path: /
          {{- end }}
          port: http

khetho avatar Dec 21 '21 11:12 khetho