diff --git a/app/kumactl/cmd/completion/testdata/bash.golden b/app/kumactl/cmd/completion/testdata/bash.golden index 87c934c76de4..17a8dda5cce0 100644 --- a/app/kumactl/cmd/completion/testdata/bash.golden +++ b/app/kumactl/cmd/completion/testdata/bash.golden @@ -1765,6 +1765,8 @@ _kumactl_install_ingress() flags+=("--namespace=") two_word_flags+=("--namespace") local_nonpersistent_flags+=("--namespace=") + flags+=("--use-node-port") + local_nonpersistent_flags+=("--use-node-port") flags+=("--version=") two_word_flags+=("--version") local_nonpersistent_flags+=("--version=") diff --git a/app/kumactl/cmd/completion/testdata/zsh.golden b/app/kumactl/cmd/completion/testdata/zsh.golden index 6209f2ec1ef7..4af99a1655ad 100644 --- a/app/kumactl/cmd/completion/testdata/zsh.golden +++ b/app/kumactl/cmd/completion/testdata/zsh.golden @@ -733,6 +733,7 @@ function _kumactl_install_ingress { '--image-pull-policy[image pull policy for Ingress]:' \ '--kuma-cp-address[the address of Kuma CP]:' \ '--namespace[namespace to install Ingress to]:' \ + '--use-node-port[use NodePort instead of LoadBalancer]' \ '--version[version of Ingress component]:' \ '--config-file[path to the configuration file to use]:' \ '--log-level[log level: one of off|info|debug]:' \ diff --git a/app/kumactl/cmd/install/install_ingress.go b/app/kumactl/cmd/install/install_ingress.go index 7d445421f17f..87491350b54e 100644 --- a/app/kumactl/cmd/install/install_ingress.go +++ b/app/kumactl/cmd/install/install_ingress.go @@ -19,6 +19,7 @@ func newInstallIngressCmd() *cobra.Command { Mesh string DrainTime string KumaCpAddress string + IngressPortType string }{ Namespace: "kuma-system", Image: "kong-docker-kuma-docker.bintray.io/kuma-dp", @@ -27,12 +28,17 @@ func newInstallIngressCmd() *cobra.Command { Mesh: "default", DrainTime: "30s", KumaCpAddress: "http://kuma-control-plane.kuma-system:5681", + IngressPortType: "LoadBalancer", } + useNodePort := false cmd := &cobra.Command{ Use: "ingress", Short: "Install Ingress on Kubernetes", Long: `Install Ingress on Kubernetes in a 'kuma-system' namespace.`, RunE: func(cmd *cobra.Command, _ []string) error { + if useNodePort { + args.IngressPortType = "NodePort" + } templateFiles, err := data.ReadFiles(ingress.Templates) if err != nil { return errors.Wrap(err, "Failed to read template files") @@ -61,5 +67,6 @@ func newInstallIngressCmd() *cobra.Command { cmd.Flags().StringVar(&args.Mesh, "mesh", args.Mesh, "mesh for Ingress") cmd.Flags().StringVar(&args.DrainTime, "drain-time", args.DrainTime, "drain time for Envoy proxy") cmd.Flags().StringVar(&args.KumaCpAddress, "kuma-cp-address", args.KumaCpAddress, "the address of Kuma CP") + cmd.Flags().BoolVar(&useNodePort, "use-node-port", false, "use NodePort instead of LoadBalancer") return cmd } diff --git a/app/kumactl/cmd/install/install_ingress_test.go b/app/kumactl/cmd/install/install_ingress_test.go index cdcb9a2f1701..c3c854b3beec 100644 --- a/app/kumactl/cmd/install/install_ingress_test.go +++ b/app/kumactl/cmd/install/install_ingress_test.go @@ -87,6 +87,7 @@ var _ = Describe("kumactl install ingress", func() { "--kuma-cp-address", "http://kuma.local:5681", "--mesh", "non-default-mesh", "--drain-time", "0s", + "--use-node-port", }, goldenFile: "install-ingress.overrides.golden.yaml", }), diff --git a/app/kumactl/cmd/install/testdata/install-ingress.defaults.golden.yaml b/app/kumactl/cmd/install/testdata/install-ingress.defaults.golden.yaml index 9d4d55ebb9ac..73950d8197a4 100644 --- a/app/kumactl/cmd/install/testdata/install-ingress.defaults.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-ingress.defaults.golden.yaml @@ -11,7 +11,7 @@ metadata: name: kuma-ingress namespace: kuma-system spec: - type: NodePort + type: LoadBalancer ports: - port: 10001 protocol: TCP diff --git a/app/kumactl/data/install/k8s/ingress/app.yaml b/app/kumactl/data/install/k8s/ingress/app.yaml index f2b752953552..680a3e201a24 100644 --- a/app/kumactl/data/install/k8s/ingress/app.yaml +++ b/app/kumactl/data/install/k8s/ingress/app.yaml @@ -11,7 +11,7 @@ metadata: name: kuma-ingress namespace: {{ .Namespace }} spec: - type: NodePort + type: {{ .IngressPortType }} ports: - port: 10001 protocol: TCP diff --git a/app/kumactl/pkg/install/k8s/ingress/templates_vfsdata.go b/app/kumactl/pkg/install/k8s/ingress/templates_vfsdata.go index a0e1e2302758..9f84b3395a57 100644 --- a/app/kumactl/pkg/install/k8s/ingress/templates_vfsdata.go +++ b/app/kumactl/pkg/install/k8s/ingress/templates_vfsdata.go @@ -21,14 +21,14 @@ var Templates = func() http.FileSystem { fs := vfsgen۰FS{ "/": &vfsgen۰DirInfo{ name: "/", - modTime: time.Date(2020, 6, 15, 18, 52, 33, 798341276, time.UTC), + modTime: time.Date(2020, 6, 25, 17, 54, 58, 210061389, time.UTC), }, "/app.yaml": &vfsgen۰CompressedFileInfo{ name: "app.yaml", - modTime: time.Date(2020, 6, 15, 18, 52, 33, 798254030, time.UTC), - uncompressedSize: 2648, + modTime: time.Date(2020, 6, 25, 17, 54, 58, 209906413, time.UTC), + uncompressedSize: 2662, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x55\x4d\x8f\xdb\x36\x10\xbd\xfb\x57\x0c\x82\x1e\x9a\x83\x2c\x29\xed\xa6\x08\x81\x1e\x84\xb5\x8b\x1a\xbb\x96\x05\x5b\xce\x55\xe0\x52\xb3\x32\xb1\xfc\x0a\x49\xb9\x31\x82\xfd\xef\x85\x6c\xd9\x96\x64\x3b\x5d\x20\x68\x0f\xe5\x49\x9c\x19\xbe\x79\xf3\x66\x48\x05\x41\x30\xa2\x86\x7f\x46\xeb\xb8\x56\x04\xb6\xf1\xe8\x85\xab\x92\xc0\x0a\xed\x96\x33\x4c\x18\xd3\xb5\xf2\x23\x89\x9e\x96\xd4\x53\x32\x02\x50\x54\x22\x81\x97\x5a\xd2\x80\xab\xca\xa2\x73\xad\xd1\x19\xca\x90\xc0\xb7\x6f\x30\x4e\x8f\x5b\x78\x7d\x1d\xfd\x53\x92\x1f\x43\x77\x06\x59\x73\xd0\xef\x0c\x12\x48\x75\x89\x99\xb6\x7e\x04\x60\xb4\xf5\xae\xf1\x00\x04\xfb\x0d\x81\x38\x8a\xa2\x78\x6f\x01\x30\x56\x7b\xcd\xb4\x20\x90\xdf\x67\xad\xcd\x53\x5b\xa1\xcf\x7a\xb1\x0e\x05\x32\xaf\xed\x01\x89\x1a\x33\x60\x37\xac\x8e\x1a\xe3\xc2\x53\x89\x13\x34\x42\xef\x24\xfe\xa8\x86\x00\x82\x3e\xa1\x70\xb7\x58\x1c\x55\x70\xde\x52\x8f\xd5\xee\x10\x67\xb5\x10\x5c\x55\x6b\x53\x52\x8f\xa4\x2d\x52\xd2\xaf\xab\xda\x56\x48\x20\x3e\x5b\xd6\x8a\x6e\x29\x17\xf4\x49\x20\x81\xe8\xa2\x6c\x49\x3d\xdb\x3c\x76\x18\x5c\xe3\x00\xe0\x51\x1a\x71\x4a\xd5\x2d\x78\x7f\x42\x29\xed\xa9\xe7\x5a\x9d\x40\x60\x8f\x30\xe6\x3a\x6c\x41\x08\xa0\x6a\x48\x94\x17\x01\x12\xdd\xe6\x20\xcc\x1c\xdd\xe6\xa0\x49\xb3\x44\x8f\xd5\x75\x5e\x00\x47\x7d\xf6\xdf\xbd\xd9\x4e\xaf\xb5\xa2\x59\x4c\x2b\x4f\xb9\x42\xdb\x01\x0f\xda\xce\xf5\x23\x9b\xc5\x25\xad\xda\xc6\xcd\x9a\x4f\x78\x7d\x25\xcd\xa6\x9d\x8b\x33\xdf\x53\x70\x56\x0b\x91\x69\xc1\xd9\xae\x73\xec\x6c\xec\x9f\x40\xb5\x25\x9d\xed\x99\x49\xb6\x98\x14\x69\x32\x9f\xf6\x9c\x00\x5b\x2a\x6a\xfc\xc3\x6a\x49\x06\x0e\x80\x67\x8e\xa2\x5c\xe2\xf3\xa5\xa7\xf5\x65\xd4\x6f\xc8\xa9\x7b\xe3\x26\xcf\x77\x53\xaf\xb2\xe4\xfe\x5f\xce\xbf\xbf\x07\x57\x49\x3c\xac\xe7\x49\x71\xbf\x48\xf3\xe5\xe2\xb1\xc8\x1e\x93\x74\x5a\x24\xd9\xac\x58\x4d\x97\x9f\xa7\xcb\x62\xbd\x7c\xbc\x46\xec\x20\xf8\x43\x2d\xe9\xbd\x49\xca\xb2\x69\x65\x5f\xee\x01\xfe\x24\xc9\x93\x03\xf6\x7c\xba\xfa\xf3\x36\x62\x7f\x32\xbf\x0b\x74\xab\x67\x04\x7e\xfa\xf9\x28\xec\xfb\xf1\xf9\x7b\x2f\xf2\xfb\xb7\x20\x27\x93\xf9\x2c\x2d\xb2\xc5\x32\xbf\x8e\xff\xee\xd3\xa7\x28\x7e\xf7\x16\xa4\xc9\x32\x99\xa5\x45\x3e\xbb\xc5\xb4\x29\x79\x62\x29\x57\x39\x97\xf8\xc6\xba\x97\xeb\xb4\x01\x2c\xf2\xc5\xc3\x34\x2d\xb2\x24\xbf\x21\x67\xb8\xa5\x36\xb4\xb5\x0a\x1d\x32\x8b\xde\x85\x2f\xf5\x13\x5a\x85\x1e\x5d\xf3\x1a\xb4\x77\x98\x1e\xee\x70\xe8\xf5\x0b\xaa\x0e\x10\xb5\x95\x1b\xde\x17\x5b\xab\x81\x25\x08\x84\xae\x02\x81\x5b\x14\xbf\x73\xf5\xac\x3b\xee\xce\xcf\xe3\x1c\x7f\x7a\x11\xb2\x8b\xbf\x49\xb3\x04\xdf\xa2\x42\xe7\x32\xab\x9f\xb0\x7f\x16\xbf\x9e\x9f\x9f\xe3\x62\x5a\x4a\xaa\xca\xcb\x6b\x10\xc0\x5f\x15\xfa\x2b\xe6\xe0\xcb\x22\xb8\x62\xde\x78\x6f\x48\x18\xc6\x1f\x7e\x1b\x47\xe3\x68\x1c\x93\xa6\xc1\xbd\xb8\x67\xca\x45\x6d\x31\xdf\x58\x74\x1b\x2d\x4a\x02\xf1\x87\x5e\x00\x57\xdc\x73\x2a\x26\x28\xe8\x6e\x85\x4c\xab\xd2\x11\xf8\x18\xf5\x62\x0c\x5a\xae\xcb\x93\xf7\xae\xe7\x74\x35\x63\xe8\x5c\x37\x43\xcf\xef\xb9\x44\x5d\xfb\xd3\xe9\x5f\x3a\x5e\x8b\xb4\xe4\xff\x27\xe1\xe2\xff\x4a\x37\xa7\x6b\xcb\x70\x30\xa7\x16\xbf\xd4\xe8\x86\xd3\x0b\xc0\x4c\x4d\xe0\x2e\x92\x03\xb3\x44\xa9\xed\x8e\xc0\xc7\x5f\xe7\xbc\xe7\x12\x5c\xf2\x1b\x28\xcd\xe4\xdf\xc2\xb9\x8b\x3f\xcc\xf9\xdf\x01\x00\x00\xff\xff\x14\x8a\xd4\xa0\x58\x0a\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x55\x4d\x8f\xdb\x36\x10\xbd\xfb\x57\x0c\x82\x1e\x9a\x83\x2c\x29\xed\xa6\x08\x81\x1e\x84\xb5\x8b\x1a\xbb\x96\x05\x5b\xce\x55\xe0\x4a\xb3\x32\xb1\xfc\x0a\x49\xb9\x31\x82\xfd\xef\x05\x6d\xd9\x96\x64\x3b\x5d\x20\x68\x0f\xe5\x49\x9c\x8f\xc7\x37\x6f\x86\x62\x10\x04\x23\xaa\xd9\x67\x34\x96\x29\x49\x60\x1b\x8f\x5e\x98\xac\x08\xac\xd0\x6c\x59\x89\x49\x59\xaa\x46\xba\x91\x40\x47\x2b\xea\x28\x19\x01\x48\x2a\x90\xc0\x4b\x23\x68\xc0\x64\x6d\xd0\xda\xd6\x68\x35\x2d\x91\xc0\xb7\x6f\x30\x4e\x8f\x5b\x78\x7d\x1d\xfd\xd3\x21\x3f\x86\x6e\x35\x96\x3e\xd1\xed\x74\xeb\x9e\x1d\xf2\x32\x65\x5c\xbe\xd3\xfb\x20\x00\xad\x8c\xb3\x3e\x0e\x20\xd8\x6f\x08\xc4\x51\x14\xc5\x7b\x0b\x80\x36\xca\xa9\x52\x71\x02\xf9\x7d\xd6\xda\x1c\x35\x35\xba\xac\x17\x6b\x91\x63\xe9\x94\x39\x20\x51\xad\x07\x5c\x87\xb5\x52\xad\x6d\x78\x2a\x78\x82\x9a\xab\x9d\xc0\x1f\x55\x14\x80\xd3\x27\xe4\xf6\x16\x8b\xa3\x26\xd6\x19\xea\xb0\xde\x1d\xe2\x8c\xe2\x9c\xc9\x7a\xad\x2b\xea\x90\xb4\x45\x0a\xfa\x75\xd5\x98\x1a\x09\xc4\x67\xcb\x5a\xd2\x2d\x65\x9c\x3e\x71\x24\x10\x5d\x94\x2d\xa8\x2b\x37\x8f\x1d\x06\xd7\x38\x00\x38\x14\x9a\x9f\x8e\xea\x16\xbc\xcf\x90\x52\x39\xea\x98\x92\x27\x10\xd8\x23\x8c\x99\x0a\x5b\x10\x02\x28\x3d\x89\xea\x22\x40\xa0\xdd\x1c\x84\x99\xa3\xdd\x1c\x34\xf1\x8b\xf7\x58\x5d\xe7\x05\x70\xd4\x67\xff\xdd\x9b\xf4\xf4\x5a\x2b\xfc\x2a\x95\x74\x94\x49\x34\x1d\xf0\xa0\xed\x5c\x3f\xd2\x2f\x26\x68\x7d\x9c\x46\xff\x09\xaf\xaf\xc4\x6f\xda\xb9\x38\xf3\x3d\x05\x67\x0d\xe7\x99\xe2\xac\xdc\x75\xd2\xce\xc6\x7e\x06\xca\x2d\xe9\x6c\xcf\x4c\xb2\xc5\xa4\x48\x93\xf9\xb4\xe7\x04\xd8\x52\xde\xe0\x1f\x46\x09\x32\x70\x00\x3c\x33\xe4\xd5\x12\x9f\x2f\x3d\xad\x2f\xa3\x6e\x43\x4e\xdd\x1b\xfb\x73\xbe\x7b\xf4\x2a\x4b\xee\xff\xe5\xf3\xf7\xf7\xe0\x2a\x89\x87\xf5\x3c\x29\xee\x17\x69\xbe\x5c\x3c\x16\xd9\x63\x92\x4e\x8b\x24\x9b\x15\xab\xe9\xf2\xf3\x74\x59\xac\x97\x8f\xd7\x88\x1d\x04\x7f\x68\x04\xbd\xd7\x49\x55\xf9\x56\xf6\xe5\x1e\xe0\x4f\x92\x3c\x39\x60\xcf\xa7\xab\x3f\x6f\x23\xf6\x27\xf3\xbb\x40\xb7\x7a\x46\xe0\xa7\x9f\x8f\xc2\xbe\x1f\x9f\xbf\xf7\x22\xbf\x7f\x0b\x72\x32\x99\xcf\xd2\x22\x5b\x2c\xf3\xeb\xf8\xef\x3e\x7d\x8a\xe2\x77\x6f\x41\x9a\x2c\x93\x59\x5a\xe4\xb3\x5b\x4c\x7d\xc9\x13\x43\x99\xcc\x99\xc0\x37\xd6\xbd\x5c\xa7\x1e\xb0\xc8\x17\x0f\xd3\xb4\xc8\x92\xfc\x86\x9c\xe1\x96\x9a\xd0\x34\x32\xb4\x58\x1a\x74\x36\x7c\x69\x9e\xd0\x48\x74\x68\xfd\xdf\xa0\xbd\xc3\xf4\x70\x87\x43\xa7\x5e\x50\x76\x80\xa8\xa9\xed\xf0\xbe\x98\x46\x0e\x2c\x41\xc0\x55\x1d\x70\xdc\x22\xff\x9d\xc9\x67\xd5\x71\x77\x1e\x8f\x73\xfc\xe9\x8f\x90\x5d\xbc\x26\x7e\x71\xb6\x45\xe9\x9f\x21\xa3\x9e\xb0\x9f\x8b\x5f\xcf\xbf\x9f\xe3\x2a\x95\x10\x54\x56\x97\xd7\x20\x80\xbf\x6a\x74\x57\xcc\xc1\x97\x45\x70\xc5\xbc\x71\x4e\x93\x30\x8c\x3f\xfc\x36\x8e\xc6\xd1\x38\x26\xbe\xc1\xbd\xb8\x67\xca\x78\x63\x30\xdf\x18\xb4\x1b\xc5\x2b\x02\xf1\x87\x5e\x00\x93\xcc\x31\xca\x27\xc8\xe9\x6e\x85\xa5\x92\x95\x25\xf0\x31\xea\xc5\x68\x34\x4c\x55\x27\xef\x5d\xcf\x69\x9b\xb2\x44\x6b\xbb\x27\xf4\xfc\x8e\x09\x54\x8d\x3b\x65\xff\xd2\xf1\x1a\xa4\x15\xfb\x3f\x09\x17\xff\x57\xba\x59\xd5\x98\x12\x07\x73\x6a\xf0\x4b\x83\x76\x38\xbd\x00\xa5\x6e\x08\xdc\x45\x62\x60\x16\x28\x94\xd9\x11\xf8\xf8\xeb\x9c\xf5\x5c\x9c\x09\x76\x03\xc5\x4f\xfe\x2d\x9c\xbb\xf8\xc3\x9c\xfd\x1d\x00\x00\xff\xff\x69\xba\xba\x71\x66\x0a\x00\x00"), }, } fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ diff --git a/test/framework/kumactl.go b/test/framework/kumactl.go index 1dee5dad3522..c56f60899dd1 100644 --- a/test/framework/kumactl.go +++ b/test/framework/kumactl.go @@ -150,6 +150,7 @@ func (o *KumactlOptions) KumactlInstallIngress() (string, error) { args := []string{ "install", "ingress", "--image", kumaDPImage, + "--use-node-port", } return o.RunKumactlAndGetOutput(args...) }