How to design readiness and livness probe for Angular application

2/11/2022

I have an angular application which is deployed on apache container running on Kubernetes. I wanted to setup liveness and readiness probe for pods but I am out of ideas .Any help would be appreciated.

-- Ladu anand
angular
apache
kubernetes
livenessprobe
readinessprobe

1 Answer

2/11/2022

Base on the link you provided, you can use the following as a start:

apiVersion: v1
kind: Pod
...
spec:
  ...
  containers:
  - name: ...
    ...
    livenessProbe:
      tcpSocket:
        port: 80               # <-- live when your web server is running
      initialDelaySeconds: 5   # <-- wait 5s before starting to probe
      periodSeconds: 20        # <-- do this probe every 20 seconds
    readinessProbe:
      httpGet:
        path: /                # <-- ready to accept connection when your home page is serving
        port: 80
      initialDelaySeconds: 15
      periodSeconds: 10
      failureThreshold: 3      # <-- must not fail > 3 probes
-- gohm&#39;c
Source: StackOverflow