{"id":13816069,"url":"https://github.com/kylemcc/kube-gen","last_synced_at":"2026-01-17T08:59:20.395Z","repository":{"id":43174911,"uuid":"64950864","full_name":"kylemcc/kube-gen","owner":"kylemcc","description":"Generate files from Kubernetes events","archived":false,"fork":false,"pushed_at":"2025-01-02T21:17:46.000Z","size":15878,"stargazers_count":65,"open_issues_count":6,"forks_count":24,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-02T22:17:56.014Z","etag":null,"topics":["automation","golang","kubernetes","kubernetes-events","templates"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylemcc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-04T16:37:34.000Z","updated_at":"2025-01-02T21:17:51.000Z","dependencies_parsed_at":"2024-01-21T20:01:17.786Z","dependency_job_id":"ad6ac155-042d-4499-835a-fd638396ec84","html_url":"https://github.com/kylemcc/kube-gen","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fkube-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fkube-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fkube-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fkube-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylemcc","download_url":"https://codeload.github.com/kylemcc/kube-gen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254341050,"owners_count":22054972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["automation","golang","kubernetes","kubernetes-events","templates"],"created_at":"2024-08-04T05:00:32.843Z","updated_at":"2026-01-17T08:59:20.346Z","avatar_url":"https://github.com/kylemcc.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# kube-gen\n\n![latest 0.4.0](https://img.shields.io/badge/latest-0.4.0-green.svg?style=flat)\n[![license](http://img.shields.io/badge/license-BSD-red.svg?style=flat)](https://raw.githubusercontent.com/kylemcc/kube-gen/master/LICENSE)\n[![Check Commit](https://github.com/kylemcc/kube-gen/actions/workflows/check.yml/badge.svg)](https://github.com/kylemcc/kube-gen/actions/workflows/check.yml)\n\n\n`kube-gen` is a template rendering tool that generates files and executes commands based on Kubernetes events and metadata.\n\n## Installation\n\n#### Binary Download\n\nSee the [Releases](https://github.com/kylemcc/kube-gen/releases) page\n\n#### Docker Container\n\n`kube-gen` can be run as a standalone container, or bundled in a container with other applications.\n\nImages are available on [Dockerhub](https://hub.docker.com/r/kylemcc/kube-gen):\n\n```sh\n$ docker run kylemcc/kube-gen ...\n```\n\nOr [Github Package Registry](https://github.com/kylemcc/kube-gen/pkgs/container/kube-gen%2Fkube-gen):\n\n```sh\n$ docker run ghcr.io/kylemcc/kube-gen/kube-gen ...\n```\n\n\n## Usage\n\nWhen run with no arguments (or with `-h/-help`), `kube-gen` prints the following usage message.\n\n```shell\n$ kube-gen\nUsage: kube-gen [options] \u003ctemplate\u003e [\u003coutput\u003e]\n\nRender templates using Kubernetes metadata and events\n\nOptions:\n  -host string\n        If not set will use kubeconfig. If using proxy - set it to http://localhost:8001\n  -interval int\n\n  -kubeconfig string\n        (optional) absolute path to the kubeconfig file (default \"/Users/kyle/.kube/config\")\n  -log-cmd\n        log the output of the pre/post commands (default true)\n  -overwrite\n        overwrite the output file if it exists (default true)\n  -post-cmd string\n        command to run after template generation in complete\n  -pre-cmd string\n        command to run before template generation\n  -quiet\n        when set to true, nothing is logged\n  -type value\n        types of resources to pull [pods, services, endpoints] - May be specified multiple times. If not specified, all types will be returned\n  -version\n        display version information\n  -wait string\n        \u003cminimum\u003e[:\u003cmaximum\u003e] - the minimum and optional maximum time to wait after an event fires.E.g.: 500ms:5s\n  -watch\n        watch for new events\n\nArguments:\n  template: path or URL of the template file to render, or - to read from STDIN\n  output: (Optional) path to write the rendered content. If not specified,\n          rendered content is printed to STDOUT. By default, this file will\n          be overwritten if it exists. Use -overwrite=false to return an\n          error instead\n```\n\n#### Authentication / Connecting to the Kubernetes API\nBy default, `kube-gen` will look for a kubeconfig file at `$HOME/.kube/config`. A different kubeconfig file may be specified by using the `-kubeconfig` flag. Alternatively, `kube-gen` provides a `-host` flag that, if set, will supersede the `-kubeconfig`. The `-host` flag is best paired with `kubectl proxy`, which listens on 127.0.0.1:8001 by default. The `-host` flag may also be set to the value of `kube-apiserver`'s `--insecure-bind-address` / `--insecure-port`.\n\n#### Watching for changes\n\nThe `-watch` flag configures `kube-gen` to watch the API for changes to `Services`, `Pods`, and `Endpoints` (support for other types is forthcoming). This mode is useul when combined with the `-pre-cmd`, `-post-cmd`, and `-wait` parameters.\n\n## Template Language\n\n`kube-gen` supports templates written in Go`s [text/template](https://golang.org/pkg/text/template/) language. It supports all of the [built in](https://golang.org/pkg/text/template/#hdr-Functions) functions, as well as numerous custom functions described below. Many of the custom functions (and the documentation for those functions) have been borrowed from [docker-gen](https://github.com/jwilder/docker-gen). Those functions, along with the accompanying License and Copyright are located in the [dockergen_template_functions.go](https://github.com/kylemcc/kube-gen/blob/master/dockergen_template_functions.go) source file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemcc%2Fkube-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylemcc%2Fkube-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemcc%2Fkube-gen/lists"}