<p>I want to set up port forwarding from my local ports (nodes) to the pod redis-master after the online guide from <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="noreferrer">kubernetes</a>.</p>

<p>At the moment my prompt is frozen for more than 5 minutes at the <code>port-forward</code> command.</p>

<pre><code>[root@k8s-master deployments]# kubectl create -f https://k8s.io/docs/tasks/access-application-cluster/redis-master.yaml
pod "redis-master" created
[root@k8s-master deployments]# kubectl get pods
NAME                                READY     STATUS    RESTARTS   AGE
redis-master                        2/2       Running   0          1m
[root@k8s-master deployments]# kubectl get pods redis-master --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
6379
[root@k8s-master deployments]# kubectl port-forward redis-master 6379:6379
Forwarding from 127.0.0.1:6379 -&gt; 6379
^C 
</code></pre>

<p>I don't know why my prompt is frozen. In my logs aren't some error or warn entries.</p>

<pre><code>journalctl -u kubelet.service -f --since "2018-02-19 10:30:00" --priority 0
-- Logs begin at Sa 2018-02-03 21:21:50 CET. --
</code></pre>

<p>kubectl version</p>

<pre><code>[root@k8s-master deployments]# kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T09:42:01Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

<p>os-release</p>

<pre><code>[root@k8s-master deployments]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
</code></pre>

<p>Ports</p>

<pre><code>[root@k8s-master deployments]# ss -atun | grep 6379
[root@k8s-master deployments]#
</code></pre>

<p>The behaviour you see is expected. This command does not get daemonized by default. It will be forwarding the port until you kill the command with CTRL-C or other similar methods.</p>

<p>You could try using <code>&amp;</code> at the end of the command if you want to continue using that prompt. Personally I would use a terminal multiplexer like tmux or screen.</p>
