oc cluster up can’t start kube-apiserver due to missing ~/.kube/config

I resolved the issue.

I have Ubuntu with disabled firewall (ufw). But iptables still works.

Command sudo iptables -L shows me many rules which those four:

Chain KUBE-SERVICES (1 references)
target     prot opt source               destination         
REJECT     tcp  --  anywhere             172.30.237.36        /* default/router:80-tcp has no endpoints */ tcp dpt:http reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             172.30.1.1           /* default/docker-registry:5000-tcp has no endpoints */ tcp dpt:5000 reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             172.30.237.36        /* default/router:443-tcp has no endpoints */ tcp dpt:https reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             172.30.237.36        /* default/router:1936-tcp has no endpoints */ tcp dpt:1936 reject-with icmp-port-unreachable

I don’t know where they come from (I can guess – below). I decited to delete it.

sudo iptables -L --line-numbers
sudo iptables -D KUBE-SERVICES 1
sudo iptables -D KUBE-SERVICES 1
sudo iptables -D KUBE-SERVICES 1
sudo iptables -D KUBE-SERVICES 1

And restart system (for sure that iptables is reloaded).

After ./oc cluster up it starts and ~/.kube/config is created.

Server Information ...
OpenShift server started.

The server is accessible via web console at:
    https://127.0.0.1:8443

I guess rules can come from oc cluster up when I run it once at beginning without adding "insecure-registries" : [ "172.30.0.0/16" ] to /etc/docker/daemon.json (I tried to check if this is mandatory)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top