Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on ingress addon on linux baremetal #9577

Merged
merged 13 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions pkg/addons/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,14 @@ func enableOrDisableAddon(cc *config.ClusterConfig, name string, val string) err
}

// to match both ingress and ingress-dns addons
if strings.HasPrefix(name, "ingress") && enable {
if driver.IsKIC(cc.Driver) && runtime.GOOS != "linux" {
exit.Message(reason.Usage, `Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.
if strings.HasPrefix(name, "ingress") && enable && driver.IsKIC(cc.Driver) && runtime.GOOS != "linux" {
exit.Message(reason.Usage, `Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.
Alternatively to use this addon you can use a vm-based driver:

'minikube start --vm=true'

To track the update on this work in progress feature please check:
https://github.com/kubernetes/minikube/issues/7332`, out.V{"driver_name": cc.Driver, "os_name": runtime.GOOS, "addon_name": name})
} else if driver.BareMetal(cc.Driver) {
exit.Message(reason.Usage, `Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not supported. Try using a different driver.`,
out.V{"driver_name": cc.Driver, "addon_name": name})
}
}

if strings.HasPrefix(name, "istio") && enable {
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/bootstrapper/bsutil/kverify/default_sa.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func WaitForDefaultSA(cs *kubernetes.Clientset, timeout time.Duration) error {
// equivalent to manual check of 'kubectl --context profile get serviceaccount default'
sas, err := cs.CoreV1().ServiceAccounts("default").List(meta.ListOptions{})
if err != nil {
klog.Infof("temproary error waiting for default SA: %v", err)
klog.Infof("temporary error waiting for default SA: %v", err)
return false, nil
}
for _, sa := range sas.Items {
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func postStartSetup(h *host.Host, mc config.ClusterConfig) error {
// acquireMachinesLock protects against code that is not parallel-safe (libmachine, cert setup)
func acquireMachinesLock(name string, drv string) (mutex.Releaser, error) {
lockPath := filepath.Join(localpath.MiniPath(), "machines", drv)
// "With KIC, it's safe to provision multiple hosts simultaneously"
// With KIC, it's safe to provision multiple hosts simultaneously
if driver.IsKIC(drv) {
lockPath = filepath.Join(localpath.MiniPath(), "machines", drv, name)
}
Expand Down
23 changes: 16 additions & 7 deletions test/integration/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestAddons(t *testing.T) {
}

args := append([]string{"start", "-p", profile, "--wait=false", "--memory=2600", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=helm-tiller", "--addons=olm", "--addons=volumesnapshots", "--addons=csi-hostpath-driver", "--addons=gcp-auth"}, StartArgs()...)
if !NoneDriver() && !(runtime.GOOS == "darwin" && KicDriver()) { // none doesn't support ingress
if !(runtime.GOOS == "darwin" && KicDriver()) { // docker driver on macos doesn't support ingress
args = append(args, "--addons=ingress")
}
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
Expand Down Expand Up @@ -111,8 +111,8 @@ func TestAddons(t *testing.T) {
func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
defer PostMortemLogs(t, profile)

if NoneDriver() || (runtime.GOOS == "darwin" && KicDriver()) {
t.Skipf("skipping: ssh unsupported by none")
if runtime.GOOS == "darwin" && KicDriver() {
t.Skipf("skipping: ingress not supported on macOS docker driver")
}

client, err := kapi.Client(profile)
Expand All @@ -133,7 +133,7 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
return err
}
if rr.Stderr.String() != "" {
t.Logf("%v: unexpected stderr: %s (may be temproary)", rr.Command(), rr.Stderr)
t.Logf("%v: unexpected stderr: %s (may be temporary)", rr.Command(), rr.Stderr)
}
return nil
}
Expand All @@ -157,9 +157,18 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
want := "Welcome to nginx!"
addr := "http://127.0.0.1/"
checkIngress := func() error {
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("curl -s %s -H 'Host: nginx.example.com'", addr)))
if err != nil {
return err
var rr *RunResult
var err error
if NoneDriver() { // just run curl directly on the none driver
rr, err = Run(t, exec.CommandContext(ctx, "curl", "-s", addr, "-H", "'Host: nginx.example.com'"))
if err != nil {
return err
}
} else {
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("curl -s %s -H 'Host: nginx.example.com'", addr)))
if err != nil {
return err
}
}

stderr := rr.Stderr.String()
Expand Down