traefik
A Traefik based Kubernetes ingress controller with Let's Encrypt support
About this chart
Traefik
Traefik is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease.
Introduction
This chart bootstraps Traefik as a Kubernetes ingress controller with optional support for SSL and Let's Encrypt.
NOTE: Operators will typically wish to install this component into the kube-system namespace
where that namespace's default service account will ensure adequate privileges to watch Ingress
resources cluster-wide.
Prerequisites
- Kubernetes 1.4+ with Beta APIs enabled
- Kubernetes 1.6+ if you want to enable RBAC
- You are deploying the chart to a cluster with a cloud provider capable of provisioning an external load balancer (e.g. AWS or GKE)
- You control DNS for the domain(s) you intend to route through Traefik
- Suggested: PV provisioner support in the underlying infrastructure
A Quick Note on Versioning
Up until version 1.2.1-b of this chart, the semantic version of the chart was kept in-sync with the semantic version of the (default) version of Traefik installed by the chart. A dash and a letter were appended to Traefik's semantic version to indicate incrementally improved versions of the chart itself. For example, chart version 1.2.1-a and 1.2.1-b both provide Traefik 1.2.1, but 1.2.1-b is a chart that is incrementally improved in some way from its immediate predecessor-- 1.2.1-a.
This convention, in practice, suffered from a few problems, not the least of which was that it defied what was permitted by semver 2.0.0. This, in turn, lead to some difficulty in Helm understanding the versions of this chart.
Beginning with version 1.3.0 of this chart, the version references only
the revision of the chart itself. The appVersion field in chart.yaml now
conveys information regarding the revision of Traefik that the chart provides.
Installing the Chart
To install the chart with the release name my-release:
$ helm install <helm-repo>/traefik --name my-release --namespace kube-system
$ helm install stable/traefik --name my-release --namespace kube-system After installing the chart, create DNS records for applicable domains to direct inbound traffic to the load balancer. You can use the commands below to find the load balancer's IP/hostname:
NOTE: It may take a few minutes for this to become available.
You can watch the status by running:
$ kubectl get svc my-release-traefik --namespace kube-system -w
Once EXTERNAL-IP is no longer <pending>:
$ kubectl describe service my-release-traefik -n kube-system | grep Ingress | awk '{print $3}'
NOTE: If ACME support is enabled, it is only after this step is complete that Traefik will be able to successfully use the ACME protocol to obtain certificates from Let's Encrypt.
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Configuration
The following table lists the configurable parameters of the Traefik chart and their default values.
| Parameter | Description | Default |
|---|---|---|
fullnameOverride | Override the full resource names | {release-name}-traefik (or traefik if release-name is traefik) |
image | Traefik image name | traefik |
imageTag | The version of the official Traefik image to use | 1.7.9 |
serviceType | A valid Kubernetes service type | LoadBalancer |
loadBalancerIP | An available static IP you have reserved on your cloud platform | None |
startupArguments | A list of startup arguments which are passed to traefik | [] |
loadBalancerSourceRanges | List of IP CIDRs allowed access to load balancer (if supported) | None |
externalIP | Static IP for the service | None |
whiteListSourceRange | Enable IP whitelisting at the entrypoint level. | false |
externalTrafficPolicy | Set the externalTrafficPolicy in the Service to either Cluster or Local | Cluster |
replicas | The number of replicas to run; NOTE: Full Traefik clustering with leader election is not yet supported, which can affect any configured Let's Encrypt setup; see Clustering section | 1 |
podDisruptionBudget | Pod disruption budget | {} |
priorityClassName | Pod priority class name | "" |
rootCAs | Register Certificates in the RootCA. These certificates will be use for backends calls. NOTE: You can use file path or cert content directly | [] |
resources | Resource definitions for the generated pods | {} |
cpuRequest | DEPRECATED: use resources instead. Initial share of CPU requested per Traefik pod | None |
memoryRequest | DEPRECATED: use resources instead. Initial share of memory requested per Traefik pod | None |
cpuLimit | DEPRECATED: use resources instead. CPU limit per Traefik pod | None |
memoryLimit | DEPRECATED: use resources instead. Memory limit per Traefik pod | None |
rbac.enabled | Whether to enable RBAC with a specific cluster role and binding for Traefik | false |
deploymentStrategy | Specify deployment spec rollout strategy | {} |
securityContext | Security context | {} |
env | Environment variables for the container | {} |
nodeSelector | Node labels for pod assignment | {} |
affinity | Affinity settings | {} |
tolerations | List of node taints to tolerate | [] |
proxyProtocol.enabled | Enable PROXY protocol support. | false |
proxyProtocol.trustedIPs | List of PROXY IPs (CIDR ranges) trusted to accurately convey the end-user IP. | [] |
forwardedHeaders.enabled | Enable support specify trusted clients for forwarded headers. | false |
forwardedHeaders.trustedIPs | List of IPs (CIDR ranges) to be authorized to trust the client forwarded headers (X-Forwarded-*). | [] |
debug.enabled | Turn on/off Traefik's debug mode. Enabling it will override the logLevel to DEBUG and provide /debug/vars endpoint that allows Go runtime stats to be inspected, such as number of Goroutines and memory stats | false |
ssl.enabled | Whether to enable HTTPS | false |
ssl.enforced | Whether to redirect HTTP requests to HTTPS | false |
ssl.permanentRedirect | When ssl.enforced is set, use a permanent (301) redirect instead of a temporary redirect (302) | false |
ssl.upstream | Whether to skip configuring certs (ie: SSL is terminated by L4 ELB) | false |
ssl.insecureSkipVerify | Whether to verify certs on SSL connections | false |
ssl.tlsMinVersion | Minimum TLS version for https entrypoint | None |
ssl.cipherSuites | Specify a non-empty list of TLS ciphers to override the default one | None |
ssl.sniStrict | Enable strict SNI checking, so that connections cannot be made if a matching certificate does not exist. | false |
ssl.generateTLS | Generate self sign cert by Helm. If it's true the defaultCert and the defaultKey parameters will be ignored. | false |
ssl.defaultCN | Specify generated self sign cert CN | "" |
ssl.defaultSANList | Specify generated self sign cert SAN list | [] |
ssl.defaultIPList | Specify generated self sign cert IP list | [] |
ssl.defaultCert | Base64 encoded default certificate | A self-signed certificate |
ssl.defaultKey | Base64 encoded private key for the certificate above | The private key for the certificate above |
ssl.auth.basic | Basic auth for all SSL endpoints, see Authentication section | unset by default; this means basic auth is disabled |
acme.enabled | Whether to use Let's Encrypt to obtain certificates | false |
Deploy traefik with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has traefik on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the charttraefik is pinned at v1.68.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply