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

WIP Revert "userland-proxy=false is not required anymore" #251

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ _See code: [src/commands/server/delete.ts](https://github.com/che-incubator/chec

## `chectl server:start`

start Eclipse Che Server
start Eclipse Che Server.

Currently `chectl` requires [minikube](https://github.com/kubernetes/minikube#installation) and [minishift](https://github.com/minishift/minishift) launched with _--docker-opt userland-proxy=false_ option.

```
USAGE
Expand Down
26 changes: 25 additions & 1 deletion src/platforms/minikube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ export class MinikubeHelper {
},
task: () => this.startMinikube()
},
{ title: 'Verify userland-proxy is disabled',
task: async (_ctx: any, task: any) => {
const userlandDisabled = await this.isUserLandDisabled()
if (!userlandDisabled) {
command.error(`E_PLATFORM_NOT_COMPLIANT_USERLAND: userland-proxy=false parameter is required on docker daemon but it was not found.
This setting is given when originally starting minikube. (you can then later check by performing command : minikube ssh -- ps auxwwww | grep dockerd
It needs to contain --userland-proxy=false
Command that needs to be added on top of your start command:
$ minikube start <all your existing-options> --docker-opt userland-proxy=false
Note: you may have to recreate the minikube installation.
`)
} else {
task.title = `${task.title}...done.`
}
}
},
// { title: 'Verify minikube memory configuration', skip: () => 'Not implemented yet', task: () => {}},
// { title: 'Verify kubernetes version', skip: () => 'Not implemented yet', task: () => {}},
{ title: 'Verify if minikube ingress addon is enabled',
Expand Down Expand Up @@ -77,7 +93,7 @@ export class MinikubeHelper {
}

async startMinikube() {
await execa('minikube', ['start', '--memory=4096', '--cpus=4', '--disk-size=50g'], { timeout: 180000 })
await execa('minikube', ['start', '--memory=4096', '--cpus=4', '--disk-size=50g', '--docker-opt', 'userland-proxy=false'], { timeout: 180000 })
}

async isIngressAddonEnabled(): Promise<boolean> {
Expand All @@ -94,4 +110,12 @@ export class MinikubeHelper {
return stdout
}

/**
* Check if userland-proxy=false is set in docker daemon options
* if not, return an error
*/
async isUserLandDisabled(): Promise<boolean> {
const {stdout} = await execa('minikube', ['ssh', '--', 'ps', 'auxwww', '|', 'grep dockerd'], { timeout: 10000 })
return stdout.includes('--userland-proxy=false')
}
}
24 changes: 24 additions & 0 deletions src/platforms/minishift.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ export class MinishiftHelper {
}
}
},
{ title: 'Verify userland-proxy is disabled',
task: async (_ctx: any, task: any) => {
const userlandDisabled = await this.isUserLandDisabled()
if (!userlandDisabled) {
command.error(`E_PLATFORM_NOT_COMPLIANT_USERLAND: userland-proxy=false parameter is required on docker daemon but it was not found.
This setting is given when originally starting minishift. (you can then later check by performing command : minishift ssh -- ps auxwwww | grep dockerd
It needs to contain --userland-proxy=false
Command that needs to be added on top of your start command:
$ minishift start <all your existing-options> --docker-opt userland-proxy=false
Note: you may have to recreate the minishift installation.
`)
} else {
task.title = `${task.title}...done.`
}
}
},
// { title: 'Verify minishift memory configuration', skip: () => 'Not implemented yet', task: () => {}},
// { title: 'Verify kubernetes version', skip: () => 'Not implemented yet', task: () => {}},
{ title: 'Retrieving minishift IP and domain for routes URLs',
Expand Down Expand Up @@ -75,4 +91,12 @@ export class MinishiftHelper {
return stdout
}

/**
* Check if userland-proxy=false is set in docker daemon options
* if not, return an error
*/
async isUserLandDisabled(): Promise<boolean> {
const {stdout} = await execa('minishift', ['ssh', '--', 'ps', 'auxwww', '|', 'grep dockerd'], { timeout: 10000 })
return stdout.includes('--userland-proxy=false')
}
}
2 changes: 1 addition & 1 deletion test/e2e/minikube.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jest.setTimeout(600000)
/*
## Before
PROFILE=chectl-e2e-tests
minikube start --memory=8192 -p ${PROFILE}
minikube start --memory=8192 --docker-opt userland-proxy=false -p ${PROFILE}
minikube profile ${PROFILE}

yarn test --coverage=false --testRegex=/test/e2e/minikube.test.ts
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/minishift.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jest.setTimeout(600000)
## Before
PROFILE=chectl-e2e-tests && \
minishift profile set ${PROFILE} && \
minishift start --memory=8GB --cpus=4 --disk-size=50g --vm-driver=xhyve --network-nameserver 8.8.8.8 --profile ${PROFILE}
minishift start --memory=8GB --cpus=4 --disk-size=50g --vm-driver=xhyve --network-nameserver 8.8.8.8 --docker-opt userland-proxy=false --profile ${PROFILE}

yarn test --coverage=false --testRegex=/test/e2e/minishift.test.ts

Expand Down