3

I tried to open nodePort 80/443, but it failed because it was outside the default nodePort range.

Solution is add - --service-node-port-range option to static pod kube-apiserver-docker-desktop. But how can I modify the static pod using Docker Desktop on Windows? I tried to edit this pod directly but failed.

kubectl edit pod kube-apiserver-docker-desktop -n kube-system
Christopher Peisert
  • 21,862
  • 3
  • 86
  • 117
FakeAlcohol
  • 860
  • 7
  • 28

1 Answers1

3

You need to run a privileged docker container :

$ docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh

Then edit kubernetes configuration here :

$ vi /etc/kubernetes/manifests/kube-apiserver.yaml

Add the command line param in the list with the ports you need:

        - --service-node-port-range=80-36000

This StackOverflow question explain how to process :

Location of Kubernetes config directory with Docker Desktop on Windows

Gael C
  • 46
  • 2
  • $ k describe po/kube-apiserver-docker-desktop --namespace kube-system // --enable-admission-plugins=NodeRestriction,AlwaysPullImages – Jankiel Goldman Jan 07 '21 at 11:51