profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/tc-turner/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

tc-turner/AWS-Firewall-CLI 0

A CLI wrapper for AWS security groups. Uses boto3

tc-turner/external-dns 0

Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services

tc-turner/hana-backup 0

SAP HANA backup tool

tc-turner/ingress-nginx 0

NGINX Ingress Controller for Kubernetes

tc-turner/kubectx 0

Fast way to switch between clusters and namespaces in kubectl – [✩Star] if you're using it!

tc-turner/PlayBook-Friday---Have-I-Been-Pwned- 0

A ThreatConnect PlayBook to query haveibeenpwned.com

issue closedahmetb/kubectx

Error when switching context

Hi,

I just upgraded to 0.9.3 and kubectx is no longer working. When I run kubectx -c I get the following:

/usr/local/bin/kubectx: line 194: 77535 Killed: 9 kubectl config current-context

I downloaded 0.9.2 from the assets page and it works as expected.

I'm on MacOS 11.2.2 and (have always) installed kubectx/kubns from homebrew.

closed time in 3 hours

futurekill

issue commentahmetb/kubectx

Error when switching context

I just rebooted my machine for an unrelated issue and now it's working. I use fish shell and I think that got updated recently too. Might have been related.

futurekill

comment created time in 3 hours

issue commentahmetb/kubectx

Error when switching context

The version of 0.9.2 I downloaded was the binary version: kubectx: Mach-O 64-bit executable x86_64

It looks like the version from homebrew is a shellscript though.

futurekill

comment created time in 4 hours

issue commentahmetb/kubectx

Error when switching context

Here's the output from kubectx -c with DEBUG on:

+ IFS='
	'
+ SELF_CMD=/usr/local/bin/kubectx
+ KUBECTX=/Users/james/.kube/kubectx
+ main -c
+ [[ -z '' ]]
+ hash kubectl
+ KUBECTL=kubectl
+ [[ 1 -eq 0 ]]
+ [[ -c == \-\d ]]
+ [[ 1 -gt 1 ]]
+ [[ 1 -eq 1 ]]
+ [[ -c == \- ]]
+ [[ -c == \-\c ]]
+ kubectl config current-context
/usr/local/bin/kubectx: line 194: 91277 Killed: 9               kubectl config current-context```

and `kubens`:

```+ set -eou pipefail
+ IFS='
	'
