-
-
Save m3pratik/0f148b9163194e6689cdeafd5cdefe24 to your computer and use it in GitHub Desktop.
liveness-prob-app-deployment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: rails-crud-microservice | |
labels: | |
app: rails-crud | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: rails-crud | |
template: | |
metadata: | |
labels: | |
app: rails-crud | |
spec: | |
initContainers: | |
- name: init-db | |
image: busybox:1.31 | |
command: ['sh', '-c', 'echo -e "Checking for the availability DB"; while ! nc -z postgres 5432; do sleep 1; printf "-"; done; echo -e " >> Postgres DB Server has started";'] | |
containers: | |
- name: rails-crud | |
image: 643517680445.dkr.ecr.us-east-1.amazonaws.com/crud:v2 | |
ports: | |
- containerPort: 3000 | |
env: | |
- name: POSTGRES_HOST | |
value: "postgres" | |
- name: POSTGRES_USER | |
valueFrom: | |
secretKeyRef: | |
name: postgres-db-envs | |
key: POSTGRES_USER | |
- name: POSTGRES_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
name: postgres-db-envs | |
key: POSTGRES_PASSWORD | |
livenessProbe: | |
exec: | |
command: | |
- /bin/sh | |
- -c | |
- nc -z localhost 3000 | |
initialDelaySeconds: 60 | |
periodSeconds: 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment