Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Tested directly on **macOS** and **Linux** based docker containers.

## MacOs Install / Update

**kubefwd** assumes you have **kubectl** installed and configured with access to a Kubernetes cluster. **kubefwd** uses the **kubectl** current context. The **kubectl** configuration is not used. However, it's configuration is needed to access a Kubernetes cluster.
**kubefwd** assumes you have **kubectl** installed and configured with access to a Kubernetes cluster. **kubefwd** uses the **kubectl** current context. The **kubectl** configuration is not used. However, its configuration is needed to access a Kubernetes cluster.

Ensure you have a context by running:
```bash
Expand All @@ -42,7 +42,7 @@ brew upgrade kubefwd

## Docker

Forward all services from the namespace **the-project** to a Docker container named **the-project**.
Forward all services from the namespace **the-project** to a Docker container named **the-project**:

```bash
docker run -it --rm --privileged --name the-project \
Expand All @@ -51,7 +51,7 @@ docker run -it --rm --privileged --name the-project \
```


Execute a curl call to an Elasticsearch service in your Kubernetes cluster.
Execute a curl call to an Elasticsearch service in your Kubernetes cluster:

```bash
docker exec the-project curl -s elasticsearch:9200
Expand All @@ -65,7 +65,7 @@ Check out the [releases](https://github.com/txn2/kubefwd/releases) section on Gi

## Usage

Forward all services for the namespace `the-project`
Forward all services for the namespace `the-project`:
```bash
sudo kubefwd services -n the-project
```
Expand Down Expand Up @@ -99,7 +99,7 @@ Flags:
-h, --help help for services
-c, --kubeconfig string absolute path to the kubeconfig file (default "/Users/cjimti/.kube/config")
-n, --namespace string Specify a namespace.
-l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
-l, --selector string Selector (label query) to filter on; supports '=', '==', and '!=' (e.g. -l key1=value1,key2=value2).
```

## Development
Expand All @@ -113,7 +113,7 @@ go run ./cmd/kubefwd/kubefwd.go

### Build Run in Docker

Run in the [golang:1.10.3] docker container.
Run in the [golang:1.10.3] docker container:
```bash
docker run -it --rm --privileged \
-v "$(pwd)":/go/src/github.com/txn2/kubefwd \
Expand Down Expand Up @@ -143,7 +143,7 @@ Apache License 2.0

### Sponsor

Opens source utility proudly sponsored by [Deasil Works Inc]
Opens source utility proudly sponsored by [Deasil Works, Inc.]

[Kubernetes]:https://kubernetes.io/
[Kubernetes namespace]:https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Expand Down
12 changes: 6 additions & 6 deletions cmd/kubefwd/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {

Cmd.Flags().StringP("kubeconfig", "c", cfgFilePath, "absolute path to the kubeconfig file")
Cmd.Flags().StringSliceVarP(&namespaces, "namespace", "n", []string{}, "Specify a namespace.")
Cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)")
Cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on; supports '=', '==', and '!=' (e.g. -l key1=value1,key2=value2).")
}

var Cmd = &cobra.Command{
Expand All @@ -55,9 +55,9 @@ var Cmd = &cobra.Command{

if !utils.CheckRoot() {
fmt.Printf(`
This program requires superuser priveledges to run. These
priveledges are required to add IP address aliases to your
loopback interface. Superuser priveledges are also needed
This program requires superuser privileges to run. These
privileges are required to add IP address aliases to your
loopback interface. Superuser privileges are also needed
to listen on low port numbers for these IP addresses.

Try: sudo kubefwd services
Expand Down Expand Up @@ -156,7 +156,7 @@ func fwdServices(opts FwdServiceOpts) error {
pods, err := opts.ClientSet.CoreV1().Pods(svc.Namespace).List(metav1.ListOptions{LabelSelector: selector})

if err != nil {
fmt.Printf("no pods found for %s: %s\n", selector, err.Error())
fmt.Printf("No pods found for %s: %s\n", selector, err.Error())
continue
}

Expand All @@ -183,7 +183,7 @@ func fwdServices(opts FwdServiceOpts) error {
if err != nil {
fmt.Printf("Error getting pod: %s\n", err.Error())
// TODO: Check for other pods?
break // no need to check other ports if we can't ge the pod
break // no need to check other ports if we can't get the pod
}

full := ""
Expand Down