Configure Static IP Nginx ingress Kubernetes - Linux Guru



You have a web server running on kubernetes and expose it on a domain name and you need the external ip of an application to be a static ip that does not change.
  • Reserve a new static IP address for INGRESS.
  • Reserve a static external IP address named my-website-ip by run following command from your machine.
$ gcloud compute addresses create my-website-ip --global
here now we have reserved the static ip for the ingress, lets create ingress controller for the application and attached the static ip.
  • lets create ingress file and describe the service name and static IP.
$ ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: yourappname-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: "my-website-ip"
spec:
  backend:
    serviceName: mywebsite-service
    servicePort: 80
Apply the ingress file and check your app, It should be access by static IP and you should point that IP to your domain name.

Vishal Vyas [Linux Guru]

Welcome to Linux Guru! Hello, friends. My name is Vishal Vyas, and I am a DevOps engineer with expertise in Linux and Cloud Computing. I am also a Certified Kubernetes Administrator with over 12 years of experience in the IT field, working with various technologies. Through this blog, I aim to share my technical knowledge on Linux, AWS, DevOps, and web technologies. I will be posting about what I have learned from the latest web technologies and similar topics.

Post a Comment

If you have any doubts, Please let me know

Previous Post Next Post