I use ingress nginx (https://kubernetes.github.io/ingress-nginx/)
This is how i build my project in GKE.
Step 1: Install ingress controller (https://kubernetes.github.io/ingress-nginx/deploy/#gce-gke)
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.1/deploy/static/provider/cloud/deploy.yaml
Step 2: I use skaffold dev
to run my k8s file.
Below is my ingress-srv file
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-srv
annotations:
ingressClassName: nginx
nginx-ingress.kubernets.io/user-regex: 'true'
spec:
rules:
- host: ''
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nix-api-clusterip-srv
port:
number: 3020
After that, I can get one external Ip address in GKE but when I delete the ingress controller and repeat step 1 (install the ingress controller again). I will get a new external Ip address.
How can I get a static Ip address even though i deleted the ingress controller?
Thank you