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.
Asked
Active
Viewed 1,705 times
2
-
How do you build the angular container image, what is inside? – Thomas Feb 11 '22 at 10:31
-
ng build --prod command compiles the Angular code into a folder which is copied into apache web server which hosts the files. – Ladu anand Feb 11 '22 at 10:48
-
I have followed Dockerfile from here ..instead of nginx used apache https://www.indellient.com/blog/how-to-dockerize-an-angular-application-with-nginx – Ladu anand Feb 11 '22 at 10:50
-
Could you share your Deployment yaml file? It will be easier to help you if we will see your configuration – RadekW Feb 11 '22 at 11:11
1 Answers
3
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'c
- 13,492
- 1
- 9
- 16
-
Can I setup a angular route and check the liveness probe with httpinterceptor mocking response , not sure if Angular routes can be directly hit through k8s – Anand Kadhi Oct 03 '22 at 09:42