{"id":40810989,"url":"https://github.com/jamesdube/init-c","last_synced_at":"2026-01-21T21:17:11.608Z","repository":{"id":55883825,"uuid":"319706106","full_name":"jamesdube/init-c","owner":"jamesdube","description":"Init Container for probing dependant services in Kubernetes","archived":false,"fork":false,"pushed_at":"2025-09-17T19:38:58.000Z","size":27,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T21:42:04.490Z","etag":null,"topics":["docker","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesdube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-08T17:05:41.000Z","updated_at":"2025-09-17T19:38:59.000Z","dependencies_parsed_at":"2022-08-15T08:31:41.863Z","dependency_job_id":null,"html_url":"https://github.com/jamesdube/init-c","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jamesdube/init-c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdube%2Finit-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdube%2Finit-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdube%2Finit-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdube%2Finit-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesdube","download_url":"https://codeload.github.com/jamesdube/init-c/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdube%2Finit-c/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28643286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","shell"],"created_at":"2026-01-21T21:17:10.757Z","updated_at":"2026-01-21T21:17:11.600Z","avatar_url":"https://github.com/jamesdube.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# init-c\n\nInit Container for probing dependant services in Kubernetes\n\n[![Issues](https://img.shields.io/github/issues/jamesdube/init-c)](https://img.shields.io/github/issues/jamesdube/init-c) ![Docker Pulls](https://img.shields.io/docker/pulls/jdube/init-c) ![Docker Image Version (latest by date)](https://img.shields.io/docker/v/jdube/init-c) ![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/jdube/init-c)\n\n\n## About\n\nIn certain use cases you would want to delay starting up your deployment by checking if\ndependent services are up either through http or tcp probing. This helps your services to boot \nup in the correct order, for reference check out this [example](#). Particular use cases\ninclude service discovery and fetching startup configs for spring boot applications.\n\n## Features\n\n - [x] HTTP probe\n - [x] TCP Probe\n - [x] DNS Probe\n    \n## Usage\n\n```yaml\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: frontend\n  namespace: default\n  labels:\n    app: frontend\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: frontend\n  template:\n    metadata:\n      labels:\n        app: frontend\n    spec:\n      # Add your init container here            \n      initContainers:\n      - name: init-c\n        image: jdube/init-c\n        args: ['http', '-u', \"http://backend.default\"]\n      containers:\n      - name: frontend\n        image: jdube/frontend\n        ports:\n        - containerPort: 8000\n```\n\n## Local Testing\n\n```shell script\ndocker run --rm jdube/init-c http -u https://www.google.com\n```\n## DNS Probe Usage\n\nTo use the DNS probe, specify `dns` as the probe type and use the `-h` or `--hostname` argument to provide the hostname to probe.\n\n```yaml\ninitContainers:\n  - name: init-c\n    image: jdube/init-c\n    args: ['dns', '-h', \"google.com\"]\n```\n\n```shell script\ndocker run --rm jdube/init-c dns -h google.com\n```\n\n## TCP Probe Usage\n\nTo use the TCP probe, specify `tcp` as the probe type and use the `-i` or `--ip` argument to provide the IP address and `-p` or `--port` argument to provide the port to probe.\n\n### Basic TCP Probe Examples\n\n#### Database Connection (PostgreSQL)\n```yaml\ninitContainers:\n  - name: init-c\n    image: jdube/init-c\n    args: ['tcp', '-i', \"database.default\", '-p', \"5432\"]\n```\n\n#### Redis Cache\n```yaml\ninitContainers:\n  - name: init-c\n    image: jdube/init-c\n    args: ['tcp', '-i', \"redis.default\", '-p', \"6379\"]\n```\n\n#### MySQL Database\n```yaml\ninitContainers:\n  - name: init-c\n    image: jdube/init-c\n    args: ['tcp', '-i', \"mysql.default\", '-p', \"3306\"]\n```\n\n#### MongoDB\n```yaml\ninitContainers:\n  - name: init-c\n    image: jdube/init-c\n    args: ['tcp', '-i', \"mongodb.default\", '-p', \"27017\"]\n```\n\n#### Custom Application Service\n```yaml\ninitContainers:\n  - name: init-c\n    image: jdube/init-c\n    args: ['tcp', '-i', \"backend-service.default\", '-p', \"8080\"]\n```\n\n### TCP Probe with Custom Timeout\n\nYou can specify a custom timeout using the `-t` or `--timeout` argument:\n\n```yaml\ninitContainers:\n  - name: init-c\n    image: jdube/init-c\n    args: ['tcp', '-i', \"database.default\", '-p', \"5432\", '-t', \"30\"]\n```\n\n### Local Testing Examples\n\n```shell script\n# Test local service\ndocker run --rm jdube/init-c tcp -i 127.0.0.1 -p 80\n\n# Test database connection\ndocker run --rm jdube/init-c tcp -i 127.0.0.1 -p 5432\n\n# Test with custom timeout (30 seconds)\ndocker run --rm jdube/init-c tcp -i 127.0.0.1 -p 3306 -t 30\n\n# Test external service\ndocker run --rm jdube/init-c tcp -i google.com -p 80\n```\n\n### Complete Deployment Example with TCP Probe\n\nHere's a complete example showing how to use TCP probes in a real deployment scenario:\n\n```yaml\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: web-application\n  namespace: default\n  labels:\n    app: web-application\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: web-application\n  template:\n    metadata:\n      labels:\n        app: web-application\n    spec:\n      # Wait for database and cache to be ready\n      initContainers:\n      - name: wait-for-db\n        image: jdube/init-c\n        args: ['tcp', '-i', \"postgres.default\", '-p', \"5432\", '-t', \"60\"]\n      - name: wait-for-cache\n        image: jdube/init-c\n        args: ['tcp', '-i', \"redis.default\", '-p', \"6379\", '-t', \"30\"]\n      containers:\n      - name: web-app\n        image: myapp/web-application:latest\n        ports:\n        - containerPort: 8080\n        env:\n        - name: DATABASE_URL\n          value: \"postgres://postgres.default:5432/myapp\"\n        - name: REDIS_URL\n          value: \"redis://redis.default:6379\"\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesdube%2Finit-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesdube%2Finit-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesdube%2Finit-c/lists"}