3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Kubernetes NodePortで30000~32767以外のポートも割り当てられるようにする(Microk8s)

Last updated at Posted at 2019-10-23

背景

KuberentesのNodePortは、デフォルトでは30000~32767以外のポートは割当できない用に設定されている。

それ以外のポート(8080)を割り当てたいときには、設定変更が必要

解決方法

kubernetesのマスターノードを変更できる環境であることが必須

  • GKE などではおそらく不可

kube-apiserver のオプションである--service-node-port-rangeを有効にする

例: Microk8s

/var/snap/microk8s/current/args/kube-apiserver
....(略)...

# 次の1行を追加する                                                                    
# --service-node-port-range <from>-<to>   

--service-node-port-range 2000-32767       

書き換えたら、microk8sを再起動

sudo systemctl restart snap.microk8s.daemon-apiserver.service

References:

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?