Hi All,
I have deployed traefik ingress controller v2 along with toml file. I am not able to access dashboard unless I mention:
[api]
insecure = true
Also, I am not able to access my application in https but in http, it's working well. I am getting 404 Not found.
Here is my traefik configuration and toml file:
traefik.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
k8s-app: traefik-ingress-lb
name: traefik-ingress-controller
namespace: public
spec:
selector:
matchLabels:
k8s-app: traefik-ingress-lb
revisionHistoryLimit: 10
template:
metadata:
creationTimestamp: null
labels:
k8s-app: traefik-ingress-lb
name: traefik-ingress-lb
spec:
hostNetwork: true
containers:
- args:
- --configfile=/etc/traefik/traefik.toml
- --global.checknewversion
- --global.sendanonymoususage
- --api.dashboard=true
- --providers.kubernetescrd
- --providers.kubernetesingress
image: traefik:2.4.8
imagePullPolicy: IfNotPresent
name: traefik
ports:
- containerPort: 9000
name: traefik
protocol: TCP
- containerPort: 80
name: web
protocol: TCP
- containerPort: 443
name: websecure
protocol: TCP
resources:
requests:
cpu: 1
memory: 1G
limits:
cpu: 1
memory: 1G
env:
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
securityContext:
privileged: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name: traefik-tmpl
mountPath: /etc/traefik
readOnly: true
- mountPath: /ssl
name: ssl
dnsPolicy: ClusterFirst
nodeSelector:
kubernetes.io/arch: amd64
role: "mcdr_public"
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
fsGroup: 65532
serviceAccount: traefik-ingress-controller
serviceAccountName: traefik-ingress-controller
tolerations:
- effect: NoSchedule
key: node-role-kubernetes-io/public
operator: Exists
- key: "CriticalAddonsOnly"
operator: "Exists"
terminationGracePeriodSeconds: 60
volumes:
- name: ssl
secret:
secretName: traefik-wildcard-cert
- name: traefik-tmpl
configMap:
name: traefik-tmpl
items:
- key: traefik.toml
path: traefik.toml
======
traefik.toml
data:
traefik.toml: |
[serversTransport]
insecureSkipVerify = true
maxIdleConnsPerHost = 0
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.websecure]
address = ":443"
[entryPoints.traefik]
address = ":9000"
[[tls.certificates]]
CertFile = "/ssl/tls.crt"
KeyFile = "/ssl/tls.key"
[tls.options]
[tls.options.default]
minVersion = "VersionTLS12"
cipherSuites = [
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305",
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305",
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
]
[providers]
providersThrottleDuration = "2s"
[providers.kubernetesIngress]
throttleDuration = "0s"
[api]
dashboard = true
[log]
level = "DEBUG"
filePath = "/var/log/traefik.log"
format = "json"
[accessLog]
format = "json"
bufferingSize = 0
[accessLog.fields]
defaultMode = "drop|keep"
[accessLog.fields.headers]
defaultMode = "drop|keep|redact"
[accessLog.fields.headers.names]
Authorization = "drop"
Compressedjwt = "drop"
Content-Type = "keep"
Cookie = "drop"
Jwt = "drop"
User-Agent = "redact"
request_Apijwt = "drop"