January 1st, 1970
Starting your containers in order using init containers in Kubernetes
init-c
Init Container for probing dependant services in Kubernetes
About
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.
Features
- HTTP probe
- TCP Probe
- DNS Probe
Usage
---
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
Local Testing
docker run --rm jdube/init-c http -u https://www.google.com
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.