Kubernetes Ingress Address is missing in GKE

3/2/2022

I have already install the K8 controllers needed from ingress, however after executing kubectl delete all --all it seem to have deleted something i should have not deleted.

Output where the address is missing:

my-ingress   <none>   *                 80      15m

INgress file:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
spec:
  rules:
  - http:
      paths:
      - path: /*
        pathType: ImplementationSpecific
        backend:
          service:
            name: questionbankrestapi
            port:
              number: 80
      - path: /discounted
        pathType: ImplementationSpecific
        backend:
          service:
            name: questionbankrestapi
            port:
              number: 80

I have installed GKE Controllers using:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.1/deploy/static/provider/cloud/deploy.yaml

And I have also done the bindings:

kubectl create clusterrolebinding cluster-admin-binding   --clusterrole cluster-admin   --user $(gcloud config get-value account)

Here is the describe ing output:

Name:             my-ingress
Labels:           <none>
Namespace:        default
Address:          
Default backend:  default-http-backend:80 (10.4.0.6:8080)
Rules:
  Host        Path  Backends
  ----        ----  --------
  *           
              /*            questionbankrestapi:80 (10.4.0.10:4000)
              /discounted   questionbankrestapi:80 (10.4.0.10:4000)
Annotations:  <none>
Events:
  Type     Reason  Age                 From                     Message
  ----     ------  ----                ----                     -------
  Normal   Sync    84s (x4 over 20m)   loadbalancer-controller  Scheduled for sync
  Warning  Sync    83s (x20 over 19m)  loadbalancer-controller  Error syncing to GCP: error running backend syncing routine: error ensuring health check: googleapi: Error 400: Invalid value for field 'resource.timeoutSec': '15'. TimeoutSec should be less than checkIntervalSec., invalid

Kubernetes Version:

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:25:17Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.6-gke.1503", GitCommit:"2c7bbda09a9b7ca78db230e099cf90fe901d3df8", GitTreeState:"clean", BuildDate:"2022-02-18T03:17:45Z", GoVersion:"go1.16.9b7", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.23) and server (1.21) exceeds the supported minor version skew of +/-1

Ran the Ready Check, seems ok too:

+]ping ok
[+]log ok
[+]etcd ok
[+]informer-sync ok
[+]poststarthook/start-kube-apiserver-admission-initializer ok
[+]poststarthook/generic-apiserver-start-informers ok
[+]poststarthook/priority-and-fairness-config-consumer ok
[+]poststarthook/priority-and-fairness-filter ok
[+]poststarthook/start-apiextensions-informers ok
[+]poststarthook/start-apiextensions-controllers ok
[+]poststarthook/crd-informer-synced ok
[+]poststarthook/bootstrap-controller ok
[+]poststarthook/rbac/bootstrap-roles ok
[+]poststarthook/scheduling/bootstrap-system-priority-classes ok
[+]poststarthook/priority-and-fairness-config-producer ok
[+]poststarthook/start-cluster-authentication-info-controller ok
[+]poststarthook/aggregator-reload-proxy-client-cert ok
[+]poststarthook/start-kube-aggregator-informers ok
[+]poststarthook/apiservice-registration-controller ok
[+]poststarthook/apiservice-status-available-controller ok
[+]poststarthook/kube-apiserver-autoregistration ok
[+]autoregister-completion ok
[+]poststarthook/apiservice-openapi-controller ok
[+]shutdown ok
readyz check passed
-- Smit
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

3/2/2022

If you ran the kubectl delete all --all command then you deleted everything from your current namespace like Pods, Services and Statefulsets, however RoleBindings, ServiceAccounts and NetworkPolicies were not.

For that reason, I suggest you verify if your Load Balancer services and your Health Check time values were set to 15 seconds; this is the default value. If yes, please set it to 60 seconds because the value of the timeout must be less than or equal to the interval. Additionally, if the ingress was deleted; this could also be the cause for the service IP not to be shown.

You can review this in the Services & ingress option in the Kubernetes Engine GCP console menu, so if this was deleted please try to recreate the ingress from scratch.

Attached below is an example on how to correctly set the backend config health check:

    healthCheck:
    checkIntervalSec: 10
    timeoutSec: 10
    port: 80
    requestPath: /discounted
    type: HTTPS
    securityPolicy:
    name: your-policy-restricted
    sessionAffinity:
    affinityType: NONE
    timeoutSec: 60
-- Leo
Source: StackOverflow