# Addon: Ingress

**URL:** https://discuss.kubernetes.io/t/addon-ingress/11259
**Category:** microk8s
**Tags:** docs
**Created:** [June 4, 2020, 3:07pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259 "2020-06-04T15:07:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![evilnick](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/evilnick/32/3481_2.png) [@evilnick](https://discuss.kubernetes.io/u/evilnick)
#### Post date: [June 4, 2020, 3:07pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/1 "2020-06-04T15:07:29Z")

</div>

This addon adds a [Traefik Ingress Controller](https://traefik.io/traefik/) for MicroK8s. It is enabled by running the command:

```bash
microk8s enable ingress

```

> **Note:** Starting with MicroK8s 1.35, the ingress addon uses [Traefik](https://traefik.io/traefik/) as the default ingress controller. Prior versions (\< 1.35) used [NGINX Ingress Controller](https://github.com/kubernetes/ingress-nginx). Existing Ingress resources with `ingressClassName: nginx` will continue to work. See the [Backward Compatibility](#backward-compatibility) section for details.

## Options

The addon supports the following options:

- `-V VERSION` - Traefik Helm chart version
- `-r REPOSITORY` - Traefik Helm chart repository
- `-g GW_VERSION` - Gateway API CRD version
- `--default-ssl-certificate NAMESPACE/NAME` - Kubernetes TLS Secret to use as Traefik’s default TLS certificate

## Creating Ingress Resources

With the Ingress addon enabled, HTTP/HTTPS ingress rules can be created with an Ingress resource. The addon provides three IngressClass options:

- `public` (default) - backward compatible with the previous NGINX setup
- `traefik` - standard Traefik ingress class
- `nginx` - for users migrating from nginx-based ingress resources

For example:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: http-ingress
spec:
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: some-service
            port:
              number: 80

```

## Gateway API Support

The addon also includes Gateway API support. You can create HTTPRoute resources for modern routing:

```yaml
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: my-route
spec:
  parentRefs:
  - name: traefik-gateway
    namespace: ingress
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: some-service
      port: 80

```

## Configuring Default TLS Certificate

To set a default TLS certificate for all HTTPS traffic:

```bash
microk8s enable ingress --default-ssl-certificate my-namespace/my-tls-secret

```

## Backward Compatibility

Users migrating from the previous NGINX-based ingress addon can continue using their existing Ingress resources. The addon includes:

- An `nginx` IngressClass that routes through Traefik
- Support for common NGINX ingress annotations via the `kubernetesIngressNginx` provider

If you encounter unexpected behavior with ingress routing, restarting the addon may resolve the issue:

```bash
microk8s disable ingress
microk8s enable ingress

```

## Disabling the Addon

To disable the ingress addon:

```bash
microk8s disable ingress

```

This will remove Traefik, Gateway API CRDs, and clean up any legacy NGINX ingress resources.

---

<div class="post-metadata">

### Author: ![Alexandr\_Marchenko](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/alexandr_marchenko/32/5399_2.png) [@Alexandr\_Marchenko](https://discuss.kubernetes.io/u/Alexandr_Marchenko)
#### Post date: [June 23, 2020, 12:35pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/2 "2020-06-23T12:35:37Z")

</div>

Wondering what will be recommended way to have microk8s service multiple wildcard https subdomains, e.g. \*.dev.contoso.com, \*.stage.contoso.com

> <https://github.com/kubernetes/ingress-nginx/issues/4674>
>
> Is this a BUG REPORT or FEATURE REQUEST? (choose one):
> BUG REPORT
> NGINX Ingress controller version:
> 0.25.1
> Kubernetes version (use kubectl version):
> v1.13.10-eks-5ac0f1
> Environment:
> Cloud provider or hardware...

At moment it seems to be impossible without heavily changing internals

---

<div class="post-metadata">

### Author: ![kjackal](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/kjackal/32/1750_2.png) [@kjackal](https://discuss.kubernetes.io/u/kjackal)
#### Post date: [June 24, 2020, 9:16am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/3 "2020-06-24T09:16:05Z")

</div>

We recently merged a PR [1] that would allow you to set the default-ssl-certificate [2] via a secret while enabling the ingress add-on:

`microk8s enable ingress:default-ssl-certificate=namespace/secret_name`

This work is on latest/edge and will be officially out with the 1.19 release.

[1] [https://github.com/ubuntu/microk8s/pull/1231](https://github.com/ubuntu/microk8s/pull/1231)  
[2] [https://kubernetes.github.io/ingress-nginx/user-guide/tls/#default-ssl-certificate](https://kubernetes.github.io/ingress-nginx/user-guide/tls/#default-ssl-certificate)

---

<div class="post-metadata">

### Author: ![Alexandr\_Marchenko](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/alexandr_marchenko/32/5399_2.png) [@Alexandr\_Marchenko](https://discuss.kubernetes.io/u/Alexandr_Marchenko)
#### Post date: [June 24, 2020, 10:48am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/4 "2020-06-24T10:48:47Z")

</div>

Yes but this one going to work only if we have single wildcard certificate per cluster, e.g. if I have \*.dev.contoso.com indeed I can use it as default one with proposed default-ssl-certificate setting which is awesome and at least solves half of problem

The problem still persists if cluster is serving multiple wildcard domains, e.g. \*.dev.contoso.com, \*.stage.contoso.com - we can not use any of them as deafult cert

So at moment it seems that the easiest way will be ho have N clusters where N is number of wildcard certificates or hack ingress

---

<div class="post-metadata">

### Author: ![c2o8btr3qkd7](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/c2o8btr3qkd7/32/5626_2.png) [@c2o8btr3qkd7](https://discuss.kubernetes.io/u/c2o8btr3qkd7)
#### Post date: [July 31, 2020, 2:35am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/5 "2020-07-31T02:35:33Z")

</div>

[REQUEST] Will you please add the `name` and `namespace` of Ingress’s ConfigMap to the [document](https://microk8s.io/docs/addon-ingress)?

I finally found that name `nginx-load-balancer-microk8s-conf` though. If the name appeared on the document, we wouldn’t have to look for the command line options of the controller.

---

<div class="post-metadata">

### Author: ![anish\_anil](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/anish_anil/32/3819_2.png) [@anish\_anil](https://discuss.kubernetes.io/u/anish_anil)
#### Post date: [September 21, 2020, 5:01pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/6 "2020-09-21T17:01:03Z")

</div>

Hello Team,

Using the code provided in the document results in the below error:

* * *

kubectl apply -f ingress.yaml  
Warning: [networking.k8s.io/v1beta1](http://networking.k8s.io/v1beta1) Ingress is deprecated in v1.19+, unavailable in v1.22+; use [networking.k8s.io/v1](http://networking.k8s.io/v1) Ingress  
[ingress.networking.k8s.io/http-ingress](http://ingress.networking.k8s.io/http-ingress) configured

* * *

If we change the Ingress to “[networking.k8s.io/v1](http://networking.k8s.io/v1)” it results in the below error:

* * *

kubectl apply -f ingress.yaml  
error: error validating “ingress.yaml”: error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field “serviceName” in io.k8s.api.networking.v1.IngressBackend, ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field “servicePort” in io.k8s.api.networking.v1.IngressBackend]; if you choose to ignore these errors, turn validation off with --validate=false

* * *

What should the correct documentation for Ingress be referred too??

Thank you,  
Anish

---

<div class="post-metadata">

### Author: ![balchua1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/balchua1/32/5372_2.png) [@balchua1](https://discuss.kubernetes.io/u/balchua1)
#### Post date: [September 21, 2020, 10:04pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/7 "2020-09-21T22:04:38Z")

</div>

Hi, currently the nginx ingress doesn’t support the v1 networking api.

The `networking.k8s.io/v1` has some breaking changes to the manifest. It is not just changing the version. We also need to upgrade the ingress controller.

For now refer to the 1.18 ingress [documentation](https://v1-18.docs.kubernetes.io/docs/concepts/services-networking/ingress/).

Apologies for any confusion.

---

<div class="post-metadata">

### Author: ![haris](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/haris/32/6245_2.png) [@haris](https://discuss.kubernetes.io/u/haris)
#### Post date: [November 22, 2020, 10:36am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/8 "2020-11-22T10:36:56Z")

</div>

How do we apply this to already enabled ingress? Do we have to disable and enable again with the option?

---

<div class="post-metadata">

### Author: ![John\_Grabner](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/john_grabner/32/6222_2.png) [@John\_Grabner](https://discuss.kubernetes.io/u/John_Grabner)
#### Post date: [November 22, 2020, 11:26pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/9 "2020-11-22T23:26:35Z")

</div>

Any way to use let’s encrypt certbot to renew certs with microk8s ingress?  
Can microk8s ingress redirect port 80 to 443 ?

Can regular nginx in a pod route to clusterIP address or is there something that would make this not work?

---

<div class="post-metadata">

### Author: ![John\_Grabner](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/john_grabner/32/6222_2.png) [@John\_Grabner](https://discuss.kubernetes.io/u/John_Grabner)
#### Post date: [November 23, 2020, 2:29am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/10 "2020-11-23T02:29:20Z")

</div>

Is the code for

> image: [Google Cloud console](http://k8s.gcr.io/ingress-nginx/controller)

open source?  
Where can I find this code or documentation? I’m looking the github repo for microk8s and looks to me this consumes the configmap? is this

> [Installation Guide - Ingress-Nginx Controller](https://kubernetes.github.io/ingress-nginx/deploy/)

---

<div class="post-metadata">

### Author: ![balchua1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/balchua1/32/5372_2.png) [@balchua1](https://discuss.kubernetes.io/u/balchua1)
#### Post date: [November 23, 2020, 3:01am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/11 "2020-11-23T03:01:00Z")

</div>

Yes microk8s uses the nginx ingress.

---

<div class="post-metadata">

### Author: ![kjackal](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/kjackal/32/1750_2.png) [@kjackal](https://discuss.kubernetes.io/u/kjackal)
#### Post date: [November 23, 2020, 8:40am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/12 "2020-11-23T08:40:07Z")

</div>

Hi @John_Grabner

The ingress controller should be in [https://github.com/kubernetes/ingress-nginx](https://github.com/kubernetes/ingress-nginx)

The ingress manifest we use in MicroK8s is in [https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/actions/ingress.yaml](https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/actions/ingress.yaml)

---

<div class="post-metadata">

### Author: ![BinaryMan32](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/binaryman32/32/6613_2.png) [@BinaryMan32](https://discuss.kubernetes.io/u/BinaryMan32)
#### Post date: [January 1, 2021, 12:55am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/13 "2021-01-01T00:55:15Z")

</div>

I encountered many examples that used an `ingress.class: nginx` annotation as shown below:

```auto
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx

```

Since this page states that it’s a nginx ingress, the above seemed appropriate to include in resource definitions. However, the `ingress.class` of the controller created by this addon is actually `public`.

Should we add a `kubernetes.io/ingress.class: public` annotation to the example to clarify this, and document this in the page text?

---

<div class="post-metadata">

### Author: ![ArrowRaider](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/arrowraider/32/6917_2.png) [@ArrowRaider](https://discuss.kubernetes.io/u/ArrowRaider)
#### Post date: [February 15, 2021, 8:31pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/15 "2021-02-15T20:31:37Z")

</div>

How can I deploy a second nginx ingress controller to microk8s? I need one controller to serve private intranet traffic and the other to serve public traffic.

---

<div class="post-metadata">

### Author: ![haozhiyu](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/haozhiyu/32/7284_2.png) [@haozhiyu](https://discuss.kubernetes.io/u/haozhiyu)
#### Post date: [April 6, 2021, 12:48am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/16 "2021-04-06T00:48:37Z")

</div>

> [@evilnick](#):
>
> ```auto
> spec:
> template:
> spec:
> containers:
> - name: nginx-ingress-microk8s
> ports:
> - containerPort: 80
> name: http
> protocol: TCP
> 
> ```

this should be right

---

<div class="post-metadata">

### Author: ![evilnick](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/evilnick/32/3481_2.png) [@evilnick](https://discuss.kubernetes.io/u/evilnick)
#### Post date: [April 6, 2021, 12:44pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/17 "2021-04-06T12:44:56Z")

</div>

thanks, will test that out

> [@haozhiyu](#):
>
> this should be right

---

<div class="post-metadata">

### Author: ![horvatic](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/horvatic/32/7332_2.png) [@horvatic](https://discuss.kubernetes.io/u/horvatic)
#### Post date: [April 7, 2021, 1:45am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/18 "2021-04-07T01:45:01Z")

</div>

[networking.k8s.io/v1](http://networking.k8s.io/v1) is now supported with nginx, and should be updated in the docs.

Also a useful example would be showing how to ingress the dashboard:

```
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: kube-system
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: HTTPS
    nginx.ingress.kubernetes.io/configuration-snippet: |-
      proxy_ssl_server_name on;
      proxy_ssl_name $host;
  name: dashboard
spec:
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: kubernetes-dashboard
            port:
              number: 443
```

---

<div class="post-metadata">

### Author: ![bttger](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/bttger/32/7378_2.png) [@bttger](https://discuss.kubernetes.io/u/bttger)
#### Post date: [April 10, 2021, 7:03pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/19 "2021-04-10T19:03:05Z")

</div>

Hello,

is there a reason why the ingressClass name was changed to ‘public’ compared to ‘nginx’ in the upstream helm chart?

I tried to install the cert-manager and usually that’s a quick task but due to the me unknown ingressClass name it took hours. Maybe this should be mentioned on the Ingress add-on docs page.

Best  
Tom

---

<div class="post-metadata">

### Author: ![guidoffm](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/guidoffm/32/7379_2.png) [@guidoffm](https://discuss.kubernetes.io/u/guidoffm)
#### Post date: [April 11, 2021, 9:10am UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/20 "2021-04-11T09:10:32Z")

</div>

Hi Tom,  
I found out there is a new resource definition for and this makes sense:

> **[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation)**
>
> FEATURE STATE: Kubernetes v1.19 \[stable\] An API object that manages external access to the services in a cluster, typically HTTP.
> Ingress may provide load balancing, SSL termination and name-based virtual hosting.
> Terminology For clarity, this guide...

Hope this helps.

Cheers

Guido

---

<div class="post-metadata">

### Author: ![bttger](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/bttger/32/7378_2.png) [@bttger](https://discuss.kubernetes.io/u/bttger)
#### Post date: [April 11, 2021, 12:29pm UTC](https://discuss.kubernetes.io/t/addon-ingress/11259/21 "2021-04-11T12:29:20Z")

</div>

I know about the IngressClass resource, but what I am wondering about is why the name got changed to ‘public’ compared to ‘nginx’ in the upstream helm chart of the nginx IngressController. It is nowhere mentioned and unfortunately I did not expect it to be changed, so I tried to set up the cert-manager with ‘nginx’ as the ingessClass name - which of course failed without any error message and so it wasn’t trivial for me to fix the issue.

[Next page](https://discuss.kubernetes.io/t/addon-ingress/11259.md?page=2)
