So, I would like to have a static IP that points to my nginx ingress LB.
gcloud compute addresses create test-ip --global
gcloud compute addresses describe test-ip --global
Which provides me with a static IP that I can now use.
detailed output:
address: 34.120.62.131
addressType: EXTERNAL
creationTimestamp: '2021-02-10T10:27:32.806-08:00'
description: ''
id: '6370409738458995579'
ipVersion: IPV4
kind: compute#address
name: dashboard-ip
networkTier: PREMIUM
status: RESERVED
I'm trying to follow this guide instructions but the 'stable' helm repos has since gone away and the helm chart i'm trying to use is the following. I'm not sure if this is the recommended one to use with helm, but seeing as it's owned by the K8s org it seems like the right choice.
The option that is referenced in the post doesn't exist anymore, so I'm getting all the values from the chart and overriding what seems to be the correct values though I am shooting in the dark.
controller:
service:
loadBalancerIP: "34.120.62.131"
install the chart using:
helm install samir ingress-nginx/ingress-nginx -f override.yml
At this point it gets stuck in state.
k logs service/samir-ingress-nginx-controller (gke_esnet-sd-dev_us-central1-c_test-dashboard-ansible/default)
-------------------------------------------------------------------------------
NGINX Ingress controller
Release: v0.44.0
Build: f802554ccfadf828f7eb6d3f9a9333686706d613
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.19.6
-------------------------------------------------------------------------------
I0211 18:13:45.281578 6 flags.go:208] "Watching for Ingress" class="nginx"
W0211 18:13:45.281650 6 flags.go:213] Ingresses with an empty class will also be processed by this Ingress controller
W0211 18:13:45.282066 6 client_config.go:614] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I0211 18:13:45.282327 6 main.go:241] "Creating API client" host="https://10.11.240.1:443"
I0211 18:13:45.293561 6 main.go:285] "Running in Kubernetes cluster" major="1" minor="17+" git="v1.17.14-gke.1600" state="clean" commit="7c407f5cc8632f9af5a2657f220963aa7f1c46e7" platform="linux/amd64"
I0211 18:13:45.407646 6 main.go:105] "SSL fake certificate created" file="/etc/ingress-controller/ssl/default-fake-certificate.pem"
I0211 18:13:45.434246 6 ssl.go:532] "loading tls certificate" path="/usr/local/certificates/cert" key="/usr/local/certificates/key"
I0211 18:13:45.473930 6 nginx.go:254] "Starting NGINX Ingress controller"
I0211 18:13:45.495884 6 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"default", Name:"samir-ingress-nginx-controller", UID:"7eee0403-5f51-4cda-bd76-84d977ac473e", APIVersion:"v1", ResourceVersion:"446265", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap default/samir-ingress-nginx-controller
I0211 18:13:46.674807 6 nginx.go:296] "Starting NGINX process"
I0211 18:13:46.675212 6 leaderelection.go:243] attempting to acquire leader lease default/ingress-controller-leader-nginx...
I0211 18:13:46.675645 6 nginx.go:316] "Starting validation webhook" address=":8443" certPath="/usr/local/certificates/cert" keyPath="/usr/local/certificates/key"
I0211 18:13:46.675885 6 controller.go:146] "Configuration changes detected, backend reload required"
I0211 18:13:46.678746 6 status.go:84] "New leader elected" identity="samir-ingress-nginx-controller-57f8695bcc-d4pmq"
I0211 18:13:46.772343 6 controller.go:163] "Backend successfully reloaded"
I0211 18:13:46.772435 6 controller.go:174] "Initial sync, sleeping for 1 second"
I0211 18:13:46.772584 6 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"default", Name:"samir-ingress-nginx-controller-57f8695bcc-959pw", UID:"fcb5dbc0-7c43-4330-8641-a00514103afd", APIVersion:"v1", ResourceVersion:"446293", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I0211 18:14:18.716021 6 leaderelection.go:253] successfully acquired lease default/ingress-controller-leader-nginx
I0211 18:14:18.716815 6 status.go:84] "New leader elected" identity="samir-ingress-nginx-controller-57f8695bcc-959pw"
Is there something i'm missing?
NOTE: I did stumble on this alternative chart. Which seems closer to what is referenced in the stackoverflow post I linked above, though even using that i'm unable to get it to work. Is there maybe an option i've missed when creating the cluster?
My suggestion would be to take a look at the official documentation, for example, here you can find how to assign a static IP for your nginx-ingress controller, also you can use this GCP tutorial as reference, it contains a step by step guide to install the Nginx ingress controller via Helm and then exposes the services with an External Load Balancer, if you already reserved the IP you can run this command instead:
Which is pretty much the same as in the guide that you were following, if you did not reserve the IP beforehand you just need to let GKE assign the IP and follow the tutorial, there is a missing step that would be to promote the External IP to static as described in the example.
Instead, if you were using the GKE Ingress controller this can be easily done by specifying the name of the static IP in the annotation "kubernetes.io/ingress.global-static-ip-name" as described here, asumming that your IP is named "test-ip" it should look like this: