{"id":16162373,"url":"https://github.com/sunsided/k8sfwd","last_synced_at":"2025-03-18T22:31:07.968Z","repository":{"id":181604878,"uuid":"666141468","full_name":"sunsided/k8sfwd","owner":"sunsided","description":"A Kubernetes multi-cluster, multi-target port-forwarding CLI with automatic reconnects","archived":false,"fork":false,"pushed_at":"2024-12-04T20:38:40.000Z","size":251,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T12:32:53.658Z","etag":null,"topics":["cli","developer-tools","k8s","kubectl","kubernetes","multi-cluster","port-forward","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/k8sfwd","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-07-13T20:11:06.000Z","updated_at":"2024-12-30T22:28:18.000Z","dependencies_parsed_at":"2024-10-27T19:17:11.741Z","dependency_job_id":"0dc42800-5030-41a4-9e27-aab6a8a19cdc","html_url":"https://github.com/sunsided/k8sfwd","commit_stats":null,"previous_names":["sunsided/k8sfwd"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fk8sfwd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fk8sfwd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fk8sfwd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fk8sfwd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/k8sfwd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950927,"owners_count":20373664,"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":["cli","developer-tools","k8s","kubectl","kubernetes","multi-cluster","port-forward","rust"],"created_at":"2024-10-10T02:29:54.199Z","updated_at":"2025-03-18T22:31:07.674Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s:fwd — config-based kubernetes multi-port forwarding\n\nA tool for handling port-forwards to multiple services and across multiple clusters.\n\nFor Linux (GNU and musl) you can download pre-built binaries from the [Releases](https://github.com/sunsided/k8sfwd/releases)\npage. For other platforms the setup is currently based on [cargo] until platform-specific binaries can be provided.\nTo manually build and install the latest version for your system (or update to it), run:\n\n```shell\ncargo install k8sfwd\n```\n\nPlease note that the application internally relies on `kubectl`, so it needs to be present in your path.\nIf `kubectl` is not on your path, you may specify it via the `--kubectl` argument or\nthe `KUBECTL_PATH` environment variable.\n\nDepending on your configuration, you'll be greeted with something along the lines of:\n\n```\n██╗░░██╗░█████╗░░██████╗░░░░░███████╗██╗░░░░░░░██╗██████╗\n██║░██╔╝██╔══██╗██╔════╝░██╗░██╔════╝██║░░██╗░░██║██╔══██╗\n█████═╝░╚█████╔╝╚█████╗░░╚═╝░█████╗░░╚██╗████╗██╔╝██║░░██║\n██╔═██╗░██╔══██╗░╚═══██╗░██╗░██╔══╝░░░████╔═████║░██║░░██║\n██║░╚██╗╚█████╔╝██████╔╝░╚═╝░██║░░░░░░╚██╔╝░╚██╔╝░██████╔╝\n╚═╝░░╚═╝░╚════╝░╚═════╝░░░░░░╚═╝░░░░░░░╚═╝░░░╚═╝░░╚═════╝\nk8s:fwd 0.3.0 - a Kubernetes multi-cluster port forwarder\nUsing kubectl version v1.24.12-dispatcher\nUsing config from 2 locations\n\nForwarding to the following targets:\n#0 Items API (Staging)\n   target:  service/foo.test-api\n   context: (default)\n   cluster: (default)\n#1 Items API (Production)\n   target:  pod/foo-59b58f5d68-6t6bh.test-api\n   context: (default)\n   cluster: production\n\nSpawning child processes:\n#0: Error from server (NotFound): pods \"foo-59b58f5d68-6t6bh\" not found\n#0: Process exited with exit status: 1 - will retry in 5 sec\n#1: Forwarding from 127.0.0.1:5012 -\u003e 80\n#1: Forwarding from 127.0.0.1:46737 -\u003e 8080\n#1: Forwarding from [::1]:5012 -\u003e 80\n#1: Forwarding from [::1]:46737 -\u003e 8080\n#0: Error from server (NotFound): pods \"foo-59b58f5d68-6t6bh\" not found\n#0: Process exited with exit status: 1 - will retry in 5 sec\n```\n\n## Command-Line Options\n\n### Filters\n\nTargets can be selected through prefix filters specified on the command-line. Only\ntargets (and target names) starting with the specified prefixes will be forwarded.\nIn the following example, services starting with `foo` and `bar` will be selected:\n\n```shell\nk8sfwd foo bar\n```\n\nFilters can operate in combination with tags as well:\n\n```shell\nk8sfwd -t test foo bar\n```\n\n### Tags\n\nTargets can be labeled with tags. When `k8sfwd` is started with one or more space-separated\n`--tags` parameters, targets are filtered down to match the selection. If multiple values\nare specified (e.g. `--tags foo bar`), any matching tag results in the target being selected.\nIf two tags are combined with a plus sign (e.g. `--tags foo+bar`) only targets matching both\ntags are selected.\n\n| Target tags             | `--tags` argument      | Selected |\n|-------------------------|------------------------|----------|\n| (none)                  | (none)                 | ✅ yes    |\n| (none)                  | `--tags some`          | ❌ no     |\n| `[\"foo\", \"bar\", \"baz\"]` | (none)                 | ✅ yes    |\n| `[\"foo\", \"bar\", \"baz\"]` | `--tags fubar`         | ❌ no     |\n| `[\"foo\", \"bar\", \"baz\"]` | `--tags foo bar`       | ✅ yes    |\n| `[\"foo\", \"bar\", \"baz\"]` | `--tags bar`           | ✅ yes    |\n| `[\"foo\", \"bar\", \"baz\"]` | `--tags foo+baz`       | ✅ yes    |\n| `[\"foo\", \"bar\", \"baz\"]` | `--tags foo+fubar`     | ❌ no     |\n| `[\"foo\", \"bar\", \"baz\"]` | `--tags foo+baz fubar` | ✅ yes    |\n| `[\"fubar\"]`             | `--tags foo+baz fubar` | ✅ yes    |\n   \n\n## Configuration\n\nThe configuration is provided as a YAML file. \n\n- If one or more files are specified on program launch via the `--file` argument(s), their configuration is loaded.\n- If no configuration file is specified, `k8sfwd` will recursively look for a `.k8sfwd` file in \n  - the current directory hierarchy, \n  - your home directory and \n  - your configuration directory, in that order.\n\nNon-target configuration (e.g., retry delays) are always loaded from the hierarchy stated above regardless\nof whether a `--file` argument is present. However,  all target configuration that is not directly specified\nthrough a file pointed to by the `--file` argument is ignored.\n\nSee [`k8sfwd-example.yaml`](k8sfwd-example.yaml) for an example.\n\n```yaml\n---\nversion: 0.2.0\nconfig:\n  # Optional: Number of seconds to wait before attempting to re-establish\n  # a broken connection.\n  retry_delay_sec: 5.0\ntargets:\n  - name: Test API (Staging)    # Optional, for display purposes.\n    target: foo                 # The name of the resource to forward to.\n    tags:                       # Optional, for use with `--tags \u003ctag1\u003e \u003ctag2\u003e+\u003ctag3\u003e`\n      - integration\n    type: service               # Can be service, deployment or pod.\n    namespace: bar              # The namespace of the resource.\n    context: null               # Optional; will default to current context.\n    cluster: null               # Optional; will default to current cluster.\n    ports:\n      - \"5012:80\"               # Forward resource port 80 to local port 5012.\n      - \"8080\"                  # Forward resource port 8080 to random local port. \n  - name: Test API (Production)\n    target: foo-59b58f5d68-6t6bh\n    type: pod\n    namespace: bar\n    cluster: production\n    listen_addrs:               # Select the listen addresses; defaults to `localhost`.\n      - \"127.1.0.1\"\n    ports:\n      - \"5012:80\"\n```\n\n[cargo]: https://crates.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fk8sfwd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fk8sfwd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fk8sfwd/lists"}