Kubernetes
Microk8s
Nginx Ingress
HTTP Error
Extensions v1beta1

Microk8s dashboard using nginx-ingress via http not working Error no matches for kind Ingress in version extensions/v1beta1

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

The error no matches for kind "Ingress" in version "extensions/v1beta1" occurs because the extensions/v1beta1 API version for Ingress was removed in Kubernetes 1.22. Starting from Kubernetes 1.19, Ingress moved to networking.k8s.io/v1, and the old API versions (extensions/v1beta1 and networking.k8s.io/v1beta1) were deprecated and eventually removed. The fix is to update your Ingress manifest to use apiVersion: networking.k8s.io/v1 with the updated spec format.

The Error

bash
1$ kubectl apply -f dashboard-ingress.yaml
2error: resource mapping not found for name: "dashboard-ingress"
3namespace: "" from "dashboard-ingress.yaml":
4no matches for kind "Ingress" in version "extensions/v1beta1"

This happens when applying an Ingress manifest that uses the old API version on Kubernetes 1.22+.

Fix: Update the API Version

yaml
1# OLD (broken on Kubernetes 1.22+)
2apiVersion: extensions/v1beta1
3kind: Ingress
4metadata:
5  name: dashboard-ingress
6  annotations:
7    nginx.ingress.kubernetes.io/rewrite-target: /
8spec:
9  rules:
10    - host: dashboard.local
11      http:
12        paths:
13          - path: /
14            backend:
15              serviceName: kubernetes-dashboard
16              servicePort: 443
yaml
1# NEW (works on Kubernetes 1.19+)
2apiVersion: networking.k8s.io/v1
3kind: Ingress
4metadata:
5  name: dashboard-ingress
6  annotations:
7    nginx.ingress.kubernetes.io/rewrite-target: /
8    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
9spec:
10  ingressClassName: nginx
11  rules:
12    - host: dashboard.local
13      http:
14        paths:
15          - path: /
16            pathType: Prefix
17            backend:
18              service:
19                name: kubernetes-dashboard
20                port:
21                  number: 443

Key changes in networking.k8s.io/v1:

  • pathType is now required (Prefix, Exact, or ImplementationSpecific)
  • backend uses nested service.name and service.port.number instead of serviceName/servicePort
  • ingressClassName replaces the kubernetes.io/ingress.class annotation

MicroK8s Setup

bash
1# Enable required addons
2microk8s enable dns
3microk8s enable dashboard
4microk8s enable ingress
5
6# Verify ingress controller is running
7microk8s kubectl get pods -n ingress
8
9# Check available API versions
10microk8s kubectl api-versions | grep networking
11# networking.k8s.io/v1
12
13# Check Kubernetes version
14microk8s kubectl version --short

Complete Dashboard Ingress Configuration

yaml
1# dashboard-ingress.yaml
2apiVersion: networking.k8s.io/v1
3kind: Ingress
4metadata:
5  name: dashboard-ingress
6  namespace: kube-system
7  annotations:
8    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
9    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
10    nginx.ingress.kubernetes.io/rewrite-target: /
11spec:
12  ingressClassName: nginx
13  tls:
14    - hosts:
15        - dashboard.local
16      secretName: dashboard-tls
17  rules:
18    - host: dashboard.local
19      http:
20        paths:
21          - path: /
22            pathType: Prefix
23            backend:
24              service:
25                name: kubernetes-dashboard
26                port:
27                  number: 443
bash
1# Apply the ingress
2microk8s kubectl apply -f dashboard-ingress.yaml
3
4# Add host entry for local testing
5echo "127.0.0.1 dashboard.local" | sudo tee -a /etc/hosts
6
7# Get dashboard token
8microk8s kubectl -n kube-system describe secret \
9  $(microk8s kubectl -n kube-system get secret | grep default-token | awk '{print $1}')
10
11# Access at https://dashboard.local

Checking and Converting Old Manifests

bash
1# Check which API version your manifests use
2grep -r "extensions/v1beta1" *.yaml
3grep -r "networking.k8s.io/v1beta1" *.yaml
4
5# Use kubectl convert (if available) to auto-convert
6kubectl convert -f old-ingress.yaml --output-version networking.k8s.io/v1
7
8# Validate your manifest before applying
9microk8s kubectl apply -f ingress.yaml --dry-run=client

API Version Reference

 
1Kubernetes Version | extensions/v1beta1 | networking.k8s.io/v1beta1 | networking.k8s.io/v1
2< 1.14             | Available          | Not available              | Not available
31.14 - 1.18        | Deprecated         | Available                  | Not available
41.19 - 1.21        | Deprecated         | Deprecated                 | Available (preferred)
51.22+              | Removed            | Removed                    | Available (only option)

Always use networking.k8s.io/v1 for any cluster running Kubernetes 1.19 or later.

HTTP vs HTTPS Backend

yaml
1# If dashboard runs on HTTPS (default), add this annotation
2metadata:
3  annotations:
4    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
5
6# If you've configured dashboard for HTTP
7metadata:
8  annotations:
9    nginx.ingress.kubernetes.io/backend-protocol: "HTTP"

The Kubernetes dashboard serves HTTPS by default on port 443. Without the backend-protocol: "HTTPS" annotation, nginx tries HTTP to the backend and gets a connection error.

Common Pitfalls

  • Using deprecated API versions: extensions/v1beta1 was removed in Kubernetes 1.22. Always check your cluster version with kubectl version and use networking.k8s.io/v1.
  • Missing pathType field: In networking.k8s.io/v1, pathType is required. Omitting it causes a validation error. Use Prefix for path prefix matching or Exact for exact path matching.
  • Missing ingressClassName: The kubernetes.io/ingress.class annotation is deprecated in favor of spec.ingressClassName. For MicroK8s with the ingress addon, use ingressClassName: nginx (or public depending on the MicroK8s version).
  • Wrong namespace: The Kubernetes dashboard runs in kube-system (or kubernetes-dashboard namespace in some setups). The Ingress must be in the same namespace as the service it routes to, or you must use an ExternalName service.
  • Backend protocol mismatch: The dashboard uses HTTPS by default. Without nginx.ingress.kubernetes.io/backend-protocol: "HTTPS", the ingress controller tries plain HTTP to the backend and gets a 400 error or connection reset.

Summary

  • Update apiVersion from extensions/v1beta1 to networking.k8s.io/v1
  • Add required pathType field (Prefix or Exact) to each path
  • Use nested service.name and service.port.number instead of serviceName/servicePort
  • Set ingressClassName: nginx instead of the deprecated kubernetes.io/ingress.class annotation
  • Add backend-protocol: "HTTPS" annotation when the backend service uses HTTPS
  • Enable MicroK8s addons (dns, dashboard, ingress) before creating the Ingress resource

Course illustration
Course illustration

All Rights Reserved.