Hello everyone, im having trouble with the SSL auto signed certificate to work. When i go to my web page it says that i doesnt have any certificate.
Im deploying traefik with helm on azure kubernetes services.
This is my ingress yaml of the microservice:
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: httpbin-http-route
namespace: $NAMESPACE
spec:
entryPoints:
- web
routes:
- kind: Rule
match: Host(`$HOST`)
middlewares:
- name: http-redirect-https
namespace: $NAMESPACE
services:
- kind: Service
name: $NAME_SERVICE
namespace: $NAMESPACE
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: httpbin-https-route
namespace: $NAMESPACE
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: Host(`$HOST`)
middlewares:
- name: http-redirect-https
namespace: $NAMESPACE
services:
- kind: Service
name: $NAME_SERVICE
namespace: $NAMESPACE
port: 80
tls:
secretName: $CERTIFICATE
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: http-redirect-https
namespace: $NAMESPACE
spec:
redirectScheme:
scheme: https
permanent: true
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
namespace: $NAMESPACE
name: services-ingress-md-sp
spec:
entryPoints:
- web
routes:
- match: Host(`$HOST`) && Path(`/serv/sesion`)
kind: Rule
middlewares:
- name: services-ingress-md-sp
services:
- name: sesion-service
port: 80
- match: Host(`$HOST`) && Path(`/serv/backend`)
kind: Rule
middlewares:
- name: services-ingress-md-sp
services:
- name: backend-service
port: 80
- match: Host(`$HOST`) && Path(`/backoffice-service`)
kind: Rule
middlewares:
- name: services-ingress-md-sp
services:
- name: backoffice-service
port: 80
- match: Host(`$HOST`) && Path(`/backoffice`)
kind: Rule
middlewares:
- name: services-ingress-md-sp
services:
- name: openbit-backoffice-service
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
namespace: $NAMESPACE
name: services-ingress-md-sp
spec:
stripPrefix:
prefixes:
- /serv/sesion
- /serv/backend
- /backoffice-service
- /backoffice
and this is the code in 1.7 that was working:
# # Ingress--------------------
# apiVersion: networking.k8s.io/v1beta1
# kind: Ingress
# metadata:
# namespace: $NAMESPACE
# name: $NAME_INGRESS_SERVICE
# annotations:
# kubernetes.io/ingress.class: traefik
# traefik.ingress.kubernetes.io/redirect-entry-point: https
# traefik.ingress.kubernetes.io/rule-type: "PathPrefixStrip"
# spec:
# rules:
# - host: $HOST
# http:
# paths:
# - path: /serv/sesion
# backend:
# serviceName: sesion-service
# servicePort: http
# - path: /serv/backend
# backend:
# serviceName: backend-service
# servicePort: http
# - path: /serv/backoffice
# backend:
# serviceName: backoffice-service
# servicePort: http
# - path: /backoffice
# backend:
# serviceName: openbit-backoffice-service
# servicePort: http
# - host: $HOST
# http:
# paths:
# - path: /serv/sesion
# backend:
# serviceName: sesion-service
# servicePort: http
# - path: /serv/backend
# backend:
# serviceName: backend-service
# servicePort: http
# - path: /serv/backoffice
# backend:
# serviceName: backoffice-service
# servicePort: http
# - path: /backoffice
# backend:
# serviceName: openbit-backoffice-service
# servicePort: http
# ---
# apiVersion: networking.k8s.io/v1beta1
# kind: Ingress
# metadata:
# name: $NAME_INGRESS
# namespace: $NAMESPACE
# annotations:
# kubernetes.io/ingress.class: traefik
# #traefik.ingress.kubernetes.io/auth-type: "basic"
# traefik.ingress.kubernetes.io/redirect-entry-point: https
# #traefik.ingress.kubernetes.io/auth-secret: "mysecret"
# #traefik.ingress.kubernetes.io/priority: "$PRIORITY"
# spec:
# tls:
# - secretName: $CERTIFICATE
# rules:
# - host: $HOST
# http:
# paths:
# - backend:
# serviceName: $NAME_SERVICE
# servicePort: http
# - host: $HOST
# http:
# paths:
# - backend:
# serviceName: $NAME_SERVICE
# servicePort: http
#############prueba tls#########3
i am creating the certificate with open SSL:
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout tls.key -out xls.crt -subj "/CN=BLABLABLA" -days 365
kubectl create secret tls certname --key=tls.key --cert=xls.crt -n develop
i dont see any error in the traefik pod
I am missing something? thanks in advance