100K+
The goal of this project is to have a simple set of functions that can be used as init containers in your kubernetes deployment. Each of the checks will see if the service is ready to accept connections.
For example the following snippet will wait for rabbitmq and postgresql to be ready before starting the actual container:
apiVersion: apps/v1
kind: Deployment
metadata:
name: mywebapp
spec:
replicas: 1
selector:
matchLabels:
app: mywebapp
template:
metadata:
labels:
app: mywebapp
spec:
initContainers:
- name: check-rabbitmq
image: "ncsa/checks:1.0.0"
env:
- name: RABBITMQ_URI
value: "amqp://user:pass@rabbitmq/%2F"
- name: check-postgresql
image: "ncsa/checks:1.0.0"
env:
- name: PGURI
value: "postgresql://postgres:secret@postgresql:5432/mydb"
- name: PGTABLE
value: "users"
containers:
- name: mywebapp
image: mywebapp:1.0
ports:
- containerPort: 80
env:
- name: RABBITMQ_URI
value: "amqp://user:pass@rabbitmq/%2F"
- name: PGHOST
value: "postgres"
- name: PGUSER
value: "postgres"
RabbitMQ
Mongo
URL
PostgreSQL
Content type
Image
Digest
sha256:0b738bbc8…
Size
56.1 MB
Last updated
11 months ago
docker pull ncsa/checks:mainPulls:
61
Last week