arshad75

liveness_rediness.yaml

Jan 27th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: <your-name>-deployment
  5. spec:
  6. selector:
  7. matchLabels:
  8. app: <your-name>-app
  9. replicas: 2 # tells deployment to run 2 pods matching the template
  10. template:
  11. metadata:
  12. labels:
  13. app: <your-name>-app
  14. spec:
  15. containers:
  16. - name: <your-name>-container
  17. image: lovescloud/rildemo:default
  18. args :
  19. - /bin/sh
  20. - -c
  21. - touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
  22. livenessProbe:
  23. exec:
  24. command:
  25. - cat
  26. - /tmp/healthy
  27. initialDelaySeconds: 5
  28. periodSeconds: 5
  29. failureThreshold: 1
  30. readinessProbe:
  31. exec:
  32. command:
  33. - cat
  34. - /tmp/healthy
  35. ports:
  36. - containerPort: 80
  37. ---
  38.  
  39. apiVersion: v1
  40. kind: Service
  41. metadata:
  42. name: <your-name>-service
  43. namespace: default
  44. spec:
  45. ports:
  46. - port: 80
  47. protocol: TCP
  48. targetPort: 80
  49. selector:
  50. app: <your-name>-app
  51. type: NodePort
Add Comment
Please, Sign In to add comment