From d9ce9918fca9b66ed53a6142c2ce591b8b19a251 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Sun, 17 Nov 2019 22:54:24 -0300 Subject: [PATCH] Add support for arm and arm64 in ingress-nginx app Signed-off-by: Manuel Alejandro de Brito Fontes --- README.md | 2 +- pkg/cmd/nginx_app.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c686444..e695faa5 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ k3sup app install inlets-operator # ARM will be available in 0.12.0 k3sup app install cert-manager -# nginx - install the Nginx IngressController, PC only +# nginx - install the Nginx IngressController k3sup app install nginx-ingress ``` diff --git a/pkg/cmd/nginx_app.go b/pkg/cmd/nginx_app.go index 4e9c5d49..bf2864d8 100644 --- a/pkg/cmd/nginx_app.go +++ b/pkg/cmd/nginx_app.go @@ -75,6 +75,18 @@ func makeInstallNginx() *cobra.Command { overrides["defaultBackend.enabled"] = "false" + arch := getArchitecture() + fmt.Printf("Node architecture: %q\n", arch) + + switch arch { + case "amd64": + // use default image + case "arm", "arm64": + overrides["controller.image.repository"] = fmt.Sprintf("quay.io/kubernetes-ingress-controller/nginx-ingress-controller-%v", arch) + default: + return fmt.Errorf("architecture %v is not supported by ingress-nginx", arch) + } + hostMode, flagErr := command.Flags().GetBool("host-mode") if flagErr != nil { return flagErr