Init Container for probing dependant services in Kubernetes
In certain use cases you would want to delay starting up your deployment by checking if dependent services are up either through http or tcp probing. This helps your services to boot up in the correct order, for reference check out this example. Particular use cases include service discovery and fetching startup configs for spring boot applications.
- HTTP probe
- TCP Probe
- DNS Probe
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
namespace: default
labels:
app: frontend
spec:
replicas: 1
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
# Add your init container here
initContainers:
- name: init-c
image: jdube/init-c
args: ['http', '-u', "http://backend.default"]
containers:
- name: frontend
image: jdube/frontend
ports:
- containerPort: 8000
docker run --rm jdube/init-c http -u https://www.google.com
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.