LoginSignup
11
8

More than 5 years have passed since last update.

Minikubeで快適にIngressを利用したいが、dnsmasqの設定は面倒なので省略したい

Last updated at Posted at 2018-01-29

はじめに

Minikube で快適に Ingress を利用するのバリエーション(パクり)です。

手抜きポイント

  • nip.ioを利用してdnsmasqのメンテを不要にする
  • hostヘッダの指定も不要にする

手順

Ingress controller有効化

$ minikube addons enable ingress
$ watch kubectl get po -n kube-system

Nginxコンテナ実行/サービス公開

$ kubectl run nginx --image=nginx
$ kubectl expose deploy nginx --port=8080 --target-port=80

Ingress作成(nip.io利用)

$ cat <<EOL | kubectl create -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx
spec:
  rules:
  - host: nginx.$(minikube ip).nip.io
    http:
      paths:
      - backend:
          serviceName: nginx
          servicePort: 80
EOL

Servieへのアクセス

$ open http://nginx.$(minikube ip).nip.io/
11
8
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
11
8