origin: error: a port needed by OpenShift is not available

Oc cluster up give error message, port not avaialbe.

Version

RHEL 7.6 (maipo)

oc version

oc v3.11.0+62803d0-1
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://os-m.dev.centevo.no:8443
openshift v3.11.0+92b7c41-132
kubernetes v1.11.0+d4cacc0
Steps To Reproduce

oc cluster up

Current Result
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Checking type of volume mount ...
Determining server IP ...
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
error: a port needed by OpenShift is not available
Expected Result

cluster starts

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 18 (1 by maintainers)

Most upvoted comments

make sure that kubelet.service is not running while starting up oc cluster

I didn’t have minikube enabled, but I did have microk8s installed too. Stopped microk8s and oc cluster up worked.

oc cluster down
systemctl restart docker
systemctl list-units --type=service

Then use systemctl stop to stop service which you think it might be relative to OKD. Now oc cluster up works

@Genzer @Steinbjarne We are also getting same error in OKD oc v3.11 while bringing up the cluster. Please suggest if you found some solution for it.

#oc cluster up
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Checking type of volume mount ...
Determining server IP ...
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
error: a port needed by OpenShift is not available

I had shutdown and retried and the process succeeded.

One important thing: I always had problems using Ansible 2.7 to run the playbook of v3.11 tag. Using Ansible 2.6.5 guaranteed the playbook successful.

Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Creating shared mount directory on the remote host ...
Determining server IP ...
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking prerequisites for port forwarding ...
Checking if required ports are available ...
error: a port needed by OpenShift is not available

I have the same issue on mac. I resolve this by turn on(it was off), and then turn off kubernetes.

image

I guess it’s the kube docker process has take the some ports.

Need to stop running instance of minikube…