codeaprendiz / learn_kubernetes

Learning Kubernetes
50 stars 22 forks source link

Treafik Let's encrypt simplest example on GKE #1

Closed FL3SH closed 4 years ago

FL3SH commented 4 years ago

Hi, Try with two entrypoints:

---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ingressroutetls
  namespace: default
spec:
  entryPoints:
    - websecure
    - web
  routes:
    - match: Host(`k8sacmetest.gotdns.ch`) && PathPrefix(`/tls`)
      kind: Rule
      services:
        - name: whoami
          port: 80
  tls:
    certResolver: default
codeaprendiz commented 4 years ago

@FL3SH , Thanks a lot. This approach is only partly solving the problem. I am getting a certificate but its not trusted by the browser.

image

FL3SH commented 4 years ago

As I mentioned on SO comment out Line 36 and you should be good. Right now you are using staging env to obtain certificates because on main let's encrypt you have only 5 requests per hour before you will be banned and it is not recommended to use production env for testing.

codeaprendiz commented 4 years ago

Thanks a lot @FL3SH , I will check this soon and update. Was just thinking why the certificate is coming as fake? Is it something that will get resolved after the update you just suggested ?

codeaprendiz commented 4 years ago

Thanks a lot @FL3SH , it worked. Behold the bold and the beautiful certificate!

image