Skip to content

gayanper/k8s.kpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Port-Forward Manager (k8s.kpm) [Preview]

This tool will help you to do bulk port mappings using kubectl command which is installed and configured in your machine. This tool expects configured kubectl tool in your machine prior to using this tool.

Compiling

  • Checkout the code from github
  • Then run make to compile the tool
  • Copy the kpm binary in the source folder to a desired location and add to PATH variable

Note: More information will be added how to compile on different platforms later.

Features

  • Define different port mapping configurations as defined under First time use.
  • Supports command auto completions.
  • Start port mapping for several services on a namespace with a single command.
  • When pods get restarts, resume the port forwarding by retrying for 10 times before giving up.
    • The first 5 retries are done with 1 second delay.
    • The rest of the 5 retries are done with 30 seconds delay.

Usage

Flag Description
-h Print usage help
-l Print configured profile names
-p <profile> Use the provided profile name
-complete Install bash
-uncomplete Uninstall bash

First time use

When running for the first time kpm with no-arguments it will create a empty configuration file at ~/.kpm/config.json with following content

{
  "profiles": [
    {
      "name": "default",
      "config": {
        "namespace": "default",
        "entries": [
          {
            "serviceName": "svc/changeme",
            "servicePort": 80,
            "localPort": 8080
          }
        ]
      }
    }
  ]
}

You can then change this file to define your own profiles you want to manage.

Property Description
profiles[].name Name of the profile
profiles[].config.namespace The kubernetes namespace
profiles[].config.entries[].serviceName The kubernetes service name
profiles[].config.entries[].servicePort The kubernetes service port
profiles[].config.entries[].localPort The local port which you want to bind the service port to

About

Kubernetes Port-Forward Manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published