Skip to content

Commit

Permalink
Enable KubernetesIngress for traefikv2
Browse files Browse the repository at this point in the history
This feature enables Traefikv2 to work with Ingress definitions
as well as the new CRDs it enables.

Thanks to @Waterdrips for finding this in the docs.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
alexellis committed Mar 10, 2020

Verified

This commit was signed with the committer’s verified signature.
inkydragon Chengyu Han
1 parent 69bdf2c commit 16a9b6f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/apps/traefik2_app.go
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ func MakeInstallTraefik2() *cobra.Command {
traefik2.Flags().StringArray("set", []string{},
"Use custom flags or override existing flags \n(example --set key=value)")
traefik2.Flags().Bool("wait", false, "Wait for the chart to be installed")
traefik2.Flags().Bool("ingress-provider", true, "Add Traefik's ingressprovider along with the CRD provider")

traefik2.RunE = func(command *cobra.Command, args []string) error {

@@ -81,6 +82,7 @@ func MakeInstallTraefik2() *cobra.Command {
lb, _ := command.Flags().GetBool("load-balancer")
dashboard, _ := command.Flags().GetBool("dashboard")
wait, _ := command.Flags().GetBool("wait")
ingressProvider, _ := command.Flags().GetBool("ingress-provider")

svc := "NodePort"
if lb {
@@ -95,6 +97,10 @@ func MakeInstallTraefik2() *cobra.Command {
overrides["dashboard.ingressRoute"] = "true"
}

if ingressProvider {
overrides["additionalArguments"] = `{--providers.kubernetesingress}`
}

customFlags, err := command.Flags().GetStringArray("set")
if err != nil {
return fmt.Errorf("error with --set usage: %s", err)

0 comments on commit 16a9b6f

Please sign in to comment.