Skip to content

Instantly share code, notes, and snippets.

@chancez
Created August 5, 2016 22:05
Show Gist options
  • Save chancez/bb993765348612f6ee47b59e0e01a8c2 to your computer and use it in GitHub Desktop.
Save chancez/bb993765348612f6ee47b59e0e01a8c2 to your computer and use it in GitHub Desktop.
/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=prometheus get pods -l app=prometheus -o name | cut -d/ -f2 | xargs -I{} kubectl --namespace=prometheus port-forward {} 9090:9090 ⏎ master ✭ ✱
Forwarding from 127.0.0.1:9090 -> 9090
Forwarding from [::1]:9090 -> 9090
Handling connection for 9090
E0805 14:59:31.077716 93923 portforward.go:327] an error occurred forwarding 9090 -> 9090: error forwarding port 9090 to pod prometheus-2790266163-r9g6g_prometheus, uid : unable to do port forwarding: socat not found.
^C
~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system get pods ⏎ master ✭ ✱
NAME READY STATUS RESTARTS AGE
kube-api-checkpoint-172.17.4.100 1/1 Running 0 13m
kube-apiserver-qbbok 2/2 Running 0 14m
kube-controller-manager-4261624-p5hi3 1/1 Running 0 15m
kube-dns-v11-2259792283-ggmur 4/4 Running 0 15m
kube-proxy-vlntd 1/1 Running 0 14m
kube-scheduler-2015870324-u4fpr 1/1 Running 0 15m
kubelet-8calo 1/1 Running 0 14m
~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system port-forward kube-apiserver-qbbok 8080:8080 ⏎ master ✭ ✱
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Handling connection for 8080
E0805 15:00:58.916916 94515 portforward.go:327] an error occurred forwarding 8080 -> 8080: error forwarding port 8080 to pod kube-apiserver-qbbok_kube-system, uid : unable to do port forwarding: socat not found.
Handling connection for 8080
E0805 15:00:59.056751 94515 portforward.go:327] an error occurred forwarding 8080 -> 8080: error forwarding port 8080 to pod kube-apiserver-qbbok_kube-system, uid : unable to do port forwarding: socat not found.
Handling connection for 8080
E0805 15:01:04.082449 94515 portforward.go:327] an error occurred forwarding 8080 -> 8080: error forwarding port 8080 to pod kube-apiserver-qbbok_kube-system, uid : unable to do port forwarding: socat not found.
^C% ~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system get pods --show-labels master ✭ ✱
NAME READY STATUS RESTARTS AGE LABELS
kube-api-checkpoint-172.17.4.100 1/1 Running 0 15m <none>
kube-apiserver-qbbok 2/2 Running 0 16m k8s-app=kube-apiserver,version=v1.3.4_coreos.0
kube-controller-manager-4261624-p5hi3 1/1 Running 0 16m k8s-app=kube-controller-manager,pod-template-hash=4261624,version=v1.3.4_coreos.0
kube-dns-v11-2259792283-ggmur 4/4 Running 0 16m k8s-app=kube-dns,kubernetes.io/cluster-service=true,pod-template-hash=2259792283,version=v11
kube-proxy-vlntd 1/1 Running 0 16m k8s_app=kube-proxy,version=v1.3.4_coreos.0
kube-scheduler-2015870324-u4fpr 1/1 Running 0 16m k8s-app=kube-scheduler,pod-template-hash=2015870324,version=v1.3.4_coreos.0
kubelet-8calo 1/1 Running 0 16m k8s-app=kubelet,version=v1.3.4_coreos.0
~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system get daemonsets master ✭ ✱
NAME DESIRED CURRENT NODE-SELECTOR AGE
kube-apiserver 1 1 master=true 17m
kube-proxy 1 1 <none> 17m
kubelet 1 1 <none> 17m
~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system delete daemonset kubelet master ✭ ✱
daemonset "kubelet" deleted
~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system get daemonsets master ✭ ✱
NAME DESIRED CURRENT NODE-SELECTOR AGE
kube-apiserver 1 1 master=true 18m
kube-proxy 1 1 <none> 18m
~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system get pods master ✭ ✱
NAME READY STATUS RESTARTS AGE
kube-api-checkpoint-172.17.4.100 1/1 Running 0 16m
kube-apiserver-qbbok 2/2 Running 0 18m
kube-controller-manager-4261624-p5hi3 1/1 Running 0 18m
kube-dns-v11-2259792283-ggmur 4/4 Running 0 18m
kube-proxy-vlntd 1/1 Running 0 18m
kube-scheduler-2015870324-u4fpr 1/1 Running 0 18m
~/g/s/g/c/b/h/single-node ❯❯❯ kubectl --namespace=kube-system port-forward kube-apiserver-qbbok 8080:8080 master ✭ ✱
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Handling connection for 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment