{"id":43276540,"url":"https://github.com/ryane/kfilt","last_synced_at":"2026-02-01T16:39:16.919Z","repository":{"id":39888255,"uuid":"193619311","full_name":"ryane/kfilt","owner":"ryane","description":"kfilt can filter Kubernetes resources.","archived":false,"fork":false,"pushed_at":"2025-12-03T03:16:05.000Z","size":176,"stargazers_count":109,"open_issues_count":1,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-12-03T06:23:43.715Z","etag":null,"topics":["helm-charts","kubectl","kubernetes","kustomize"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryane.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-25T02:28:24.000Z","updated_at":"2025-12-03T03:16:08.000Z","dependencies_parsed_at":"2024-06-20T02:55:33.549Z","dependency_job_id":"6ecc18b6-8a0c-47f4-9bd0-82cf77643e4d","html_url":"https://github.com/ryane/kfilt","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ryane/kfilt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryane%2Fkfilt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryane%2Fkfilt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryane%2Fkfilt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryane%2Fkfilt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryane","download_url":"https://codeload.github.com/ryane/kfilt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryane%2Fkfilt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28983079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T16:29:42.054Z","status":"ssl_error","status_checked_at":"2026-02-01T16:29:41.428Z","response_time":56,"last_error":"SSL_read: 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":["helm-charts","kubectl","kubernetes","kustomize"],"created_at":"2026-02-01T16:39:16.287Z","updated_at":"2026-02-01T16:39:16.914Z","avatar_url":"https://github.com/ryane.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kfilt\n\n[![Build Status](https://github.com/ryane/kfilt/workflows/CI/badge.svg)](https://github.com/ryane/kfilt/actions)\n[![Code Coverage](https://codecov.io/gh/ryane/kfilt/branch/main/graph/badge.svg)](https://codecov.io/gh/ryane/kfilt)\n[![Go Report Card](https://goreportcard.com/badge/ryane/kfilt)](https://goreportcard.com/report/ryane/kfilt)\n[![LICENSE](https://img.shields.io/github/license/ryane/kfilt.svg)](https://github.com/ryane/kfilt/blob/main/LICENSE)\n[![Releases](https://img.shields.io/github/release-pre/ryane/kfilt.svg)](https://github.com/ryane/kfilt/releases)\n\nkfilt can filter Kubernetes resources.\n\n## What is kfilt?\n\nkfilt is a tool that lets you filter specific resources from a stream of Kubernetes YAML manifests. It can read manifests from a file, URL, or from stdin.\n\nkfilt was primarily created to assist developers who are creating [Helm charts](https://helm.sh/docs/developing_charts/) or [Kustomize](https://github.com/kubernetes-sigs/kustomize) bases. Often, when making changes, it is helpful to narrow down focus to a specific resource or set of resources in the output. Without kfilt, you might redirect output to a file for inspection in your text editor or to write complicated grep commands. kfilt makes it easy to filter the output to see just the resources you are currently interested in. Or, to exclude specific resources.\n\nYou can also use kfilt to selectively apply (or delete) resources with kubectl.\n\nIt is easiest to understand with some examples.\n\n### Examples\n\n#### Working with Files or URLs\n\nOnly output a ServiceAccount named \"test\":\n\n```\nkfilt -f ./pkg/decoder/test.yaml -i kind=ServiceAccount,name=test\n```\n\nOutput all Service Accounts:\n\n```\nkfilt -f http://bit.ly/2xSiCJL -i kind=ServiceAccount\n```\n\n#### Working with Helm charts\n\nkfilt can be used as a more flexible alternative to the `-x` option of [`helm template`](https://helm.sh/docs/helm/#helm-template). In this example, we will only output rendered Service resources from a Helm chart:\n\n```\nhelm template chart | kfilt -i kind=service\n```\n\nWe also have the ability to exclude resources. Here we will exclude all Secrets before applying a Chart to a cluster.\n\n```\nhelm template chart | kfilt -x kind=secret | kubectl apply -f -\n```\n\n#### Working with Kustomize\n\nOnly output the ConfigMaps in a Kustomize base.\n\n```\nkustomize build github.com/kubernetes-sigs/kustomize//examples/helloWorld | kfilt -i kind=ConfigMap\n```\n\nOutput only the resources named \"the-deployment\".\n\n```\nkustomize build github.com/kubernetes-sigs/kustomize//examples/helloWorld | kfilt -i name=the-deployment\n```\n\n#### Working with kubectl\n\nFind all resources named \"nginx-ingress-controller\" regardless of kind.\n\n```\nkubectl get all -A -oyaml | kfilt -i name=nginx-ingress-controller\n```\n\nWhen used as a kubectl plugin:\n\n```\nkubectl get all -A -oyaml | kubectl kfilt -i name=nginx-ingress-controller\n```\n\n## Installation\n\nkfilt is available on Linux, Mac, and Windows \u003csup\u003e1\u003c/sup\u003e and binaries are available on the [releases](https://github.com/ryane/kfilt/releases) page.\n\n### kubectl Plugin\n\nkfilt can be used as a kubectl plugin. Install via [Krew](https://krew.sigs.k8s.io/):\n\n```bash\nkubectl krew install kfilt\n```\n\nSee [kubectl plugin documentation](./plugin/kubectl/README.md) for detailed installation and usage instructions.\n\n### Docker\n\nYou can also run kfilt as a Docker container. Make sure you include `-i` in your `docker run` command.\n\n```\nkustomize build base | docker run --rm -i ryane/kfilt -k ConfigMap\n```\n\n### AUR\n\n[kfilt](https://aur.archlinux.org/packages/kfilt-bin) is on the [Arch User\nRepository (AUR)](https://aur.archlinux.org/).\n\n### asdf Plugin\n\n[@feniix](https://github.com/feniix) created an\n[asdf](https://github.com/asdf-vm/asdf)\n[plugin](https://github.com/feniix/asdf-kfilt/).\n\n### nixpkgs\n\n[kfilt](https://search.nixos.org/packages?show=kfilt) is on [nixpkgs](https://github.com/NixOS/nixpkgs).\n\n### nix flake\n\n```shell\nnix run github:ryane/kfilt#kfilt -- -f ./pkg/decoder/test.yaml -k serviceaccount\n```\n\n### Running as a Kustomize Plugin (experimental)\n\nSee [plugin/kustomize](./plugin/kustomize) for an experimental Kustomize plugin.\n\n## Usage\n\n### Including Resources\n\nYou can use `--include` or `-i` to control which resources to include in the kfilt output. This argument takes a list of simple key value pairs that make up your query. The following keys are currently supported:\n\n| Key           | Field              | Example                   |\n| ------------- | ------------------ | ------------------------- |\n| kind, k       | kind               | ServiceAccount            |\n| name, n       | metadata.name      | my-app                    |\n| group, g      | apiVersion         | rbac.authorization.k8s.io |\n| version, v    | apiVersion         | v1                        |\n| namespace, ns | metadata.namespace | kube-system               |\n| labels, l     | metadata.labels    | app=my-app                |\n\nNote that it is possible to use wildcards (`*`, and `?`) when filtering by name.\n\n#### Examples\n\n##### Filter by kind\n\n```\nkfilt -f ./pkg/decoder/test.yaml -i kind=configmap\n```\n\n##### Filter by group\n\n```\nkfilt -f ./pkg/decoder/test.yaml -i g=config.istio.io\n```\n\n##### Filter by name and kind\n\nYou can combine keys in a single `--include` by separating them with a comma. In this example, we are filtering to match ServiceAccount resources named \"test\":\n\n```\nkfilt -f ./pkg/decoder/test.yaml -i k=ServiceAccount,n=test\n```\n\n##### Filter by name using wildcards\n\n```\nkfilt -f ./pkg/decoder/test.yaml -n \"test*\"\n```\n\nYou can use `*` and `?` wildcard characters.\n\n##### Filter by multiple kinds\n\nYou can use multiple `--include` flags. kfilt will output resources that match any one of the includes. For example, to output ServiceAccounts and ConfigMaps you could use:\n\n```\nkfilt -f ./pkg/decoder/test.yaml -i k=serviceaccount -i k=configmap\n```\n\n##### Filter with Label Selectors\n\n```\nkfilt -f ./pkg/decoder/test.yaml -i labels=app=test\n```\n\n### Excluding Resources\n\nThe `--exclude` or `-x` flag will allow you to exclude resources. This supports the same key value pairs as the `--include` flag.\n\n#### Examples\n\n##### Exclude by kind\n\n```\nkfilt -f ./pkg/decoder/test.yaml -x kind=configmap\n```\n\n##### Exclude by name\n\n```\nkfilt -f ./pkg/decoder/test.yaml -x name=test\n```\n\n##### Exclude multiple kinds\n\n```\nkfilt -f ./pkg/decoder/test.yaml -x kind=configmap -x k=serviceaccount\n```\n\n##### Exclude with Label Selectors\n\n```\nkfilt -f ./pkg/decoder/test.yaml -x labels=app=test\n```\n\n### Shortcuts\n\nBecause \"kind\", \"name\", and \"labels\" are the most commonly used fields to filter by, kfilt has special flags allowing you to save some typing.\n\nYou can include by \"kind\" by using the `--kind` (or `-k`) flag with just the name of the kind you want to filter by. You can use `--exclude-kind` (or `-K`) for exclusions.\n\nThe corresponding flags for \"name\" queries are `--name` (`-n`) and `--exclude-name` (`-N`).\n\nFinally, you can use label selectors with the `--labels` (`-l`) and `--exclude-labels` (`L`) flags.\n\n#### Include ConfigMaps and Service Accounts\n\n```\nkfilt -f ./pkg/decoder/test.yaml -k configmap -k serviceaccount\n```\n\n#### Exclude resources named \"test\"\n\n```\nkfilt -f ./pkg/decoder/test.yaml -N test\n```\n\n#### Include resources labeled with \"app=test\"\n\n```\nkfilt -f ./pkg/decoder/test.yaml -l app=test\n```\n\n---\n\n\u003csup\u003e1\u003c/sup\u003e _note_: kfilt has not been tested extensively on Windows. Please file an issue if you run into any problems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryane%2Fkfilt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryane%2Fkfilt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryane%2Fkfilt/lists"}