+ SELF_CMD=/usr/local/bin/kubens
+ KUBENS_DIR=/Users/james/.kube/kubens
+ main
+ [[ -z '' ]]
+ hash kubectl
+ KUBECTL=kubectl
+ [[ 0 -eq 0 ]]
+ [[ -t 1 ]]
+ [[ -z '' ]]
++ type fzf
++ echo 0
+ [[ 0 -eq 0 ]]
+ choose_namespace_interactive
++ list_namespaces
++ local yellow darkbg normal
+++ tput setaf 3
++ yellow=''
+++ tput setab 0
++ darkbg=''
+++ tput sgr0
++ normal=''
++ local cur_ctx_fg cur_ctx_bg
++ cur_ctx_fg=''
++ cur_ctx_bg=''
++ local cur ns_list
+++ current_namespace
+++ local cur_ctx
++++ current_context
++++ kubectl config current-context
+++ cur_ctx=
+++ exit_err 'error getting current context'
+++ echo 'error getting current context'
error getting current context
+++ exit 1
++ cur=
++ exit_err 'error getting current namespace'
++ echo 'error getting current namespace'
error getting current namespace
++ exit 1
+ [[ -z '' ]]
+ echo 'error: could not list namespaces (is the cluster accessible?)'
error: could not list namespaces (is the cluster accessible?)
+ exit 1```
futurekill

comment created time in 4 hours

issue commentahmetb/kubectx

Error when switching context

Also you're using the bash script version (not the binary version) from the Assets page right?

futurekill

comment created time in 4 hours

issue commentahmetb/kubectx

Error when switching context

Can you run with environment variable DEBUG=1 and send output?

futurekill

comment created time in 4 hours

issue openedahmetb/kubectx

Error when switching context

Hi,

I just upgraded to 0.9.3 and kubectx is no longer working. When I run kubectx -c I get the following:

/usr/local/bin/kubectx: line 194: 77535 Killed: 9 kubectl config current-context

I downloaded 0.9.2 from the assets page and it works as expected.

I'm on MacOS 11.2.2 and (have always) installed kubectx/kubns from homebrew.

created time in 4 hours

pull request commentahmetb/kubectx

store the new context name

There already is a file on disk that has the context file name. So what you’re trying to do is not only redundant, it creates multiple sources of truth for the same piece of information. This info doesn’t only change via kubectx. I recommend you examine the source code of the script to understand how it works.

scones

comment created time in 5 hours

issue closedahmetb/kubectx

kubens + http_proxy env

Looks like 0.9.3 lost the ability to use the http_proxy environment variable to connect to the cluster.

Up to 0.9.2 I am able to just use:

$ echo $http_proxy
http://localhost:8888
$ kubens
default
www

On 0.9.3:

$ echo $http_proxy
http://localhost:8888
$ kubens
error: could not list namespaces (is the cluster accessible?): failed to list namespaces from k8s API: Get "https://<ip>/api/v1/namespaces?limit=500": dial tcp <ip>:443: i/o timeout

<ip> in this particular context is a GKE instance that only allows connections via a bastion. I have tinyproxy running in the bastion. localhost:8888 is provided by a SSH tunnel (ssh -f -L 8888:127.0.0.1:8888 -N my-bastion).

closed time in 6 hours

kassner

issue commentahmetb/kubectx

kubens + http_proxy env

Yeah, that was it:

$ HTTPS_PROXY=$http_proxy ./kubens-0.9.3 
default
www

Awesome. Thank you @ahmetb!

kassner

comment created time in 6 hours

pull request commentahmetb/kubectx

store the new context name

yes, one can. i also can send pidgeons to aws with and encrypted stick to a dedicated staff member to decrypt, extract, re-encrypt and send back the information.

or i can just cache it locally, as it only changes on request.

this is a optimization feature, not a functional one.

scones

comment created time in 6 hours

issue commentahmetb/kubectx

kubens + http_proxy env

Ok here’s from Go1.16 release notes:

The ProxyFromEnvironment function no longer returns the setting of the HTTP_PROXY environment variable for https:// URLs when HTTPS_PROXY is unset.

so you need to use HTTPS_PROXY from now on.

kassner

comment created time in 6 hours

issue commentahmetb/kubectx

kubens + http_proxy env

If you want to compare the checksums:

$ sha256sum kubens*
f479cb7c46e5e1844e57920ecc96489e1c2785c2e89e14abd8e6699b4323c0e4  kubens-0.9.2
58b9a3c4707ff39d7bed4c28afeeb1b1007bf9255c80ba6711bd3a515344baf9  kubens-0.9.3
$ ./kubens-0.9.2 
default
www
$ ./kubens-0.9.3 
error: could not list namespaces (is the cluster accessible?): failed to list namespaces from k8s API: Get "https://<ip>/api/v1/namespaces?limit=500": dial tcp <ip>:443: i/o timeout

The only other difference is that the 0.9.3 binary is 1172KB smaller, but I have no idea if that should mean something.

kassner

comment created time in 6 hours

issue commentahmetb/kubectx

kubens + http_proxy env

And you’re certain the same binary w/ 0.9.2 does not reproduce? If so, I have no reasonable expectation.

kassner

comment created time in a day

issue commentahmetb/kubectx

kubens + http_proxy env

Golang, from the releases page: https://github.com/ahmetb/kubectx/releases/download/v0.9.3/kubens_v0.9.3_linux_x86_64.tar.gz

kassner

comment created time in a day

issue commentahmetb/kubectx

kubens + http_proxy env

Is this the Go-based implementation or bash-based implementation of kubens? There are no code changes between the two versions mentioned https://github.com/ahmetb/kubectx/compare/v0.9.2...v0.9.3.

kassner

comment created time in a day

PR closed ahmetb/kubectx

store the new context name cla: no

.. to use with other scripts or the PS1

+1 -0

2 comments

1 changed file

scones

pr closed time in a day

pull request commentahmetb/kubectx

store the new context name

You can use kubectl to get it.

scones

comment created time in a day

pull request commentahmetb/kubectx

store the new context name

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

<!-- need_sender_cla -->

scones

comment created time in a day

PR opened ahmetb/kubectx

store the new context name

.. to use with other scripts or the PS1

+1 -0

0 comment

1 changed file

pr created time in a day

issue openedahmetb/kubectx

kubens + http_proxy env

Looks like 0.9.3 lost the ability to use the http_proxy environment variable to connect to the cluster.

Up to 0.9.2 I am able to just use:

$ echo $http_proxy
http://localhost:8888
$ kubens
default
www

On 0.9.3:

$ echo $http_proxy
http://localhost:8888
$ kubens
error: could not list namespaces (is the cluster accessible?): failed to list namespaces from k8s API: Get "https://<ip>/api/v1/namespaces?limit=500": dial tcp <ip>:443: i/o timeout

<ip> in this particular context is a GKE instance that only allows connections via a bastion. I have tinyproxy running in the bastion. localhost:8888 is provided by a SSH tunnel (ssh -f -L 8888:127.0.0.1:8888 -N my-bastion).

created time in a day

issue commentahmetb/kubectx

Proposal: Support copying or aliasing contexts

In case anyone is still interested in this functionality, the tool kubeswitch might solve the alias problem for you by transparently defining the alias without changing the underlying kubeconfig file. Full disclosure: I am the author of it.

joemiller

comment created time in 2 days

issue closedahmetb/kubectx

Add Mac M1 build

Title is clear :)

closed time in 4 days

cagataygurturk

issue commentahmetb/kubectx

Add Mac M1 build

Works like a charm :) Sagol!

cagataygurturk

comment created time in 4 days

issue commentahmetb/kubectx

Add Mac M1 build

Please try out the binary at https://github.com/ahmetb/kubectx/releases/tag/v0.9.3.

For the time being, both Homebrew and Krew distributions use the old bash-based implementation (as that’s intended). In the future, we’ll be packaging and distributing the binaries instead.

cagataygurturk

comment created time in 4 days

release ahmetb/kubectx

v0.9.3

released time in 4 days

push eventahmetb/kubectx

Ahmet Alp Balkan

commit sha 3504e66edbe51e1bcbb57cd02b2cf6972e9d501d

Provide binary release for darwin/arm64 Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

view details

push time in 4 days

created tagahmetb/kubectx

tagv0.9.3

Faster way to switch between clusters and namespaces in kubectl

created time in 4 days

issue commentahmetb/kubectx

Add Mac M1 build

Of course I can

cagataygurturk

comment created time in 4 days

issue commentahmetb/kubectx

Add Mac M1 build

Can you test the binary if I provide one?

cagataygurturk

comment created time in 4 days