Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
Cover image for Issue with Ingress of Kubernetes after update
Manuel Montero
Manuel Montero

Posted on

Issue with Ingress of Kubernetes after update

One of my old kubernetes cluster on DigitalOcean stopped working on October 12th and the issue was on the ingress created for every app that have.

Solution

Step 1: Nginx Ingress

Remove the previous helm char for nginx-ingress

helm uninstall nginx-ingress -n ingress-nginx
Enter fullscreen mode Exit fullscreen mode

Add repository to helm

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
Enter fullscreen mode Exit fullscreen mode

Update repo

helm repo update
Enter fullscreen mode Exit fullscreen mode

Install new version of nginx-ingress using helm

helm install nginx-ingress  nginx-stable/nginx-ingress --set controller.publishService.enabled=true
Enter fullscreen mode Exit fullscreen mode

Step 2: Update Ingress yaml of every app

Needed update yaml because the specification change in the last update now it need to be something like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hackerss-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: hackerss-service
              port:
                number: 8080

Enter fullscreen mode Exit fullscreen mode

These are the things that changed from the old yaml files:

1.- Update apiVersion: networking.k8s.io/v1
2.- Add kubernetes.io/ingress.class: nginx
3.- Add pathType: Prefix
4.- Change backend section to:

backend:
  service:
    name: hackerss-service
    port:
      number: 8080
Enter fullscreen mode Exit fullscreen mode

Top comments (0)