# Traefik in kubernetes

**URL:** <https://community.traefik.io/t/traefik-in-kubernetes/614>\
**Category:** Traefik v1\
**Tags:** kubernetes-ingress\
**Created:** [June 26, 2019, 6:22pm UTC](https://community.traefik.io/t/traefik-in-kubernetes/614 "2019-06-26T18:22:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pirat8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pirat8/32/330_2.png) [@pirat8](https://community.traefik.io/u/pirat8)\
**Post date:** [June 26, 2019, 6:22pm UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/1 "2019-06-26T18:22:56Z")

</div>

Hi,

I try to use traefik in kubernetes.

However, when I try to start my treafik pods I get an error:

> "Unable to obtain ACME certificate for domains "\*\*\*\*\*" : cannot get ACME client ACME challenge not specified, please select TLS or HTTP or DNS Challenge" providerName=acme

In my traefik.toml I have:

```toml
[acme]
    email = " ***hidden***"
    storageFile = "/acme/acme.json"
    entryPoint = "https"
    onDemand = true
    onHostRule = true
    caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
      [acme.httpChallenge]
       entryPoint = "http"
   [[acme.domains]]
    main = " ***hidden***"

```

"Static configuration loaded" from debug output gives:

```json
..."ACME":{
        "Email":" ***hidden***",
        "ACMELogging":true,
        "CAServer":"https://acme-staging-v02.api.letsencrypt.org/directory",
        "Storage":"/acme/acme.json",
        "EntryPoint":"https",
        "KeyType":"",
        "OnHostRule":true,
        "DNSChallenge":null,
        "HTTPChallenge":{
            "EntryPoint":""
        },
        "TLSChallenge":null,
        "Domains":[
            {
                "Main":" ***hidden***",
                "SANs":null
            }]
    }

```

First question: What is wrong in this config?

Second question: After this step traefik is still not visible from outside. Is it okay to create the ingress rules afterwards as in the blog suggested?

pirat8

---

<div class="post-metadata">

**Author:** ![pirat8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pirat8/32/330_2.png) [@pirat8](https://community.traefik.io/u/pirat8)\
**Post date:** [June 26, 2019, 6:42pm UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/2 "2019-06-26T18:42:57Z")

</div>

I mean this blog:

> **[Kubernetes : Ingress Controller with Træfɪk and Let's Encrypt](https://blog.alterway.fr/en/kubernetes-ingress-controller-with-traefik-and-lets-encrypt.html)**
>
> Kubernetes offers the Ingress feature, which abstract the configuration of a load balancer for services. Coupled with Træfɪk, a cloud reverse proxy, it is possible to add on the fly HTTPS encryption with Let's Encrypt.

  
BTW I use image: containous/traefik:experimental

---

<div class="post-metadata">

**Author:** ![pirat8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pirat8/32/330_2.png) [@pirat8](https://community.traefik.io/u/pirat8)\
**Post date:** [June 27, 2019, 7:26am UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/3 "2019-06-27T07:26:15Z")

</div>

Ok, I think I solved it. The problem was, that I started traefik with the commandline option  
–acme.httpchallenge=true  
This option seems to raise this error. When I omit this option traefik starts successful.

---

<div class="post-metadata">

**Author:** ![pirat8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pirat8/32/330_2.png) [@pirat8](https://community.traefik.io/u/pirat8)\
**Post date:** [June 27, 2019, 7:29am UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/4 "2019-06-27T07:29:49Z")

</div>

I’m a new user here and can only put two links in message, so I try another reply for further problems…

I added a LoadBlancer in front of traefik service and added a A record in route53 in aws.  
In route53 I have now two entries:

1. [rose.mmm.io](http://rose.mmm.io) pointing to the Loadbalancer IP
2. \*.rose.mmm.io pointing to the Loadbalancer IP too

In my traefik.toml I have the following line:  
main = “[rose.mmm.io](http://rose.mmm.io)”

---

<div class="post-metadata">

**Author:** ![pirat8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pirat8/32/330_2.png) [@pirat8](https://community.traefik.io/u/pirat8)\
**Post date:** [June 27, 2019, 7:30am UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/5 "2019-06-27T07:30:22Z")

</div>

In my ingress.yaml I have:

```
- host: whoami.rose.mmm.io
  http:
    paths:
      - backend:
          serviceName: whoami
          servicePort: 80
- host: kubia.rose.mmm.io
  http:
    paths:
      - backend:
          serviceName: kubia
          servicePort: 80
```

---

<div class="post-metadata">

**Author:** ![pirat8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pirat8/32/330_2.png) [@pirat8](https://community.traefik.io/u/pirat8)\
**Post date:** [June 27, 2019, 7:31am UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/6 "2019-06-27T07:31:00Z")

</div>

The problem: I can request both services from internal kubernetes network, but when I call [kubia.rose.mmm.io](http://kubia.rose.mmm.io) from outside via curl and https :  
I see in the traefik logs:  
Serving default certificate for request: “[kubia.rose.mmm.io](http://kubia.rose.mmm.io)”

But I get  
“404 page not found”

The same curl request from inside kubernetes gives me the service-content.

What could be wrong? And how to debug this further?

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [June 27, 2019, 7:48pm UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/10 "2019-06-27T19:48:37Z")

</div>

The `containous/traefik:experimental` is very old and unstable image, and I recommend to don’t use it.

Please use the [Official Docker image](https://hub.docker.com/_/traefik): `traefik:v1.7.12`

To help you to debug, use the [API](https://docs.traefik.io/configuration/api/#api), the [Dashboard](https://docs.traefik.io/configuration/api/#dashboard-web-ui), and the [logs](https://docs.traefik.io/configuration/logs/#traefik-logs).

I recommend to read our tutorial: [https://docs.traefik.io/user-guide/kubernetes/](https://docs.traefik.io/user-guide/kubernetes/)

If you cannot fix your problem, provide your complete configuration (toml, ingress files, etc.) and logs.

---

<div class="post-metadata">

**Author:** ![pirat8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pirat8/32/330_2.png) [@pirat8](https://community.traefik.io/u/pirat8)\
**Post date:** [June 27, 2019, 8:18pm UTC](https://community.traefik.io/t/traefik-in-kubernetes/614/11 "2019-06-27T20:18:22Z")

</div>

Indeed! Changing the traefik-image was enough. Same configuration and it works. Thank you.
