Merge branch 'master' into gh_9463_non_dev_dockerhost

pull/9510/head
Ilya Zuyev 2020-11-09 14:11:20 -08:00
commit 0f2c63881a
132 changed files with 3070 additions and 974 deletions

View File

@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Download Dependencies
run: go mod download
@ -71,7 +71,7 @@ jobs:
make checksum
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install kubectl
shell: bash
@ -103,7 +103,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -115,8 +115,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Upload report
uses: actions/upload-artifact@v1
with:

View File

@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Download Dependencies
run: go mod download
@ -83,7 +83,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -95,8 +95,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail' || true)
TestsNum=$(echo $STAT | jq '.NumberOfTests' || true)
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: kic_image_functional_test_docker_ubuntu

View File

@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Download Dependencies
run: go mod download
@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install libvirt
run: |
@ -67,7 +67,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install libvirt
run: |
@ -114,7 +114,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -145,7 +145,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -157,8 +157,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: functional_docker_ubuntu
@ -197,7 +199,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -241,7 +243,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -253,8 +255,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: functional_virtualbox_macos
@ -340,7 +344,7 @@ jobs:
echo "------------------------"
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install tools
continue-on-error: true
@ -373,7 +377,7 @@ jobs:
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
echo "TIME_ELAPSED=$T_ELAPSED" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Generate HTML Report
continue-on-error: true
shell: powershell
@ -385,8 +389,8 @@ jobs:
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "STAT=${STAT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
@ -476,7 +480,7 @@ jobs:
Get-WmiObject -class Win32_ComputerSystem
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install tools
continue-on-error: true
@ -510,7 +514,7 @@ jobs:
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
echo "TIME_ELAPSED=$T_ELAPSED" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Generate HTML Report
continue-on-error: true
shell: powershell
@ -522,8 +526,8 @@ jobs:
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "STAT=${STAT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
@ -582,7 +586,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -611,7 +615,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -623,8 +627,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: none_ubuntu18_04
@ -677,7 +683,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -700,13 +706,13 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=10m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=20m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -718,8 +724,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: addons_certs_docker_ubuntu
@ -757,7 +765,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -802,7 +810,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -814,8 +822,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: addons_certs_virtualbox_macos
@ -867,7 +877,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -898,7 +908,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -910,8 +920,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: multinode_docker_ubuntu
@ -949,7 +961,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -988,7 +1000,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -1000,8 +1012,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: multinode_virtualbox_macos
@ -1021,11 +1035,12 @@ jobs:
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 7 ];then echo "*** Failed to pass at least 7 ! ***";exit 2;fi
pause_preload_dockerflags_docker_ubuntu:
preload_dockerflags_docker_ubuntu:
# TestPause was removed due to https://github.com/kubernetes/minikube/issues/9568
runs-on: ubuntu-18.04
env:
TIME_ELAPSED: time
JOB_NAME: "pause_preload_dockerflags_docker_ubuntu"
JOB_NAME: "preload_dockerflags_docker_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
needs: [build_minikube]
@ -1053,7 +1068,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -1076,13 +1091,13 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestPreload|TestDockerFlags)" -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -1094,13 +1109,15 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: pause_preload_dockerflags_docker_ubuntu
name: preload_dockerflags_docker_ubuntu
path: minikube_binaries/report
- name: The End Result - pause_preload_dockerflags_docker_ubuntu
- name: The End Result - preload_dockerflags_docker_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
@ -1114,7 +1131,7 @@ jobs:
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 9 ];then echo "*** Failed to pass at least 9 ! ***";exit 2;fi
if [ "$numPass" -lt 2 ];then echo "*** Failed to pass at least 2 ! ***";exit 2;fi
pause_preload_dockerflags_virtualbox_macos:
runs-on: macos-10.15
env:
@ -1133,7 +1150,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -1172,7 +1189,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -1184,8 +1201,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: pause_preload_dockerflags_virtualbox_macos
@ -1220,7 +1239,7 @@ jobs:
addons_certs_virtualbox_macos,
multinode_docker_ubuntu,
multinode_virtualbox_macos,
pause_preload_dockerflags_docker_ubuntu,
preload_dockerflags_docker_ubuntu,
pause_preload_dockerflags_virtualbox_macos,
]
runs-on: ubuntu-18.04
@ -1242,9 +1261,9 @@ jobs:
cp -r ./addons_certs_virtualbox_macos ./all_reports/
cp -r ./multinode_docker_ubuntu ./all_reports/
cp -r ./multinode_virtualbox_macos ./all_reports/
cp -r ./pause_preload_dockerflags_docker_ubuntu ./all_reports/
cp -r ./preload_dockerflags_docker_ubuntu ./all_reports/
cp -r ./pause_preload_dockerflags_virtualbox_macos ./all_reports/
- uses: actions/upload-artifact@v1
with:
name: all_reports
path: all_reports
path: all_reports

View File

@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Download Dependencies
run: go mod download
@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install libvirt
run: |
@ -65,7 +65,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install libvirt
run: |
@ -112,7 +112,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -143,7 +143,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -155,8 +155,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: functional_docker_ubuntu
@ -195,7 +197,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -239,7 +241,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -251,8 +253,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: functional_virtualbox_macos
@ -338,7 +342,7 @@ jobs:
echo "------------------------"
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install tools
continue-on-error: true
@ -371,7 +375,7 @@ jobs:
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
echo "TIME_ELAPSED=$T_ELAPSED" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Generate HTML Report
continue-on-error: true
shell: powershell
@ -383,8 +387,8 @@ jobs:
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "STAT=${STAT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
@ -474,7 +478,7 @@ jobs:
Get-WmiObject -class Win32_ComputerSystem
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install tools
continue-on-error: true
@ -508,7 +512,7 @@ jobs:
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
echo "TIME_ELAPSED=$T_ELAPSED" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Generate HTML Report
continue-on-error: true
shell: powershell
@ -520,8 +524,8 @@ jobs:
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "STAT=${STAT}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
@ -580,7 +584,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -609,7 +613,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -621,8 +625,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: none_ubuntu18_04
@ -675,7 +681,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -698,13 +704,13 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=10m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=20m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -716,8 +722,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: addons_certs_docker_ubuntu
@ -755,7 +763,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -800,7 +808,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -812,8 +820,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: addons_certs_virtualbox_macos
@ -865,7 +875,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -896,7 +906,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -908,8 +918,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: multinode_docker_ubuntu
@ -947,7 +959,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -986,7 +998,7 @@ jobs:
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -998,8 +1010,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: multinode_virtualbox_macos
@ -1019,11 +1033,12 @@ jobs:
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 7 ];then echo "*** Failed to pass at least 7 ! ***";exit 2;fi
pause_preload_dockerflags_docker_ubuntu:
preload_dockerflags_docker_ubuntu:
# TestPause was removed due to https://github.com/kubernetes/minikube/issues/9568
runs-on: ubuntu-18.04
env:
TIME_ELAPSED: time
JOB_NAME: "pause_preload_dockerflags_docker_ubuntu"
JOB_NAME: "preload_dockerflags_docker_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
needs: [build_minikube]
@ -1051,7 +1066,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -1074,13 +1089,13 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestDockerFlags|TestPreload)" -test.timeout=10m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -1092,13 +1107,15 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: pause_preload_dockerflags_docker_ubuntu
name: preload_dockerflags_docker_ubuntu
path: minikube_binaries/report
- name: The End Result - pause_preload_dockerflags_docker_ubuntu
- name: The End Result - preload_dockerflags_docker_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
@ -1112,7 +1129,7 @@ jobs:
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 9 ];then echo "*** Failed to pass at least 9 ! ***";exit 2;fi
if [ "$numPass" -lt 2 ];then echo "*** Failed to pass at least 2 ! ***";exit 2;fi
pause_preload_dockerflags_virtualbox_macos:
runs-on: macos-10.15
env:
@ -1131,7 +1148,7 @@ jobs:
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
- uses: actions/setup-go@v2
with:
go-version: '1.14.6'
go-version: '1.15.2'
stable: true
- name: Install gopogh
@ -1164,13 +1181,13 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=20m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
@ -1182,8 +1199,10 @@ jobs:
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}
echo ::set-env name=STAT::${STAT}
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: pause_preload_dockerflags_virtualbox_macos
@ -1218,7 +1237,7 @@ jobs:
addons_certs_virtualbox_macos,
multinode_docker_ubuntu,
multinode_virtualbox_macos,
pause_preload_dockerflags_docker_ubuntu,
preload_dockerflags_docker_ubuntu,
pause_preload_dockerflags_virtualbox_macos,
]
runs-on: ubuntu-18.04
@ -1240,9 +1259,9 @@ jobs:
cp -r ./addons_certs_virtualbox_macos ./all_reports/
cp -r ./multinode_docker_ubuntu ./all_reports/
cp -r ./multinode_virtualbox_macos ./all_reports/
cp -r ./pause_preload_dockerflags_docker_ubuntu ./all_reports/
cp -r ./preload_dockerflags_docker_ubuntu ./all_reports/
cp -r ./pause_preload_dockerflags_virtualbox_macos ./all_reports/
- uses: actions/upload-artifact@v1
with:
name: all_reports
path: all_reports
path: all_reports

View File

@ -3,7 +3,7 @@
os: linux
language: go
go:
- 1.14.6
- 1.15.2
env:
global:
- GOPROXY=https://proxy.golang.org
@ -11,7 +11,7 @@ matrix:
include:
- language: go
name: Code Lint
go: 1.14.6
go: 1.15.2
env:
- TESTSUITE=lintall
before_install:
@ -20,7 +20,7 @@ matrix:
- language: go
name: Unit Test
go: 1.14.6
go: 1.15.2
env:
- TESTSUITE=unittest
before_install:
@ -29,7 +29,7 @@ matrix:
- language: go
name: Build
go: 1.14.6
go: 1.15.2
script: make
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@ -1,5 +1,60 @@
# Release Notes
## Version 1.14.2 - 2020-10-27
Bug Fixes:
* fix "profile list" timing out when cluster stopped. [#9557](https://github.com/kubernetes/minikube/pull/9557)
Thank you to our contributors for this release!
- Medya Ghazizadeh
- Sharif Elgamal
- Thomas Strömberg
## Version 1.14.1 - 2020-10-23
Features:
* new --wait flag component "kubelet" [#9459](https://github.com/kubernetes/minikube/pull/9459)
Bug Fixes:
* docker: When creating networks, use MTU of built-in bridge network [#9530](https://github.com/kubernetes/minikube/pull/9530)
* multinode: ensure worker node join control plane on restart [#9476](https://github.com/kubernetes/minikube/pull/9476)
* Fix "--native-ssh" flag for "minikube ssh" [#9417](https://github.com/kubernetes/minikube/pull/9417)
* Fix parallels driver initialization [#9494](https://github.com/kubernetes/minikube/pull/9494)
Minor Improvements:
* Omit error message if 100-crio-bridge.conf has already been disabled [#9505](https://github.com/kubernetes/minikube/pull/9505)
* avoid re-downloading hyperkit driver [#9365](https://github.com/kubernetes/minikube/pull/9365)
* improve gcp-auth addon failure policy [#9408](https://github.com/kubernetes/minikube/pull/9408)
* Added deprecation warning for --network-plugin=cni [#9368](https://github.com/kubernetes/minikube/pull/9368)
* Update warning message for local proxy. [#9490](https://github.com/kubernetes/minikube/pull/9490)
* bump helm-tiller addon to v2.16.12 [#9444](https://github.com/kubernetes/minikube/pull/9444)
* bump version for ingress dns addon [#9435](https://github.com/kubernetes/minikube/pull/9435)
Thank you to our contributors for this release!
- Anders F Björklund
- Dale Hamel
- GRXself
- Ilya Zuyev
- Josh Woodcock
- Joshua Mühlfort
- Kenta Iso
- Medya Ghazizadeh
- Mikhail Zholobov
- Nick Kubala
- Pablo Caderno
- Predrag Rogic
- Priya Modali
- Priya Wadhwa
- Sharif Elgamal
- Thomas Strömberg
- heyf
## Version 1.14.0 - 2020-10-08
## Features

View File

@ -15,7 +15,7 @@
# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 14
VERSION_BUILD ?= 0
VERSION_BUILD ?= 2
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
VERSION ?= v$(RAW_VERSION)
@ -29,10 +29,10 @@ DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
RPM_VERSION ?= $(DEB_VERSION)
# used by hack/jenkins/release_build_and_upload.sh and KVM_BUILD_IMAGE, see also BUILD_IMAGE below
GO_VERSION ?= 1.14.6
GO_VERSION ?= 1.15.2
INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2020.02.6
BUILDROOT_BRANCH ?= 2020.02.7
REGISTRY?=gcr.io/k8s-minikube
REGISTRY_GH?=docker.pkg.github.com/kubernetes/minikube
@ -58,7 +58,7 @@ MINIKUBE_BUCKET ?= minikube/releases
MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
KERNEL_VERSION ?= 4.19.114
KERNEL_VERSION ?= 4.19.150
# latest from https://github.com/golangci/golangci-lint/releases
GOLINT_VERSION ?= v1.30.0
# Limit number of default jobs, to avoid the CI builds running out of memory
@ -114,8 +114,7 @@ MARKDOWNLINT ?= markdownlint
MINIKUBE_MARKDOWN_FILES := README.md CONTRIBUTING.md CHANGELOG.md
MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
MINIKUBE_BUILD_TAGS += go_getter_nos3 go_getter_nogcs
MINIKUBE_BUILD_TAGS := go_getter_nos3 go_getter_nogcs
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS)
CMD_SOURCE_DIRS = cmd pkg
@ -582,13 +581,12 @@ storage-provisioner-image-%: out/storage-provisioner-%
docker build -t $(REGISTRY)/storage-provisioner-$*:$(STORAGE_PROVISIONER_TAG) -f deploy/storage-provisioner/Dockerfile --build-arg arch=$* .
.PHONY: kic-base-image
kic-base-image: ## builds the base image used for kic.
docker rmi -f $(KIC_BASE_IMAGE_GCR)-snapshot || true
docker build -f ./deploy/kicbase/Dockerfile -t local/kicbase:$(KIC_VERSION)-snapshot --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) --cache-from $(KIC_BASE_IMAGE_GCR) ./deploy/kicbase
docker tag local/kicbase:$(KIC_VERSION)-snapshot $(KIC_BASE_IMAGE_GCR)-snapshot
docker tag local/kicbase:$(KIC_VERSION)-snapshot $(KIC_BASE_IMAGE_GCR)
docker tag local/kicbase:$(KIC_VERSION)-snapshot $(KIC_BASE_IMAGE_HUB)
docker tag local/kicbase:$(KIC_VERSION)-snapshot $(KIC_BASE_IMAGE_GH)
kic-base-image: ## builds the kic base image and tags local/kicbase:latest and local/kicbase:$(KIC_VERSION)-$(COMMIT_SHORT)
docker rmi -f local/kicbase:latest || true
docker rmi -f local/kicbase:$(KIC_VERSION) || true
docker build -f ./deploy/kicbase/Dockerfile -t local/kicbase:$(KIC_VERSION) --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) --cache-from $(KIC_BASE_IMAGE_GCR) ./deploy/kicbase
docker tag local/kicbase:$(KIC_VERSION) local/kicbase:latest
docker tag local/kicbase:$(KIC_VERSION) local/kicbase:$(KIC_VERSION)-$(COMMIT_SHORT)
.PHONY: upload-preloaded-images-tar
upload-preloaded-images-tar: out/minikube # Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
@ -613,7 +611,7 @@ push-storage-provisioner-manifest: $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~st
docker manifest push $(STORAGE_PROVISIONER_MANIFEST)
.PHONY: push-docker
push-docker: # Push docker image base on to IMAGE variable
push-docker: # Push docker image base on to IMAGE variable (used internally by other targets)
@docker pull $(IMAGE) && echo "Image already exist in registry" && exit 1 || echo "Image doesn't exist in registry"
ifndef AUTOPUSH
$(call user_confirm, 'Are you sure you want to push $(IMAGE) ?')
@ -623,25 +621,28 @@ endif
.PHONY: push-kic-base-image-gcr
push-kic-base-image-gcr: kic-base-image ## Push kic-base to gcr
docker login gcr.io/k8s-minikube
docker tag local/kicbase:latest $(KIC_BASE_IMAGE_GCR)
$(MAKE) push-docker IMAGE=$(KIC_BASE_IMAGE_GCR)
.PHONY: push-kic-base-image-gh
push-kic-base-image-gh: kic-base-image ## Push kic-base to github
docker login docker.pkg.github.com
docker tag local/kicbase:latest $(KIC_BASE_IMAGE_GH)
$(MAKE) push-docker IMAGE=$(KIC_BASE_IMAGE_GH)
.PHONY: push-kic-base-image-hub
push-kic-base-image-hub: kic-base-image ## Push kic-base to docker hub
docker login
docker tag local/kicbase:latest $(KIC_BASE_IMAGE_HUB)
$(MAKE) push-docker IMAGE=$(KIC_BASE_IMAGE_HUB)
.PHONY: push-kic-base-image
push-kic-base-image: ## Push kic-base to all registries
push-kic-base-image: ## Push local/kicbase:latest to all remote registries
ifndef AUTOPUSH
$(call user_confirm, 'Are you sure you want to push: $(KIC_BASE_IMAGE_GH) & $(KIC_BASE_IMAGE_GCR) & $(KIC_BASE_IMAGE_HUB) ?')
$(MAKE) push-kic-base-image AUTOPUSH=true
else
$(MAKE) push-kic-base-image-gh push-kic-base-image-gcr push-kic-base-image-hub
$(MAKE) push-kic-base-image-gcr push-kic-base-image-hub push-kic-base-image-gh
endif
.PHONY: out/gvisor-addon

1
OWNERS
View File

@ -10,6 +10,7 @@ reviewers:
- blueelvis
- priyawadhwa
- prasadkatti
- ilya-zuyev
approvers:
- tstromberg
- afbjorklund

View File

@ -33,6 +33,7 @@ import (
"k8s.io/minikube/pkg/minikube/style"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/state"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
@ -97,6 +98,16 @@ func profileStatus(p *config.Profile, api libmachine.API) string {
return "Unknown"
}
// The machine isn't running, no need to check inside
s, err := host.Driver.GetState()
if err != nil {
klog.Warningf("error getting host state: %v", err)
return "Unknown"
}
if s != state.Running {
return s.String()
}
cr, err := machine.CommandRunner(host)
if err != nil {
klog.Warningf("error loading profiles: %v", err)

View File

@ -23,10 +23,12 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/spf13/pflag"
"k8s.io/minikube/pkg/generate"
)
func TestGenerateDocs(t *testing.T) {
pflag.BoolP("help", "h", false, "") // avoid 'Docs are not updated. Please run `make generate-docs` to update commands documentation' error
dir := "../../../site/content/en/docs/commands/"
for _, sc := range RootCmd.Commands() {

View File

@ -50,6 +50,7 @@ var pauseCmd = &cobra.Command{
}
func runPause(cmd *cobra.Command, args []string) {
out.SetJSON(outputFormat == "json")
co := mustload.Running(ClusterFlagValue())
register.SetEventLogPath(localpath.EventLog(ClusterFlagValue()))
register.Reg.SetStep(register.Pausing)
@ -105,4 +106,5 @@ func runPause(cmd *cobra.Command, args []string) {
func init() {
pauseCmd.Flags().StringSliceVarP(&namespaces, "--namespaces", "n", constants.DefaultNamespaces, "namespaces to pause")
pauseCmd.Flags().BoolVarP(&allNamespaces, "all-namespaces", "A", false, "If set, pause all namespaces")
pauseCmd.Flags().StringVarP(&outputFormat, "output", "o", "text", "Format to print stdout in. Options include: [text,json]")
}

View File

@ -39,12 +39,16 @@ import (
"k8s.io/minikube/pkg/minikube/shell"
)
var podmanEnvTmpl = fmt.Sprintf("{{ .Prefix }}%s{{ .Delimiter }}{{ .VarlinkBridge }}{{ .Suffix }}{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubePodmanProfile }}{{ .Suffix }}{{ .UsageHint }}", constants.PodmanVarlinkBridgeEnv, constants.MinikubeActivePodmanEnv)
var podmanEnv1Tmpl = fmt.Sprintf("{{ .Prefix }}%s{{ .Delimiter }}{{ .VarlinkBridge }}{{ .Suffix }}{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubePodmanProfile }}{{ .Suffix }}{{ .UsageHint }}", constants.PodmanVarlinkBridgeEnv, constants.MinikubeActivePodmanEnv)
var podmanEnv2Tmpl = fmt.Sprintf("{{ .Prefix }}%s{{ .Delimiter }}{{ .ContainerHost }}{{ .Suffix }}{{ if .ContainerSSHKey }}{{ .Prefix }}%s{{ .Delimiter }}{{ .ContainerSSHKey}}{{ .Suffix }}{{ end }}{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubePodmanProfile }}{{ .Suffix }}{{ .UsageHint }}", constants.PodmanContainerHostEnv, constants.PodmanContainerSSHKeyEnv, constants.MinikubeActivePodmanEnv)
// PodmanShellConfig represents the shell config for Podman
type PodmanShellConfig struct {
shell.Config
VarlinkBridge string
ContainerHost string
ContainerSSHKey string
MinikubePodmanProfile string
}
@ -59,17 +63,24 @@ func podmanShellCfgSet(ec PodmanEnvConfig, envMap map[string]string) *PodmanShel
Config: *shell.CfgSet(ec.EnvConfig, usgPlz, usgCmd),
}
s.VarlinkBridge = envMap[constants.PodmanVarlinkBridgeEnv]
s.ContainerHost = envMap[constants.PodmanContainerHostEnv]
s.ContainerSSHKey = envMap[constants.PodmanContainerSSHKeyEnv]
s.MinikubePodmanProfile = envMap[constants.MinikubeActivePodmanEnv]
return s
}
// isPodmanAvailable checks if Podman is available
func isPodmanAvailable(r command.Runner) bool {
// isVarlinkAvailable checks if varlink command is available
func isVarlinkAvailable(r command.Runner) bool {
if _, err := r.RunCmd(exec.Command("which", "varlink")); err != nil {
return false
}
return true
}
// isPodmanAvailable checks if podman command is available
func isPodmanAvailable(r command.Runner) bool {
if _, err := r.RunCmd(exec.Command("which", "podman")); err != nil {
return false
}
@ -130,11 +141,25 @@ var podmanEnvCmd = &cobra.Command{
exit.Message(reason.Usage, `The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/`)
}
if ok := isPodmanAvailable(co.CP.Runner); !ok {
r := co.CP.Runner
if ok := isPodmanAvailable(r); !ok {
exit.Message(reason.EnvPodmanUnavailable, `The podman service within '{{.cluster}}' is not active`, out.V{"cluster": cname})
}
client, err := createExternalSSHClient(co.CP.Host.Driver)
varlink := isVarlinkAvailable(r)
d := co.CP.Host.Driver
client, err := createExternalSSHClient(d)
if err != nil {
exit.Error(reason.IfSSHClient, "Error getting ssh client", err)
}
hostname, err := d.GetSSHHostname()
if err != nil {
exit.Error(reason.IfSSHClient, "Error getting ssh client", err)
}
port, err := d.GetSSHPort()
if err != nil {
exit.Error(reason.IfSSHClient, "Error getting ssh client", err)
}
@ -143,7 +168,12 @@ var podmanEnvCmd = &cobra.Command{
EnvConfig: sh,
profile: cname,
driver: driverName,
varlink: varlink,
client: client,
username: d.GetSSHUsername(),
hostname: hostname,
port: port,
keypath: d.GetSSHKeyPath(),
}
if ec.Shell == "" {
@ -162,23 +192,31 @@ var podmanEnvCmd = &cobra.Command{
// PodmanEnvConfig encapsulates all external inputs into shell generation for Podman
type PodmanEnvConfig struct {
shell.EnvConfig
profile string
driver string
client *ssh.ExternalClient
profile string
driver string
varlink bool
client *ssh.ExternalClient
username string
hostname string
port int
keypath string
}
// podmanSetScript writes out a shell-compatible 'podman-env' script
func podmanSetScript(ec PodmanEnvConfig, w io.Writer) error {
var podmanEnvTmpl string
if ec.varlink {
podmanEnvTmpl = podmanEnv1Tmpl
} else {
podmanEnvTmpl = podmanEnv2Tmpl
}
envVars := podmanEnvVars(ec)
return shell.SetScript(ec.EnvConfig, w, podmanEnvTmpl, podmanShellCfgSet(ec, envVars))
}
// podmanUnsetScript writes out a shell-compatible 'podman-env unset' script
func podmanUnsetScript(ec PodmanEnvConfig, w io.Writer) error {
vars := []string{
constants.PodmanVarlinkBridgeEnv,
constants.MinikubeActivePodmanEnv,
}
vars := podmanEnvNames(ec)
return shell.UnsetScript(ec.EnvConfig, w, vars)
}
@ -190,15 +228,73 @@ func podmanBridge(client *ssh.ExternalClient) string {
return strings.Join(command, " ")
}
// podmanURL returns the url to use in a var for accessing the podman socket over ssh
func podmanURL(username string, hostname string, port int) string {
path := "/run/podman/podman.sock"
return fmt.Sprintf("ssh://%s@%s:%d%s", username, hostname, port, path)
}
// podmanEnvVars gets the necessary podman env variables to allow the use of minikube's podman service
func podmanEnvVars(ec PodmanEnvConfig) map[string]string {
env := map[string]string{
constants.PodmanVarlinkBridgeEnv: podmanBridge(ec.client),
// podman v1
env1 := map[string]string{
constants.PodmanVarlinkBridgeEnv: podmanBridge(ec.client),
}
// podman v2
env2 := map[string]string{
constants.PodmanContainerHostEnv: podmanURL(ec.username, ec.hostname, ec.port),
constants.PodmanContainerSSHKeyEnv: ec.keypath,
}
//common
env0 := map[string]string{
constants.MinikubeActivePodmanEnv: ec.profile,
}
var env map[string]string
if ec.varlink {
env = env1
} else {
env = env2
}
for k, v := range env0 {
env[k] = v
}
return env
}
// podmanEnvNames gets the necessary podman env variables to reset after using minikube's podman service
func podmanEnvNames(ec PodmanEnvConfig) []string {
// podman v1
vars1 := []string{
constants.PodmanVarlinkBridgeEnv,
}
// podman v2
vars2 := []string{
constants.PodmanContainerHostEnv,
constants.PodmanContainerSSHKeyEnv,
}
// common
vars0 := []string{
constants.MinikubeActivePodmanEnv,
}
var vars []string
if ec.client != nil || ec.hostname != "" {
// getting ec.varlink needs a running machine
if ec.varlink {
vars = vars1
} else {
vars = vars2
}
} else {
// just unset *all* of the variables instead
vars = vars1
vars = append(vars, vars2...)
}
vars = append(vars, vars0...)
return vars
}
func init() {
podmanEnvCmd.Flags().StringVar(&shell.ForceShell, "shell", "", "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect")
podmanEnvCmd.Flags().BoolVarP(&podmanUnset, "unset", "u", false, "Unset variables instead of setting them")

View File

@ -41,7 +41,7 @@ func TestGeneratePodmanScripts(t *testing.T) {
}{
{
"bash",
PodmanEnvConfig{profile: "bash", driver: "kvm2", client: newFakeClient()},
PodmanEnvConfig{profile: "bash", driver: "kvm2", varlink: true, client: newFakeClient()},
nil,
`export PODMAN_VARLINK_BRIDGE="/usr/bin/ssh root@host -- sudo varlink -A \'podman varlink \\\$VARLINK_ADDRESS\' bridge"
export MINIKUBE_ACTIVE_PODMAN="bash"
@ -51,6 +51,19 @@ export MINIKUBE_ACTIVE_PODMAN="bash"
`,
`unset PODMAN_VARLINK_BRIDGE;
unset MINIKUBE_ACTIVE_PODMAN;
`,
},
{
"bash",
PodmanEnvConfig{profile: "bash", driver: "kvm2", client: newFakeClient(), username: "root", hostname: "host", port: 22},
nil,
`export CONTAINER_HOST="ssh://root@host:22/run/podman/podman.sock"
export MINIKUBE_ACTIVE_PODMAN="bash"
# To point your shell to minikube's podman service, run:
# eval $(minikube -p bash podman-env)
`,
`unset CONTAINER_HOST CONTAINER_SSHKEY MINIKUBE_ACTIVE_PODMAN
`,
},
}

View File

@ -17,7 +17,7 @@ limitations under the License.
package cmd
import (
goflag "flag"
"flag"
"fmt"
"os"
"path/filepath"
@ -71,7 +71,23 @@ func Execute() {
_, callingCmd := filepath.Split(os.Args[0])
if callingCmd == "kubectl" {
os.Args = append([]string{RootCmd.Use, callingCmd}, os.Args[1:]...)
// If the user is using the minikube binary as kubectl, allow them to specify the kubectl context without also specifying minikube profile
profile := ""
for i, a := range os.Args {
if a == "--context" {
profile = fmt.Sprintf("--profile=%s", os.Args[i+1])
break
} else if strings.HasPrefix(a, "--context=") {
context := strings.Split(a, "=")[1]
profile = fmt.Sprintf("--profile=%s", context)
break
}
}
if profile != "" {
os.Args = append([]string{RootCmd.Use, callingCmd, profile, "--"}, os.Args[1:]...)
} else {
os.Args = append([]string{RootCmd.Use, callingCmd, "--"}, os.Args[1:]...)
}
}
for _, c := range RootCmd.Commands() {
c.Short = translate.T(c.Short)
@ -140,6 +156,18 @@ func usageTemplate() string {
}
func init() {
klog.InitFlags(nil)
// preset logtostderr and alsologtostderr only for test runs, for normal runs consider flags in main()
if strings.HasPrefix(filepath.Base(os.Args[0]), "e2e-") || strings.HasSuffix(os.Args[0], "test") {
if err := flag.Set("logtostderr", "false"); err != nil {
klog.Warningf("Unable to set default flag value for logtostderr: %v", err)
}
if err := flag.Set("alsologtostderr", "false"); err != nil {
klog.Warningf("Unable to set default flag value for alsologtostderr: %v", err)
}
}
pflag.CommandLine.AddGoFlagSet(flag.CommandLine) // avoid `generate-docs_test.go` complaining about "Docs are not updated"
RootCmd.PersistentFlags().StringP(config.ProfileName, "p", constants.DefaultClusterName, `The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently.`)
RootCmd.PersistentFlags().StringP(configCmd.Bootstrapper, "b", "kubeadm", "The name of the cluster bootstrapper that will set up the Kubernetes cluster.")
@ -207,15 +235,6 @@ func init() {
RootCmd.AddCommand(completionCmd)
templates.ActsAsRootCommand(RootCmd, []string{"options"}, groups...)
klog.InitFlags(nil)
if err := goflag.Set("logtostderr", "false"); err != nil {
klog.Warningf("Unable to set default flag value for logtostderr: %v", err)
}
if err := goflag.Set("alsologtostderr", "false"); err != nil {
klog.Warningf("Unable to set default flag value for alsologtostderr: %v", err)
}
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
if err := viper.BindPFlags(RootCmd.PersistentFlags()); err != nil {
exit.Error(reason.InternalBindFlags, "Unable to bind flags", err)
}

View File

@ -67,6 +67,6 @@ var sshCmd = &cobra.Command{
}
func init() {
sshCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
sshCmd.Flags().BoolVar(&nativeSSHClient, "native-ssh", true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
sshCmd.Flags().StringVarP(&nodeName, "node", "n", "", "The node to ssh into. Defaults to the primary control plane.")
}

View File

@ -128,7 +128,7 @@ func platform() string {
func runStart(cmd *cobra.Command, args []string) {
register.SetEventLogPath(localpath.EventLog(ClusterFlagValue()))
out.SetJSON(viper.GetString(startOutput) == "json")
out.SetJSON(outputFormat == "json")
displayVersion(version.GetVersion())
// No need to do the update check if no one is going to see it
@ -436,7 +436,7 @@ func showKubectlInfo(kcs *kubeconfig.Settings, k8sVersion string, machineName st
if kcs.KeepContext {
out.T(style.Kubectl, "To connect to this cluster, use: --context={{.name}}", out.V{"name": kcs.ClusterName})
} else {
out.T(style.Ready, `Done! kubectl is now configured to use "{{.name}}" by default`, out.V{"name": machineName})
out.T(style.Ready, `Done! kubectl is now configured to use "{{.name}}" cluster and "{{.ns}}" namespace by default`, out.V{"name": machineName, "ns": kcs.Namespace})
}
}()
@ -1074,7 +1074,7 @@ func validateFlags(cmd *cobra.Command, drvName string) {
}
}
if s := viper.GetString(startOutput); s != "text" && s != "json" {
if outputFormat != "text" && outputFormat != "json" {
exit.Message(reason.Usage, "Sorry, please set the --output flag to one of the following valid options: [text,json]")
}

View File

@ -106,8 +106,12 @@ const (
deleteOnFailure = "delete-on-failure"
forceSystemd = "force-systemd"
kicBaseImage = "base-image"
startOutput = "output"
ports = "ports"
startNamespace = "namespace"
)
var (
outputFormat string
)
// initMinikubeFlags includes commandline flags for minikube.
@ -147,12 +151,13 @@ func initMinikubeFlags() {
startCmd.Flags().Bool(preload, true, "If set, download tarball of preloaded images if available to improve start time. Defaults to true.")
startCmd.Flags().Bool(deleteOnFailure, false, "If set, delete the current cluster if start fails and try again. Defaults to false.")
startCmd.Flags().Bool(forceSystemd, false, "If set, force the container runtime to use sytemd as cgroup manager. Currently available for docker and crio. Defaults to false.")
startCmd.Flags().StringP(startOutput, "o", "text", "Format to print stdout in. Options include: [text,json]")
startCmd.Flags().StringVarP(&outputFormat, "output", "o", "text", "Format to print stdout in. Options include: [text,json]")
}
// initKubernetesFlags inits the commandline flags for Kubernetes related options
func initKubernetesFlags() {
startCmd.Flags().String(kubernetesVersion, "", fmt.Sprintf("The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for %s, 'latest' for %s). Defaults to 'stable'.", constants.DefaultKubernetesVersion, constants.NewestKubernetesVersion))
startCmd.Flags().String(startNamespace, "default", "The named space to activate after start")
startCmd.Flags().Var(&config.ExtraOptions, "extra-config",
`A set of key=value pairs that describe configuration that may be passed to different components.
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
@ -280,6 +285,11 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
klog.Errorf("Found deprecated --enable-default-cni flag, setting --cni=bridge")
chosenCNI = "bridge"
}
// networkPlugin cni deprecation warning
chosenNetworkPlugin := viper.GetString(networkPlugin)
if chosenNetworkPlugin == "cni" {
out.WarningT("With --network-plugin=cni, you will need to provide your own CNI. See --cni flag as a user-friendly alternative")
}
cc = config.ClusterConfig{
Name: ClusterFlagValue(),
@ -319,6 +329,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: k8sVersion,
ClusterName: ClusterFlagValue(),
Namespace: viper.GetString(startNamespace),
APIServerName: viper.GetString(apiServerName),
APIServerNames: apiServerNames,
APIServerIPs: apiServerIPs,
@ -326,7 +337,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
FeatureGates: viper.GetString(featureGates),
ContainerRuntime: viper.GetString(containerRuntime),
CRISocket: viper.GetString(criSocket),
NetworkPlugin: viper.GetString(networkPlugin),
NetworkPlugin: chosenNetworkPlugin,
ServiceCIDR: viper.GetString(serviceCIDR),
ImageRepository: repository,
ExtraOptions: config.ExtraOptions,
@ -540,6 +551,10 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC
cc.KubernetesConfig.KubernetesVersion = getKubernetesVersion(existing)
}
if cmd.Flags().Changed(startNamespace) {
cc.KubernetesConfig.Namespace = viper.GetString(startNamespace)
}
if cmd.Flags().Changed(apiServerName) {
cc.KubernetesConfig.APIServerName = viper.GetString(apiServerName)
}

View File

@ -345,8 +345,7 @@ func nodeStatus(api libmachine.API, cc config.ClusterConfig, n config.Node) (*St
st.Host = codeNames[InsufficientStorage]
}
stk := kverify.KubeletStatus(cr)
klog.Infof("%s kubelet status = %s", name, stk)
stk := kverify.ServiceStatus(cr, "kubelet")
st.Kubelet = stk.String()
// Early exit for worker nodes

View File

@ -55,6 +55,7 @@ var stopCmd = &cobra.Command{
func init() {
stopCmd.Flags().BoolVar(&stopAll, "all", false, "Set flag to stop all profiles (clusters)")
stopCmd.Flags().BoolVar(&keepActive, "keep-context-active", false, "keep the kube-context active after cluster is stopped. Defaults to false.")
stopCmd.Flags().StringVarP(&outputFormat, "output", "o", "text", "Format to print stdout in. Options include: [text,json]")
if err := viper.GetViper().BindPFlags(stopCmd.Flags()); err != nil {
exit.Error(reason.InternalFlagsBind, "unable to bind flags", err)
@ -63,6 +64,7 @@ func init() {
// runStop handles the executes the flow of "minikube stop"
func runStop(cmd *cobra.Command, args []string) {
out.SetJSON(outputFormat == "json")
register.SetEventLogPath(localpath.EventLog(ClusterFlagValue()))
register.Reg.SetStep(register.Stopping)

View File

@ -46,6 +46,7 @@ var unpauseCmd = &cobra.Command{
register.SetEventLogPath(localpath.EventLog(cname))
co := mustload.Running(cname)
out.SetJSON(outputFormat == "json")
register.Reg.SetStep(register.Unpausing)
klog.Infof("namespaces: %v keys: %v", namespaces, viper.AllSettings())
@ -106,4 +107,5 @@ var unpauseCmd = &cobra.Command{
func init() {
unpauseCmd.Flags().StringSliceVarP(&namespaces, "--namespaces", "n", constants.DefaultNamespaces, "namespaces to unpause")
unpauseCmd.Flags().BoolVarP(&allNamespaces, "all-namespaces", "A", false, "If set, unpause all namespaces")
unpauseCmd.Flags().StringVarP(&outputFormat, "output", "o", "text", "Format to print stdout in. Options include: [text,json]")
}

View File

@ -18,17 +18,15 @@ package main
import (
"bytes"
"flag"
"fmt"
"log"
"os"
"regexp"
"strconv"
// initflag must be imported before any other minikube pkg.
// Fix for https://github.com/kubernetes/minikube/issues/4866
"github.com/spf13/pflag"
"k8s.io/klog/v2"
_ "k8s.io/minikube/pkg/initflag"
// Register drivers
_ "k8s.io/minikube/pkg/minikube/registry/drvs"
@ -61,6 +59,8 @@ func main() {
bridgeLogMessages()
defer klog.Flush()
setFlags()
s := stacklog.MustStartFromEnv("STACKLOG_PATH")
defer s.Stop()
@ -120,3 +120,35 @@ func (lb machineLogBridge) Write(b []byte) (n int, err error) {
}
return len(b), nil
}
// setFlags sets the flags
func setFlags() {
// parse flags beyond subcommand - get aroung go flag 'limitations':
// "Flag parsing stops just before the first non-flag argument" (ref: https://pkg.go.dev/flag#hdr-Command_line_flag_syntax)
pflag.CommandLine.ParseErrorsWhitelist.UnknownFlags = true
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
// avoid 'pflag: help requested' error, as help will be defined later by cobra cmd.Execute()
pflag.BoolP("help", "h", false, "")
pflag.Parse()
// set default flag value for logtostderr and alsologtostderr but don't override user's preferences
if !pflag.CommandLine.Changed("logtostderr") {
if err := pflag.Set("logtostderr", "false"); err != nil {
klog.Warningf("Unable to set default flag value for logtostderr: %v", err)
}
}
if !pflag.CommandLine.Changed("alsologtostderr") {
if err := pflag.Set("alsologtostderr", "false"); err != nil {
klog.Warningf("Unable to set default flag value for alsologtostderr: %v", err)
}
}
// make sure log_dir exists if log_file is not also set - the log_dir is mutually exclusive with the log_file option
// ref: https://github.com/kubernetes/klog/blob/52c62e3b70a9a46101f33ebaf0b100ec55099975/klog.go#L491
if pflag.Lookup("log_file") != nil && pflag.Lookup("log_file").Value.String() == "" &&
pflag.Lookup("log_dir") != nil && pflag.Lookup("log_dir").Value.String() != "" {
if err := os.MkdirAll(pflag.Lookup("log_dir").Value.String(), 0755); err != nil {
klog.Warningf("unable to create log directory: %v", err)
}
}
}

View File

@ -46,7 +46,7 @@ spec:
value: kube-system
- name: TILLER_HISTORY_MAX
value: "0"
image: gcr.io/kubernetes-helm/tiller:v2.16.8
image: gcr.io/kubernetes-helm/tiller:v2.16.12
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3

View File

@ -80,7 +80,7 @@ spec:
hostNetwork: true
containers:
- name: minikube-ingress-dns
image: "cryptexlabs/minikube-ingress-dns:0.2.1"
image: "cryptexlabs/minikube-ingress-dns:0.3.0"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 53

View File

@ -49,7 +49,7 @@ spec:
serviceAccountName: ingress-nginx
containers:
- name: controller
image: us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.34.1@sha256:0e072dddd1f7f8fc8909a2ca6f65e76c5f0d2fcfb8be47935ae3457e8bbceb20
image: k8s.gcr.io/ingress-nginx/controller:v0.40.2@sha256:46ba23c3fbaafd9e5bd01ea85b2f921d9f2217be082580edc22e6c704a83f02f
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@ -141,21 +141,25 @@ webhooks:
- name: validate.nginx.ingress.kubernetes.io
rules:
- apiGroups:
- extensions
- networking.k8s.io
apiVersions:
- v1beta1
- v1
operations:
- CREATE
- UPDATE
resources:
- ingresses
failurePolicy: Fail
sideEffects: None
admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
namespace: kube-system
name: ingress-nginx-controller-admission
path: /extensions/v1beta1/ingresses
path: /networking/v1beta1/ingresses
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@ -248,7 +252,7 @@ spec:
spec:
containers:
- name: patch
image: jettech/kube-webhook-certgen:v1.2.2
image: docker.io/jettech/kube-webhook-certgen:v1.3.0
imagePullPolicy:
args:
- patch

View File

@ -11,7 +11,6 @@ CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_IKHEADERS=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
CONFIG_MEMCG=y
@ -57,7 +56,6 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI=y
CONFIG_PCCARD=y
@ -86,6 +84,8 @@ CONFIG_SGI_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_BINFMT_MISC=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
@ -313,7 +313,6 @@ CONFIG_VMWARE_BALLOON=m
CONFIG_VMWARE_VMCI=m
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SPI_ATTRS=y
@ -390,9 +389,9 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_NVRAM=y
CONFIG_HPET=y
# CONFIG_HPET_MMAP is not set
@ -408,7 +407,6 @@ CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y
CONFIG_FB_EFI=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_VGACON_SOFT_SCROLLBACK=y
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
@ -447,7 +445,6 @@ CONFIG_RTC_CLASS=y
CONFIG_DMADEVICES=y
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_FS=y
CONFIG_HYPERV=m
CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_BALLOON=m
@ -475,7 +472,6 @@ CONFIG_ZISOFS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=y
@ -513,10 +509,10 @@ CONFIG_DEBUG_STACK_USAGE=y
CONFIG_DEBUG_STACKOVERFLOW=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_SCHEDSTATS=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_OPTIMIZE_INLINING=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y

View File

@ -0,0 +1,3 @@
# Turn on MTU probing to avoid network hangs when the Docker MTU is larger than
# the host or upstream network MTU.
net.ipv4.tcp_mtu_probing=1

View File

@ -21,7 +21,7 @@ BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/patche
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_LATEST_VERSION=n
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.114"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.150"
BR2_LINUX_KERNEL_BZIMAGE=y
BR2_LINUX_KERNEL_LZ4=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y

View File

@ -5,3 +5,4 @@ sha256 6165ae2ad669d9ec6d317492d30a1511365bd31ad29efae757f19c1828bf75b3 v1.2.8.t
sha256 a0965e1492fca558629826f1aa89a9675de3d451cec67540400b30c0bf6ac387 v1.2.10.tar.gz
sha256 318886ea1efdec36f088fd6a0a0fe2b2f0ebdfd0066bdb4bd284bad12abc0a41 v1.2.12.tar.gz
sha256 0811057ab67b78ce911416e793edaeb14b3f1e105d67b8e67b6302e0eab572e4 v1.2.13.tar.gz
sha256 d30d59e143697aa4f0960205b3f5ac59c573b332f20507740ef2dc0fb5ae8ded v1.3.7.tar.gz

View File

@ -3,8 +3,8 @@
# containerd
#
################################################################################
CONTAINERD_BIN_VERSION = v1.2.13
CONTAINERD_BIN_COMMIT = 7ad184331fa3e55e52b890ea95e65ba581ae3429
CONTAINERD_BIN_VERSION = v1.3.7
CONTAINERD_BIN_COMMIT = 8fba4e9a7d01810a393d5d25a3621dc101981175
CONTAINERD_BIN_SITE = https://github.com/containerd/containerd/archive
CONTAINERD_BIN_SOURCE = $(CONTAINERD_BIN_VERSION).tar.gz
CONTAINERD_BIN_DEPENDENCIES = host-go libgpgme

View File

@ -13,3 +13,7 @@ sha256 57e1ee990ef2d5af8b32c33a21b4998682608e3556dcf1d3349666f55e7d95b9 v1.16.1.
sha256 23a797762e4544ee7c171ef138cfc1141a3f0acc2838d9965c2a58e53b16c3ae v1.17.0.tar.gz
sha256 7967e9218fdfb59d6005a9e19c1668469bc5566c2a35927cffe7de8656bb22c7 v1.17.1.tar.gz
sha256 336f5c275e260eaae8187e7250fb960441e8dc90615729354d3c04e699870982 v1.17.3.tar.gz
sha256 865ded95aceb3a33a391b252522682de6b37b39498704c490b3a321dbefaafcb v1.18.0.tar.gz
sha256 794ddc36c2a20fde91fc6cc2c6f02ebdaea85c69b51b67f3994090dbbdbc2a50 v1.18.1.tar.gz
sha256 25dc558fbabc987bd58c7eab5230121b258a7b0eb34a49dc6595f1c6f3969116 v1.18.2.tar.gz
sha256 d5c6442e3990938badc966cdd1eb9ebe2fc11345452c233aa0d87ca38fbeed81 v1.18.3.tar.gz

View File

@ -4,8 +4,8 @@
#
################################################################################
CRIO_BIN_VERSION = v1.17.3
CRIO_BIN_COMMIT = 1b192d16cb1cd04ee8fbf60ae2c06bccc5eac5c8
CRIO_BIN_VERSION = v1.18.3
CRIO_BIN_COMMIT = 61de18161fb4ccda720768c001713592b5a04e46
CRIO_BIN_SITE = https://github.com/cri-o/cri-o/archive
CRIO_BIN_SOURCE = $(CRIO_BIN_VERSION).tar.gz
CRIO_BIN_DEPENDENCIES = host-go libgpgme
@ -33,7 +33,7 @@ endef
define CRIO_BIN_BUILD_CMDS
mkdir -p $(@D)/bin
$(CRIO_BIN_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) GIT_COMMIT=$(CRIO_BIN_COMMIT) PREFIX=/usr binaries
$(CRIO_BIN_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) COMMIT_NO=$(CRIO_BIN_COMMIT) PREFIX=/usr binaries
endef
define CRIO_BIN_INSTALL_TARGET_CMDS

View File

@ -35,8 +35,15 @@ storage_driver = "overlay"
# the kubelet. The log directory specified must be an absolute directory.
log_dir = "/var/log/crio/pods"
# Location for CRI-O to lay down the version file
version_file = "/var/lib/crio/version"
# Location for CRI-O to lay down the temporary version file.
# It is used to check if crio wipe should wipe containers, which should
# always happen on a node reboot
version_file = "/var/run/crio/version"
# Location for CRI-O to lay down the persistent version file.
# It is used to check if crio wipe should wipe images, which should
# only happen when CRI-O has been upgraded
version_file_persist = "/var/lib/crio/version"
# The crio.api table contains settings for the kubelet/gRPC interface.
[crio.api]
@ -44,13 +51,11 @@ version_file = "/var/lib/crio/version"
# Path to AF_LOCAL socket on which CRI-O will listen.
listen = "/var/run/crio/crio.sock"
# Host IP considered as the primary IP to use by CRI-O for things such as host network IP.
host_ip = ""
# IP address on which the stream server will listen.
stream_address = "127.0.0.1"
# The port on which the stream server will listen.
# The port on which the stream server will listen. If the port is set to "0", then
# CRI-O will allocate a random free port number.
stream_port = "0"
# Enable encrypted TLS transport of the stream server.
@ -94,6 +99,10 @@ default_runtime = "runc"
# If true, the runtime will not use pivot_root, but instead use MS_MOVE.
no_pivot = false
# decryption_keys_path is the path where the keys required for
# image decryption are stored. This option supports live configuration reload.
decryption_keys_path = "/etc/crio/keys/"
# Path to the conmon binary, used for monitoring the OCI runtime.
# Will be searched for using $PATH if empty.
conmon = "/usr/libexec/crio/conmon"
@ -107,17 +116,26 @@ conmon_env = [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
]
# Additional environment variables to set for all the
# containers. These are overridden if set in the
# container image spec or in the container runtime configuration.
default_env = [
]
# If true, SELinux will be used for pod separation on the host.
selinux = false
# Path to the seccomp.json profile which is used as the default seccomp profile
# for the runtime. If not specified, then the internal default seccomp profile
# will be used.
# will be used. This option supports live configuration reload.
seccomp_profile = ""
# Used to change the name of the default AppArmor profile of CRI-O. The default
# profile name is "crio-default-" followed by the version string of CRI-O.
apparmor_profile = "crio-default-1.16.1"
# profile name is "crio-default". This profile only takes effect if the user
# does not specify a profile via the Kubernetes Pod's metadata annotation. If
# the profile is set to "unconfined", then this equals to disabling AppArmor.
# This option supports live configuration reload.
apparmor_profile = "crio-default"
# Cgroup management implementation used for the runtime.
cgroup_manager = "systemd"
@ -126,17 +144,15 @@ cgroup_manager = "systemd"
# only the capabilities defined in the containers json file by the user/kube
# will be added.
default_capabilities = [
"CHOWN",
"DAC_OVERRIDE",
"FSETID",
"FOWNER",
"NET_RAW",
"SETGID",
"SETUID",
"SETPCAP",
"NET_BIND_SERVICE",
"SYS_CHROOT",
"KILL",
"CHOWN",
"DAC_OVERRIDE",
"FSETID",
"FOWNER",
"SETGID",
"SETUID",
"SETPCAP",
"NET_BIND_SERVICE",
"KILL",
]
# List of default sysctls. If it is empty or commented out, only the sysctls
@ -151,8 +167,10 @@ default_sysctls = [
additional_devices = [
]
# Path to OCI hooks directories for automatically executed hooks.
# Path to OCI hooks directories for automatically executed hooks. If one of the
# directories does not exist, then CRI-O will automatically skip them.
hooks_dir = [
"/usr/share/containers/oci/hooks.d",
]
# List of default mounts for each container. **Deprecated:** this option will
@ -200,9 +218,13 @@ bind_mount_prefix = ""
read_only = false
# Changes the verbosity of the logs based on the level it is set to. Options
# are fatal, panic, error, warn, info, and debug. This option supports live
# configuration reload.
log_level = "error"
# are fatal, panic, error, warn, info, debug and trace. This option supports
# live configuration reload.
log_level = "info"
# Filter the log messages by the provided regular expression.
# This option supports live configuration reload.
log_filter = ""
# The UID mappings for the user namespace of each container. A range is
# specified in the form containerUID:HostUID:Size. Multiple ranges must be
@ -215,12 +237,23 @@ uid_mappings = ""
gid_mappings = ""
# The minimal amount of time in seconds to wait before issuing a timeout
# regarding the proper termination of the container.
ctr_stop_timeout = 0
# regarding the proper termination of the container. The lowest possible
# value is 30s, whereas lower values are not considered by CRI-O.
ctr_stop_timeout = 30
# ManageNetworkNSLifecycle determines whether we pin and remove network namespace
# and manage its lifecycle.
manage_network_ns_lifecycle = false
# **DEPRECATED** this option is being replaced by manage_ns_lifecycle, which is described below.
# manage_network_ns_lifecycle = false
# manage_ns_lifecycle determines whether we pin and remove namespaces
# and manage their lifecycle
manage_ns_lifecycle = false
# The directory where the state of the managed namespaces gets tracked.
# Only used when manage_ns_lifecycle is true.
namespaces_dir = "/var/run"
# pinns_path is the path to find the pinns binary, which is needed to manage namespace lifecycle
pinns_path = "/usr/bin/pinns"
# The "crio.runtime.runtimes" table defines a list of OCI compatible runtimes.
# The runtime to use is picked based on the runtime_handler provided by the CRI.
@ -281,7 +314,7 @@ global_auth_file = ""
# The image used to instantiate infra containers.
# This option supports live configuration reload.
pause_image = "k8s.gcr.io/pause:3.1"
pause_image = "k8s.gcr.io/pause:3.2"
# The path to a file containing credentials specific for pulling the pause_image from
# above. The file is similar to that of /var/lib/kubelet/config.json
@ -324,6 +357,10 @@ registries = [
# CNI plugins.
[crio.network]
# The default CNI network name to be selected. If not set or "", then
# CRI-O will pick-up the first one found in network_dir.
# cni_default_network = ""
# Path to the directory where CNI configuration files are located.
network_dir = "/etc/cni/net.d/"

View File

@ -35,8 +35,15 @@
# the kubelet. The log directory specified must be an absolute directory.
log_dir = "/var/log/crio/pods"
# Location for CRI-O to lay down the version file
version_file = "/var/lib/crio/version"
# Location for CRI-O to lay down the temporary version file.
# It is used to check if crio wipe should wipe containers, which should
# always happen on a node reboot
version_file = "/var/run/crio/version"
# Location for CRI-O to lay down the persistent version file.
# It is used to check if crio wipe should wipe images, which should
# only happen when CRI-O has been upgraded
version_file_persist = "/var/lib/crio/version"
# The crio.api table contains settings for the kubelet/gRPC interface.
[crio.api]
@ -44,13 +51,11 @@ version_file = "/var/lib/crio/version"
# Path to AF_LOCAL socket on which CRI-O will listen.
listen = "/var/run/crio/crio.sock"
# Host IP considered as the primary IP to use by CRI-O for things such as host network IP.
host_ip = ""
# IP address on which the stream server will listen.
stream_address = "127.0.0.1"
# The port on which the stream server will listen.
# The port on which the stream server will listen. If the port is set to "0", then
# CRI-O will allocate a random free port number.
stream_port = "0"
# Enable encrypted TLS transport of the stream server.
@ -94,6 +99,10 @@ default_runtime = "runc"
# If true, the runtime will not use pivot_root, but instead use MS_MOVE.
no_pivot = false
# decryption_keys_path is the path where the keys required for
# image decryption are stored. This option supports live configuration reload.
decryption_keys_path = "/etc/crio/keys/"
# Path to the conmon binary, used for monitoring the OCI runtime.
# Will be searched for using $PATH if empty.
conmon = ""
@ -107,36 +116,43 @@ conmon_env = [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
]
# Additional environment variables to set for all the
# containers. These are overridden if set in the
# container image spec or in the container runtime configuration.
default_env = [
]
# If true, SELinux will be used for pod separation on the host.
selinux = false
# Path to the seccomp.json profile which is used as the default seccomp profile
# for the runtime. If not specified, then the internal default seccomp profile
# will be used.
# will be used. This option supports live configuration reload.
seccomp_profile = ""
# Used to change the name of the default AppArmor profile of CRI-O. The default
# profile name is "crio-default-" followed by the version string of CRI-O.
apparmor_profile = "crio-default-1.16.1"
# profile name is "crio-default". This profile only takes effect if the user
# does not specify a profile via the Kubernetes Pod's metadata annotation. If
# the profile is set to "unconfined", then this equals to disabling AppArmor.
# This option supports live configuration reload.
apparmor_profile = "crio-default"
# Cgroup management implementation used for the runtime.
cgroup_manager = "cgroupfs"
cgroup_manager = "systemd"
# List of default capabilities for containers. If it is empty or commented out,
# only the capabilities defined in the containers json file by the user/kube
# will be added.
default_capabilities = [
"CHOWN",
"DAC_OVERRIDE",
"FSETID",
"FOWNER",
"NET_RAW",
"SETGID",
"SETUID",
"SETPCAP",
"NET_BIND_SERVICE",
"SYS_CHROOT",
"KILL",
"CHOWN",
"DAC_OVERRIDE",
"FSETID",
"FOWNER",
"SETGID",
"SETUID",
"SETPCAP",
"NET_BIND_SERVICE",
"KILL",
]
# List of default sysctls. If it is empty or commented out, only the sysctls
@ -151,8 +167,10 @@ default_sysctls = [
additional_devices = [
]
# Path to OCI hooks directories for automatically executed hooks.
# Path to OCI hooks directories for automatically executed hooks. If one of the
# directories does not exist, then CRI-O will automatically skip them.
hooks_dir = [
"/usr/share/containers/oci/hooks.d",
]
# List of default mounts for each container. **Deprecated:** this option will
@ -200,9 +218,13 @@ bind_mount_prefix = ""
read_only = false
# Changes the verbosity of the logs based on the level it is set to. Options
# are fatal, panic, error, warn, info, and debug. This option supports live
# configuration reload.
log_level = "error"
# are fatal, panic, error, warn, info, debug and trace. This option supports
# live configuration reload.
log_level = "info"
# Filter the log messages by the provided regular expression.
# This option supports live configuration reload.
log_filter = ""
# The UID mappings for the user namespace of each container. A range is
# specified in the form containerUID:HostUID:Size. Multiple ranges must be
@ -215,12 +237,23 @@ uid_mappings = ""
gid_mappings = ""
# The minimal amount of time in seconds to wait before issuing a timeout
# regarding the proper termination of the container.
ctr_stop_timeout = 0
# regarding the proper termination of the container. The lowest possible
# value is 30s, whereas lower values are not considered by CRI-O.
ctr_stop_timeout = 30
# ManageNetworkNSLifecycle determines whether we pin and remove network namespace
# and manage its lifecycle.
manage_network_ns_lifecycle = false
# **DEPRECATED** this option is being replaced by manage_ns_lifecycle, which is described below.
# manage_network_ns_lifecycle = false
# manage_ns_lifecycle determines whether we pin and remove namespaces
# and manage their lifecycle
manage_ns_lifecycle = false
# The directory where the state of the managed namespaces gets tracked.
# Only used when manage_ns_lifecycle is true.
namespaces_dir = "/var/run"
# pinns_path is the path to find the pinns binary, which is needed to manage namespace lifecycle
pinns_path = ""
# The "crio.runtime.runtimes" table defines a list of OCI compatible runtimes.
# The runtime to use is picked based on the runtime_handler provided by the CRI.
@ -281,7 +314,7 @@ global_auth_file = ""
# The image used to instantiate infra containers.
# This option supports live configuration reload.
pause_image = "k8s.gcr.io/pause:3.1"
pause_image = "k8s.gcr.io/pause:3.2"
# The path to a file containing credentials specific for pulling the pause_image from
# above. The file is similar to that of /var/lib/kubelet/config.json
@ -323,6 +356,10 @@ image_volumes = "mkdir"
# CNI plugins.
[crio.network]
# The default CNI network name to be selected. If not set or "", then
# CRI-O will pick-up the first one found in network_dir.
# cni_default_network = ""
# Path to the directory where CNI configuration files are located.
network_dir = "/etc/cni/net.d/"

View File

@ -21,3 +21,4 @@ sha256 1c03c78be198d9085e7dd6806fc5d93264baaf0c7ea17f584d00af48eae508ee docker-
sha256 7c1576a0bc749418d1423d2b78c8920b5d61f849789904612862dd118742e82b docker-19.03.10.tgz
sha256 0f4336378f61ed73ed55a356ac19e46699a995f2aff34323ba5874d131548b9e docker-19.03.11.tgz
sha256 88de1b87b8a2582fe827154899475a72fb707c5793cfb39d2a24813ba1f31197 docker-19.03.12.tgz
sha256 ddb13aff1fcdcceb710bf71a210169b9c1abfd7420eeaf42cf7975f8fae2fcc8 docker-19.03.13.tgz

View File

@ -4,7 +4,7 @@
#
################################################################################
DOCKER_BIN_VERSION = 19.03.12
DOCKER_BIN_VERSION = 19.03.13
DOCKER_BIN_SITE = https://download.docker.com/linux/static/stable/x86_64
DOCKER_BIN_SOURCE = docker-$(DOCKER_BIN_VERSION).tgz

View File

@ -0,0 +1,3 @@
# Turn on MTU probing to avoid network hangs when the Docker MTU is larger than
# the host or upstream network MTU.
net.ipv4.tcp_mtu_probing=1

View File

@ -15,14 +15,15 @@
# kind node base image
#
# For systemd + docker configuration used below, see the following references:
# https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
# https://systemd.io/CONTAINER_INTERFACE/
# start from ubuntu 20.04, this image is reasonably small as a starting point
# for a kubernetes node image, it doesn't contain much we don't need
FROM ubuntu:focal-20200423
FROM ubuntu:focal-20200925
# copy in static files (configs, scripts)
COPY 10-network-security.conf /etc/sysctl.d/10-network-security.conf
COPY 11-tcp-mtu-probing.conf /etc/sysctl.d/11-tcp-mtu-probing.conf
COPY clean-install /usr/local/bin/clean-install
COPY entrypoint /usr/local/bin/entrypoint
@ -37,6 +38,7 @@ COPY entrypoint /usr/local/bin/entrypoint
# - packages needed for kubernetes components
# - packages needed by the container runtime
# - misc packages kind uses itself
# - packages that provide semi-core kubernetes functionality
# After installing packages we cleanup by:
# - removing unwanted systemd services
# - disabling kmsg in journald (these log entries would be confusing)
@ -54,8 +56,9 @@ RUN echo "Ensuring scripts are executable ..." \
&& DEBIAN_FRONTEND=noninteractive clean-install \
systemd \
conntrack iptables iproute2 ethtool socat util-linux mount ebtables udev kmod \
libseccomp2 \
libseccomp2 pigz \
bash ca-certificates curl rsync \
nfs-common \
&& find /lib/systemd/system/sysinit.target.wants/ -name "systemd-tmpfiles-setup.service" -delete \
&& rm -f /lib/systemd/system/multi-user.target.wants/* \
&& rm -f /etc/systemd/system/*.wants/* \
@ -73,7 +76,7 @@ RUN echo "Ensuring scripts are executable ..." \
&& sed -i /etc/nsswitch.conf -re 's#^(hosts:\s*).*#\1dns files#'
# tell systemd that it is in docker (it will check for the container env)
# https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
# https://systemd.io/CONTAINER_INTERFACE/
ENV container docker
# systemd exits on SIGRTMIN+3, not SIGTERM (which re-executes it)
# https://bugzilla.redhat.com/show_bug.cgi?id=1201657
@ -92,14 +95,17 @@ RUN clean-install \
lz4 \
gnupg \
sudo \
docker.io \
containerd \
openssh-server \
dnsutils \
runc \
# libglib2.0-0 is required for conmon, which is required for podman
libglib2.0-0
# install docker
RUN sh -c "echo 'deb https://download.docker.com/linux/ubuntu focal stable' > /etc/apt/sources.list.d/docker.list" && \
curl -L https://download.docker.com/linux/ubuntu/gpg -o docker.key && \
apt-key add - < docker.key && \
clean-install docker-ce docker-ce-cli containerd.io
# Install cri-o/podman dependencies:
RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \
@ -118,7 +124,7 @@ RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman focal main' > /et
apt-key add - < afbjorklund-public.key.asc && \
clean-install podman=1.9.3~1
RUN mkdir -p /usr/lib/cri-o-runc/sbin && cp /usr/sbin/runc /usr/lib/cri-o-runc/sbin/runc
RUN mkdir -p /usr/lib/cri-o-runc/sbin && cp /usr/bin/runc /usr/lib/cri-o-runc/sbin/runc
# automount service
COPY automount/minikube-automount /usr/sbin/minikube-automount

View File

@ -80,9 +80,17 @@ fix_cgroup_mounts() {
# environment by doing another bind mount for each subsystem.
local cgroup_mounts
# NOTE: This extracts fields 4 and on
# This regexp finds all /sys/fs/cgroup mounts that are cgroupfs and mounted somewhere other than / - extracting fields 4+
# See https://man7.org/linux/man-pages/man5/proc.5.html for field names
cgroup_mounts=$(egrep -o '(/docker|libpod_parent|/kubepods).*/sys/fs/cgroup.*' /proc/self/mountinfo || true)
# Example inputs:
#
# Docker: /docker/562a56986a84b3cd38d6a32ac43fdfcc8ad4d2473acf2839cbf549273f35c206 /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:143 master:23 - cgroup devices rw,devices
# podman: /libpod_parent/libpod-73a4fb9769188ae5dc51cb7e24b9f2752a4af7b802a8949f06a7b2f2363ab0e9 ...
# Cloud Shell: /kubepods/besteffort/pod3d6beaa3004913efb68ce073d73494b0/accdf94879f0a494f317e9a0517f23cdd18b35ff9439efd0175f17bbc56877c4 /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime master:19 - cgroup cgroup rw,memory
# GitHub actions #9304: /actions_job/0924fbbcf7b18d2a00c171482b4600747afc367a9dfbeac9d6b14b35cda80399 /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:263 master:24 - cgroup cgroup rw,memory
cgroup_mounts=$(grep -E -o '/[[:alnum:]].* /sys/fs/cgroup.*.*cgroup' /proc/self/mountinfo || true)
if [[ -n "${cgroup_mounts}" ]]; then
local mount_root

View File

@ -1,4 +1,20 @@
[
{
"name": "v1.14.2",
"checksums": {
"darwin": "5d72bea6159e41f30865492298aa0e37af164ef22e56165ac78be179947d3b9d",
"linux": "f38f8da05a940589989eb0e85492edfe146caf57f9cfbb4ebb06de877f828f2e",
"windows": "cafd7a10a950d3c63425758b1afb3eaad12a4a5abd586fb83afc27a832a2c62b"
}
},
{
"name": "v1.14.1",
"checksums": {
"darwin": "d07db8343d06caa484a645bdd84d72d9babba81a18a7a50729616571b5e6702a",
"linux": "a7ad2b00389146a5b1833a35a96e50a224e7b382d072ee771b425eb6719bf109",
"windows": "71217e883e2d1c17b64415fbabef6bf199c7b03f88f66478c659d199c315e315"
}
},
{
"name": "v1.14.0",
"checksums": {

View File

@ -0,0 +1,85 @@
# Tracing minikube
* First proposed: Oct 30 2020
* Authors: Priya Wadhwa (priyawadhwa@)
## Reviewer Priorities
Please review this proposal with the following priorities:
* Does this fit with minikube's [principles](https://minikube.sigs.k8s.io/docs/concepts/principles/)?
* Are there other approaches to consider?
* Could the implementation be made simpler?
* Are there usability, reliability, or technical debt concerns?
Please leave the above text in your proposal as instructions to the reader.
## Summary
This proposal covers using the [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-go) API to provide tracing data for minikube.
This data would be useful for maintainers to identify areas for performance improvements.
This data would also be used to create a dashboard of current performance and would allow us to catch performance regressions more quickly.
## Goals
* Trace data is can be collected and exported for `minikube start`
* `minikube start` can either create a new Trace or can read from a file and append data to an existing Trace
* It is easy for users to add their own exporters if they wish to export data to their own service
* We are able to create dashboards around `minikube start` performance that will alert maintainers if regressions happen
## Non-Goals
* Collecting trace data for the minikube cluster while it is running
## Design Details
There are two pieces to the design: collecting the data and exporting the data.
### Collecting Data
Luckily, we already have a lot of this infrastructure set up for JSON output.
We know when a new substep of `minikube start` has started, because we call it explictly via `register.SetStep`.
We also know that substep has ended when a new substep begins.
We can start new spans whenever `register.SetStep` is called, and thus collect tracing data.
### Exporting Data
OpenTelemetry supports a variety of [user-contributed exporters](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/master/instrumentation).
It would be a lot of work to implement all of them ourselves.
Instead, I propose writing a simple `GetExporter` function that would return whatever exporter is requested via a `--trace` flag.
So, something like this would tell minikube to use the `stackdriver` exporter:
```
minikube start --trace=stackdriver
```
Users can then contribute to minikube if they need to use an exporter that isn't currently provided.
Exporters also will require additional information to make sure data is sent to the correct place.
This could include things like, but not limited to:
* project ID
* zone
Since it could get messy passing in these things as flags to `minikube start`, I propose that these values are set via environment variable.
All environment variables will be of the form:
```
MINIKUBE_TRACE_PROJECT_ID
```
and the user-contributed code is responsible for parsing the environment variables correctly and returning the exporter.
### Testing Plan
I will set up a dashboard and alerting system in the minikube GCP project.
If we are collecting data at a consistent rate, and the dashboard is populated, we will know that this has worked.
## Alternatives Considered
### Building a Wrapper Binary
A wrapper binary could run `minikube start --output json` and collect the same data, and then export it to whatever service we need.
A large advantage of this is that the minikube code doesn't have to be changed at all for this to work.
However, I decided against this in case other tools that consume minikube or users want to collect this data as well -- it is much easier to pass in a flag to minikube than to download another binary.

22
go.mod
View File

@ -1,37 +1,40 @@
module k8s.io/minikube
go 1.13
go 1.15
require (
cloud.google.com/go/storage v1.8.0
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect
github.com/Parallels/docker-machine-parallels v1.3.0
github.com/Parallels/docker-machine-parallels/v2 v2.0.1
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/blang/semver v3.5.0+incompatible
github.com/c4milo/gotoolkit v0.0.0-20170318115440-bcc06269efa9 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/cenkalti/backoff/v4 v4.1.0
github.com/cheggaaa/pb/v3 v3.0.1
github.com/cloudevents/sdk-go/v2 v2.1.0
github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect
github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57 // indirect
github.com/docker/cli v0.0.0-20200303162255-7d407207c304 // indirect
github.com/docker/docker v1.13.1
github.com/docker/docker v17.12.0-ce-rc1.0.20181225093023-5ddb1d410a8b+incompatible
github.com/docker/go-units v0.4.0
github.com/docker/machine v0.7.1-0.20190902101342-b170508bf44c // v0.16.2^
github.com/docker/machine v0.16.2 // v0.16.2^
github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f
github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect
github.com/evanphx/json-patch v4.5.0+incompatible // indirect
github.com/go-logr/logr v0.3.0 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/google/go-cmp v0.4.1
github.com/google/go-cmp v0.5.2
github.com/google/go-containerregistry v0.0.0-20200601195303-96cf69f03a3c
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-github/v32 v32.1.0
github.com/google/slowjam v0.0.0-20200530021616-df27e642fe7b
github.com/google/uuid v1.1.1
github.com/googleapis/gnostic v0.3.0 // indirect
github.com/hashicorp/go-getter v1.4.0
github.com/hashicorp/go-getter v1.4.2
github.com/hashicorp/go-retryablehttp v0.6.6
github.com/hooklift/assert v0.0.0-20170704181755-9d1defd6d214 // indirect
github.com/hooklift/iso9660 v0.0.0-20170318115843-1cf07e5970d8
@ -71,8 +74,9 @@ require (
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f
github.com/zchee/go-vmnet v0.0.0-20161021174912-97ebf9174097
golang.org/x/build v0.0.0-20190927031335-2835ba2e683f
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6
golang.org/x/mod v0.3.0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
golang.org/x/sys v0.0.0-20200523222454-059865788121
@ -84,7 +88,7 @@ require (
k8s.io/api v0.17.4
k8s.io/apimachinery v0.17.4
k8s.io/client-go v0.17.4
k8s.io/klog/v2 v2.3.0
k8s.io/klog/v2 v2.4.0
k8s.io/kubectl v0.0.0
k8s.io/kubernetes v1.18.5
sigs.k8s.io/sig-storage-lib-external-provisioner v4.0.0+incompatible // indirect
@ -96,7 +100,7 @@ replace (
github.com/docker/docker => github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7
github.com/docker/machine => github.com/machine-drivers/machine v0.7.1-0.20200810185219-7d42fed1b770
github.com/google/go-containerregistry => github.com/afbjorklund/go-containerregistry v0.0.0-20200902152226-fbad78ec2813
github.com/hashicorp/go-getter => github.com/afbjorklund/go-getter v1.4.1-0.20190910175809-eb9f6c26742c
github.com/hashicorp/go-getter => github.com/afbjorklund/go-getter v1.4.1-0.20201020145846-c0da14b4bffe
github.com/samalba/dockerclient => github.com/sayboras/dockerclient v1.0.0
k8s.io/api => k8s.io/api v0.17.3
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.17.3

25
go.sum
View File

@ -51,6 +51,7 @@ github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo
github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible h1:PAHkmPqd/vQV4LJcqzEUM1elCyTMWjbrO8oFMl0dvBE=
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0=
github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0=
@ -102,8 +103,8 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.0/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
github.com/Parallels/docker-machine-parallels v1.3.0 h1:RG1fyf3v1GwXMCeHRiZkB4tL9phFZEv6ixcvRZ1raN8=
github.com/Parallels/docker-machine-parallels v1.3.0/go.mod h1:HCOMm3Hulq/xuEVQMyZOuQlA+dSZpFY5kdCTZWjMVis=
github.com/Parallels/docker-machine-parallels/v2 v2.0.1 h1:3Rj+4tcm/UqMU5g2bLJmpxD0ssn1BB5am4Cd6yUDbVI=
github.com/Parallels/docker-machine-parallels/v2 v2.0.1/go.mod h1:NKwI5KryEmEHMZVj80t9JQcfXWZp4/ZYNBuw4C5sQ9E=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
@ -119,8 +120,8 @@ github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdc
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
github.com/afbjorklund/go-containerregistry v0.0.0-20200902152226-fbad78ec2813 h1:0tskN1ipU/BBrpoEIy0rdZS9jf5+wdP6IMRak8Iu/YE=
github.com/afbjorklund/go-containerregistry v0.0.0-20200902152226-fbad78ec2813/go.mod h1:npTSyywOeILcgWqd+rvtzGWflIPPcBQhYoOONaY4ltM=
github.com/afbjorklund/go-getter v1.4.1-0.20190910175809-eb9f6c26742c h1:18gEt7qzn7CW7qMkfPTFyyotlPbvPQo9o4IDV8jZqP4=
github.com/afbjorklund/go-getter v1.4.1-0.20190910175809-eb9f6c26742c/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY=
github.com/afbjorklund/go-getter v1.4.1-0.20201020145846-c0da14b4bffe h1:TdcuDqk4ArmYI8cbeeL/RM5BPciDOaWpGZoPoT3OziQ=
github.com/afbjorklund/go-getter v1.4.1-0.20201020145846-c0da14b4bffe/go.mod h1:3Ao9Hol5VJsmwJV5BF1GUrONbaOUmA+m1Nj2+0LuMAY=
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
@ -196,6 +197,8 @@ github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oD
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc=
github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
@ -256,6 +259,7 @@ github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfc
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
@ -354,6 +358,8 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs=
github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
@ -516,6 +522,8 @@ github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0=
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
@ -615,6 +623,8 @@ github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PF
github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI=
github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
@ -1113,6 +1123,7 @@ github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lP
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4=
github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
@ -1195,6 +1206,8 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw=
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@ -1640,8 +1653,8 @@ k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUc
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.3.0 h1:WmkrnW7fdrm0/DMClc+HIxtftvxVIPAhlVwMQo5yLco=
k8s.io/klog/v2 v2.3.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ=
k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-aggregator v0.17.3/go.mod h1:1dMwMFQbmH76RKF0614L7dNenMl3dwnUJuOOyZ3GMXA=
k8s.io/kube-controller-manager v0.17.3/go.mod h1:22B/TsgVviuCVuNwUrqgyTi5D4AYjMFaK9c8h1oonkY=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU=

View File

@ -31,7 +31,7 @@ export KUBECONFIG="${TEST_HOME}/kubeconfig"
export PATH=$PATH:"/usr/local/bin/:/usr/local/go/bin/:$GOPATH/bin"
# installing golang so we could do go get for gopogh
sudo ./installers/check_install_golang.sh "1.14.6" "/usr/local" || true
sudo ./installers/check_install_golang.sh "1.15.2" "/usr/local" || true
docker rm -f -v $(docker ps -aq) >/dev/null 2>&1 || true
docker volume prune -f || true
@ -47,7 +47,7 @@ echo "test home: ${TEST_HOME}"
echo "sudo: ${SUDO_PREFIX}"
echo "kernel: $(uname -v)"
echo "uptime: $(uptime)"
# Setting KUBECONFIG prevents the version ceck from erroring out due to permission issues
# Setting KUBECONFIG prevents the version check from erroring out due to permission issues
echo "kubectl: $(env KUBECONFIG=${TEST_HOME} kubectl version --client --short=true)"
echo "docker: $(docker version --format '{{ .Client.Version }}')"
echo "podman: $(sudo podman version --format '{{.Version}}' || true)"

View File

@ -0,0 +1,231 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
The script releases current kic base image as stable, ie:
- strips current version suffix starting from '-' in pkg/drivers/kic/types.go => release version
(eg, 'v0.0.13-snapshot1' -> 'v0.0.13')
- makes sure current kic base image exists locally, tries to pull one if not
- tags current kic base image with the release version, and
- pushes it to all relevant container registries
The script requires following credentials as env variables (injected by Jenkins credential provider):
@GCR (ref: https://cloud.google.com/container-registry/docs/advanced-authentication):
- GCR_USERNAME=<string>: GCR username, eg:
= "oauth2accesstoken" if Access Token is used for GCR_TOKEN, or
= "_json_key" if JSON Key File is used for GCR_TOKEN
- GCR_TOKEN=<string>: GCR JSON token
@Docker (ref: https://docs.docker.com/docker-hub/access-tokens/)
- DOCKER_USERNAME=<string>: Docker username
- DOCKER_TOKEN=<string>: Docker personal access token or password
@GitHub (ref: https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages)
- GITHUB_USERNAME=<string>: GitHub username
- GITHUB_TOKEN=<string>: GitHub [personal] access token
*/
package main
import (
"bytes"
"context"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"regexp"
"strings"
"time"
"k8s.io/klog/v2"
"github.com/pkg/errors"
)
const (
// default context timeout
cxTimeout = 600 * time.Second
)
var (
kicFile = "../../pkg/drivers/kic/types.go"
kicVersionRE = `Version = "(.*)"`
// keep list of registries in sync with those in kicFile
registries = []registry{
{
name: "Google Cloud Container Registry",
image: "gcr.io/k8s-minikube/kicbase",
username: os.Getenv("GCR_USERNAME"),
password: os.Getenv("GCR_TOKEN"),
},
{
name: "Docker Hub Container Registry",
image: "docker.io/kicbase/stable",
username: os.Getenv("DOCKER_USERNAME"),
password: os.Getenv("DOCKER_TOKEN"),
},
{
name: "GitHub Packages Registry",
image: "docker.pkg.github.com/kubernetes/minikube/kicbase",
username: os.Getenv("GITHUB_USERNAME"),
password: os.Getenv("GITHUB_TOKEN"),
},
}
run = func(cmd *exec.Cmd, stdin io.Reader) error {
cmd.Stdin = stdin
var out bytes.Buffer
cmd.Stderr = &out
if err := cmd.Run(); err != nil {
return errors.Errorf("%s: %s", err.Error(), out.String())
}
return nil
}
)
// container registry name, image path, credentials, and updated flag
type registry struct {
name string
image string
username string
password string
updated bool
}
func (r *registry) setUpdated(updated bool) {
r.updated = updated
}
func main() {
ctx, cancel := context.WithTimeout(context.Background(), cxTimeout)
defer cancel()
// write log statements to stderr instead of to files
if err := flag.Set("logtostderr", "true"); err != nil {
fmt.Printf("Error setting 'logtostderr' klog flag: %v", err)
}
flag.Parse()
defer klog.Flush()
// determine current kic base image version
vCurrent, err := getKICVersion()
if err != nil {
klog.Fatalf("failed getting current kic base image version: %v", err)
}
if len(vCurrent) == 0 {
klog.Fatalf("cannot determine current kic base image version")
}
klog.Infof("current kic base image version: %s", vCurrent)
// determine release kic base image version
vRelease := strings.Split(vCurrent, "-")[0]
klog.Infof("release kic base image version: %s", vRelease)
// prepare local kic base image
image, err := prepareImage(ctx, vCurrent, vRelease)
if err != nil {
klog.Fatalf("failed preparing local kic base reference image: %v", err)
}
klog.Infof("local kic base reference image: %s", image)
// update registries
if updated := updateRegistries(ctx, image, vRelease); !updated {
klog.Fatalf("failed updating all registries")
}
}
// updateRegistries tags image with release version, pushes it to registries, and returns if any registry got updated
func updateRegistries(ctx context.Context, image, release string) (updated bool) {
for _, reg := range registries {
login := exec.CommandContext(ctx, "docker", "login", "--username", reg.username, "--password-stdin", reg.image)
if err := run(login, strings.NewReader(reg.password)); err != nil {
klog.Errorf("failed logging in to %s: %v", reg.name, err)
continue
}
klog.Infof("successfully logged in to %s", reg.name)
tag := exec.CommandContext(ctx, "docker", "tag", image+":"+release, reg.image+":"+release)
if err := run(tag, nil); err != nil {
klog.Errorf("failed tagging %s for %s: %v", reg.image+":"+release, reg.name, err)
continue
}
klog.Infof("successfully tagged %s for %s", reg.image+":"+release, reg.name)
push := exec.CommandContext(ctx, "docker", "push", reg.image+":"+release)
if err := run(push, nil); err != nil {
klog.Errorf("failed pushing %s to %s: %v", reg.image+":"+release, reg.name, err)
continue
}
klog.Infof("successfully pushed %s to %s", reg.image+":"+release, reg.name)
reg.setUpdated(true)
klog.Infof("successfully updated %s", reg.name)
updated = true
}
return updated
}
// prepareImage checks if current image exists locally, tries to pull it if not,
// tags it with release version, returns reference image url and any error
func prepareImage(ctx context.Context, current, release string) (image string, err error) {
// check if image exists locally
for _, reg := range registries {
inspect := exec.CommandContext(ctx, "docker", "inspect", reg.image+":"+current, "--format", "{{.Id}}")
if err := run(inspect, nil); err != nil {
continue
}
image = reg.image
break
}
if image == "" {
// try to pull image locally
for _, reg := range registries {
pull := exec.CommandContext(ctx, "docker", "pull", reg.image+":"+current)
if err := run(pull, nil); err != nil {
continue
}
image = reg.image
break
}
}
if image == "" {
return "", errors.Errorf("cannot find current image version tag %s locally nor in any registry", current)
}
// tag current image with release version
tag := exec.CommandContext(ctx, "docker", "tag", image+":"+current, image+":"+release)
if err := run(tag, nil); err != nil {
return "", err
}
return image, nil
}
// getKICVersion returns current kic base image version and any error
func getKICVersion() (string, error) {
blob, err := ioutil.ReadFile(kicFile)
if err != nil {
return "", err
}
re := regexp.MustCompile(kicVersionRE)
ver := re.FindSubmatch(blob)
if ver == nil {
return "", nil
}
return string(ver[1]), nil
}

View File

@ -40,6 +40,7 @@ import (
"text/template"
"time"
"golang.org/x/mod/semver"
"golang.org/x/oauth2"
"github.com/google/go-github/v32/github"
@ -126,9 +127,10 @@ func (p *Patch) apply(data interface{}) (changed bool, err error) {
}
func main() {
klog.InitFlags(nil)
// write log statements to stderr instead of to files
if err := flag.Set("logtostderr", "true"); err != nil {
fmt.Printf("Error setting 'logtostderr' klog flag: %v", err)
fmt.Printf("Error setting 'logtostderr' klog flag: %v\n", err)
}
flag.Parse()
defer klog.Flush()
@ -399,26 +401,19 @@ func ghReleases(ctx context.Context, owner, repo, token string) (stable, latest
}
for _, rl := range rls {
ver := rl.GetName()
if ver == "" {
if !semver.IsValid(ver) {
continue
}
// check if ver version is a release (ie, 'v1.19.2') or a
// pre-release (ie, 'v1.19.3-rc.0' or 'v1.19.0-beta.2') channel ch
// note: github.RepositoryRelease GetPrerelease() bool would be useful for all pre-rels
ch := strings.Split(ver, "-")
if len(ch) == 1 && stable == "" {
stable = ver
} else if len(ch) > 1 && latest == "" {
if strings.HasPrefix(ch[1], "rc") || strings.HasPrefix(ch[1], "beta") {
latest = ver
}
// check if ver version is release (ie, 'v1.19.2') or pre-release (ie, 'v1.19.3-rc.0' or 'v1.19.0-beta.2')
prerls := semver.Prerelease(ver)
if prerls == "" {
stable = semver.Max(ver, stable)
} else if strings.HasPrefix(prerls, "-rc") || strings.HasPrefix(prerls, "-beta") {
latest = semver.Max(ver, latest)
}
if stable != "" && latest != "" {
// make sure that v.Latest >= stable
if latest < stable {
latest = stable
}
return stable, latest, nil
// make sure that latest >= stable
if semver.Compare(latest, stable) == -1 {
latest = stable
}
}
if resp.NextPage == 0 {

53
hack/update/filesystem.go Normal file
View File

@ -0,0 +1,53 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package update
import (
"io/ioutil"
"os"
"path/filepath"
)
// fsUpdate updates local filesystem repo files according to the given schema and data,
// returns if the update actually changed anything, and any error occurred
func fsUpdate(fsRoot string, schema map[string]Item, data interface{}) (changed bool, err error) {
for path, item := range schema {
path = filepath.Join(fsRoot, path)
blob, err := ioutil.ReadFile(path)
if err != nil {
return false, err
}
info, err := os.Stat(path)
if err != nil {
return false, err
}
mode := info.Mode()
item.Content = blob
chg, err := item.apply(data)
if err != nil {
return false, err
}
if chg {
changed = true
}
if err := ioutil.WriteFile(path, item.Content, mode); err != nil {
return false, err
}
}
return changed, nil
}

261
hack/update/github.go Normal file
View File

@ -0,0 +1,261 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package update
import (
"context"
"fmt"
"os"
"strings"
"time"
"golang.org/x/mod/semver"
"golang.org/x/oauth2"
"github.com/google/go-github/v32/github"
"k8s.io/klog/v2"
)
const (
// ghListPerPage uses max value (100) for PerPage to avoid hitting the rate limits
// (ref: https://godoc.org/github.com/google/go-github/github#hdr-Rate_Limiting)
ghListPerPage = 100
// ghSearchLimit limits the number of searched items to be <= N * ListPerPage
ghSearchLimit = 100
)
var (
// GitHub repo data
ghToken = os.Getenv("GITHUB_TOKEN")
ghOwner = "kubernetes"
ghRepo = "minikube"
ghBase = "master" // could be "main" in the future?
)
// ghCreatePR returns PR created in the GitHub owner/repo, applying the changes to the base head
// commit fork, as defined by the schema and data, and also returns any error occurred
// PR branch will be named by the branch, sufixed by '_' and first 7 characters of fork commit SHA
// PR itself will be named by the title and will reference the issue
func ghCreatePR(ctx context.Context, owner, repo, base, branch, title string, issue int, token string, schema map[string]Item, data interface{}) (*github.PullRequest, error) {
ghc := ghClient(ctx, token)
// get base branch
baseBranch, _, err := ghc.Repositories.GetBranch(ctx, owner, repo, base)
if err != nil {
return nil, fmt.Errorf("error getting base branch: %w", err)
}
// get base commit
baseCommit, _, err := ghc.Repositories.GetCommit(ctx, owner, repo, *baseBranch.Commit.SHA)
if err != nil {
return nil, fmt.Errorf("error getting base commit: %w", err)
}
// get base tree
baseTree, _, err := ghc.Git.GetTree(ctx, owner, repo, baseCommit.GetSHA(), true)
if err != nil {
return nil, fmt.Errorf("error getting base tree: %w", err)
}
// update files
changes, err := ghUpdate(ctx, owner, repo, baseTree, token, schema, data)
if err != nil {
return nil, fmt.Errorf("error updating files: %w", err)
}
if changes == nil {
return nil, nil
}
// create fork
fork, resp, err := ghc.Repositories.CreateFork(ctx, owner, repo, nil)
// https://pkg.go.dev/github.com/google/go-github/v32@v32.1.0/github#RepositoriesService.CreateFork
// This method might return an *AcceptedError and a status code of 202. This is because this is
// the status that GitHub returns to signify that it is now computing creating the fork in a
// background task. In this event, the Repository value will be returned, which includes the
// details about the pending fork. A follow up request, after a delay of a second or so, should
// result in a successful request.
if resp.StatusCode == 202 { // *AcceptedError
time.Sleep(time.Second * 5)
} else if err != nil {
return nil, fmt.Errorf("error creating fork: %w", err)
}
// create fork tree from base and changed files
forkTree, _, err := ghc.Git.CreateTree(ctx, *fork.Owner.Login, *fork.Name, *baseTree.SHA, changes)
if err != nil {
return nil, fmt.Errorf("error creating fork tree: %w", err)
}
// create fork commit
forkCommit, _, err := ghc.Git.CreateCommit(ctx, *fork.Owner.Login, *fork.Name, &github.Commit{
Message: github.String(title),
Tree: &github.Tree{SHA: forkTree.SHA},
Parents: []*github.Commit{{SHA: baseCommit.SHA}},
})
if err != nil {
return nil, fmt.Errorf("error creating fork commit: %w", err)
}
klog.Infof("PR commit '%s' created: %s", forkCommit.GetSHA(), forkCommit.GetHTMLURL())
// create PR branch
prBranch := branch + forkCommit.GetSHA()[:7]
prRef, _, err := ghc.Git.CreateRef(ctx, *fork.Owner.Login, *fork.Name, &github.Reference{
Ref: github.String("refs/heads/" + prBranch),
Object: &github.GitObject{
Type: github.String("commit"),
SHA: forkCommit.SHA,
},
})
if err != nil {
return nil, fmt.Errorf("error creating PR branch: %w", err)
}
klog.Infof("PR branch '%s' created: %s", prBranch, prRef.GetURL())
// create PR
plan, err := GetPlan(schema, data)
if err != nil {
klog.Fatalf("Error parsing schema: %v\n%s", err, plan)
}
modifiable := true
pr, _, err := ghc.PullRequests.Create(ctx, owner, repo, &github.NewPullRequest{
Title: github.String(title),
Head: github.String(*fork.Owner.Login + ":" + prBranch),
Base: github.String(base),
Body: github.String(fmt.Sprintf("fixes #%d\n\nAutomatically created PR to update repo according to the Plan:\n\n```\n%s\n```", issue, plan)),
MaintainerCanModify: &modifiable,
})
if err != nil {
return nil, fmt.Errorf("error creating pull request: %w", err)
}
return pr, nil
}
// ghUpdate updates remote GitHub owner/repo tree according to the given token, schema and data,
// returns resulting changes, and any error occurred
func ghUpdate(ctx context.Context, owner, repo string, tree *github.Tree, token string, schema map[string]Item, data interface{}) (changes []*github.TreeEntry, err error) {
ghc := ghClient(ctx, token)
// load each schema item content and update it creating new GitHub TreeEntries
cnt := len(schema) // expected number of files to change
for _, org := range tree.Entries {
if *org.Type == "blob" {
if item, match := schema[*org.Path]; match {
blob, _, err := ghc.Git.GetBlobRaw(ctx, owner, repo, *org.SHA)
if err != nil {
return nil, fmt.Errorf("error getting file: %w", err)
}
item.Content = blob
changed, err := item.apply(data)
if err != nil {
return nil, fmt.Errorf("error updating file: %w", err)
}
if changed {
// add github.TreeEntry that will replace original path content with updated one
changes = append(changes, &github.TreeEntry{
Path: org.Path,
Mode: org.Mode,
Type: org.Type,
Content: github.String(string(item.Content)),
})
}
if cnt--; cnt == 0 {
break
}
}
}
}
if cnt != 0 {
return nil, fmt.Errorf("error finding all the files (%d missing) - check the Plan: %w", cnt, err)
}
return changes, nil
}
// ghFindPR returns URL of the PR if found in the given GitHub ower/repo base and any error occurred
func ghFindPR(ctx context.Context, title, owner, repo, base, token string) (url string, err error) {
ghc := ghClient(ctx, token)
// walk through the paginated list of all pull requests, from latest to older releases
opts := &github.PullRequestListOptions{State: "all", Base: base, ListOptions: github.ListOptions{PerPage: ghListPerPage}}
for (opts.Page+1)*ghListPerPage <= ghSearchLimit {
prs, resp, err := ghc.PullRequests.List(ctx, owner, repo, opts)
if err != nil {
return "", err
}
for _, pr := range prs {
if pr.GetTitle() == title {
return pr.GetHTMLURL(), nil
}
}
if resp.NextPage == 0 {
break
}
opts.Page = resp.NextPage
}
return "", nil
}
// ghClient returns GitHub Client with a given context and optional token for authenticated requests
func ghClient(ctx context.Context, token string) *github.Client {
if token == "" {
return github.NewClient(nil)
}
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: token},
)
tc := oauth2.NewClient(ctx, ts)
return github.NewClient(tc)
}
// GHVersions returns greatest current stable release and greatest latest rc or beta pre-release
// from GitHub owner/repo repository, and any error;
// if latest pre-release version is lower than current stable release, then it
// will return current stable release for both
func GHVersions(ctx context.Context, owner, repo string) (stable, latest string, err error) {
ghc := ghClient(ctx, ghToken)
// walk through the paginated list of all owner/repo releases, from newest to oldest
opts := &github.ListOptions{PerPage: ghListPerPage}
for {
rls, resp, err := ghc.Repositories.ListReleases(ctx, owner, repo, opts)
if err != nil {
return "", "", err
}
for _, rl := range rls {
ver := rl.GetName()
if !semver.IsValid(ver) {
continue
}
// check if ver version is release (ie, 'v1.19.2') or pre-release (ie, 'v1.19.3-rc.0' or 'v1.19.0-beta.2')
prerls := semver.Prerelease(ver)
if prerls == "" {
stable = semver.Max(ver, stable)
} else if strings.HasPrefix(prerls, "-rc") || strings.HasPrefix(prerls, "-beta") {
latest = semver.Max(ver, latest)
}
// make sure that latest >= stable
if semver.Compare(latest, stable) == -1 {
latest = stable
}
}
if resp.NextPage == 0 {
break
}
opts.Page = resp.NextPage
}
return stable, latest, nil
}

View File

@ -0,0 +1,133 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Script expects the following env variables:
- UPDATE_TARGET=<string>: optional - if unset/absent, default option is "fs"; valid options are:
- "fs" - update only local filesystem repo files [default]
- "gh" - update only remote GitHub repo files and create PR (if one does not exist already)
- "all" - update local and remote repo files and create PR (if one does not exist already)
- GITHUB_TOKEN=<string>: GitHub [personal] access token
- note: GITHUB_TOKEN is required if UPDATE_TARGET is "gh" or "all"
*/
package main
import (
"context"
"io/ioutil"
"net/http"
"strings"
"time"
"k8s.io/klog/v2"
"k8s.io/minikube/hack/update"
)
const (
// default context timeout
cxTimeout = 300 * time.Second
)
var (
schema = map[string]update.Item{
".github/workflows/iso.yml": {
Replace: map[string]string{
`go-version: '.*`: `go-version: '{{.StableVersion}}'`,
},
},
".github/workflows/kic_image.yml": {
Replace: map[string]string{
`go-version: '.*`: `go-version: '{{.StableVersion}}'`,
},
},
".github/workflows/master.yml": {
Replace: map[string]string{
`go-version: '.*`: `go-version: '{{.StableVersion}}'`,
},
},
".github/workflows/pr.yml": {
Replace: map[string]string{
`go-version: '.*`: `go-version: '{{.StableVersion}}'`,
},
},
".travis.yml": {
Replace: map[string]string{
`go:\n - .*`: `go:{{printf "\n - %s" .StableVersion}}`,
`go: .*`: `go: {{.StableVersion}}`,
},
},
"go.mod": {
Replace: map[string]string{
`(?m)^go .*`: `go {{.StableVersionMM}}`,
},
},
"hack/jenkins/common.sh": {
Replace: map[string]string{
`sudo \.\/installers\/check_install_golang\.sh \".*\" \"\/usr\/local\"`: `sudo ./installers/check_install_golang.sh "{{.StableVersion}}" "/usr/local"`,
},
},
"Makefile": {
Replace: map[string]string{
`GO_VERSION \?= .*`: `GO_VERSION ?= {{.StableVersion}}`,
},
},
}
// PR data
prBranchPrefix = "update-golang-version_" // will be appended with first 7 characters of the PR commit SHA
prTitle = `update_golang_version: {stable: "{{.StableVersion}}"}`
prIssue = 9264
)
// Data holds stable Golang version - in full and in <major>.<minor> format
type Data struct {
StableVersion string `json:"stableVersion"`
StableVersionMM string `json:"stableVersionMM"` // go.mod wants go version in <major>.<minor> format
}
func main() {
// set a context with defined timeout
ctx, cancel := context.WithTimeout(context.Background(), cxTimeout)
defer cancel()
// get Golang stable version
stable, stableMM, err := goVersions()
if err != nil || stable == "" || stableMM == "" {
klog.Fatalf("Unable to get Golang stable version: %v", err)
}
data := Data{StableVersion: stable, StableVersionMM: stableMM}
klog.Infof("Golang stable version: %s", data.StableVersion)
update.Apply(ctx, schema, data, prBranchPrefix, prTitle, prIssue)
}
// goVersion returns Golang stable version.
func goVersions() (stable, stableMM string, err error) {
resp, err := http.Get("https://golang.org/VERSION?m=text")
if err != nil {
return "", "", err
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", "", err
}
stable = strings.TrimPrefix(string(body), "go")
mmp := strings.SplitN(stable, ".", 3)
stableMM = strings.Join(mmp[0:2], ".") // <major>.<minor> version
return stable, stableMM, nil
}

View File

@ -0,0 +1,148 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Script promotes current KIC base image as stable, ie:
- strips current version suffix starting from '-' in pkg/drivers/kic/types.go => release version
(eg, 'v0.0.13-snapshot1' -> 'v0.0.13')
- makes sure current KIC base image exists locally, tries to pull one if not
- tags current KIC base image with the release version, and
- pushes it to all relevant container registries
Script expects the following env variables:
- UPDATE_TARGET=<string>: optional - if unset/absent, default option is "fs"; valid options are:
- "fs" - update only local filesystem repo files [default]
- "gh" - update only remote GitHub repo files and create PR (if one does not exist already)
- "all" - update local and remote repo files and create PR (if one does not exist already)
Script also requires following credentials as env variables (injected by Jenkins credential provider):
@GCR (ref: https://cloud.google.com/container-registry/docs/advanced-authentication):
- GCR_USERNAME=<string>: GCR username, eg:
= "oauth2accesstoken" if Access Token is used for GCR_TOKEN, or
= "_json_key" if JSON Key File is used for GCR_TOKEN
- GCR_TOKEN=<string>: GCR JSON token
@Docker (ref: https://docs.docker.com/docker-hub/access-tokens/)
- DOCKER_USERNAME=<string>: Docker username
- DOCKER_TOKEN=<string>: Docker personal access token or password
@GitHub (ref: https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages)
- GITHUB_USERNAME=<string>: GitHub username
- GITHUB_TOKEN=<string>: GitHub [personal] access token
*/
package main
import (
"context"
"io/ioutil"
"path/filepath"
"regexp"
"strings"
"time"
"k8s.io/klog/v2"
"k8s.io/minikube/hack/update"
)
const (
// default context timeout
cxTimeout = 600 * time.Second
)
var (
kicFile = "pkg/drivers/kic/types.go"
versionRE = `Version = "(.*)"`
schema = map[string]update.Item{
kicFile: {
Replace: map[string]string{
`Version = ".*"`: `Version = "{{.StableVersion}}"`,
},
},
}
// pull request data
prBranchPrefix = "update-kicbase-version_" // will be appended with first 7 characters of the PR commit SHA
prTitle = `update-kicbase-version: {"{{.StableVersion}}"}`
prIssue = 9420
)
// Data holds current and stable KIC Base image versions
type Data struct {
CurrentVersion string `json:"CurrentVersion"`
StableVersion string `json:"StableVersion"`
}
func main() {
// set a context with defined timeout
ctx, cancel := context.WithTimeout(context.Background(), cxTimeout)
defer cancel()
// determine current and stable kic base image versions
current, stable, err := KICVersions()
if err != nil {
klog.Fatalf("failed getting kic base image versions: %v", err)
}
if len(current) == 0 || len(stable) == 0 {
klog.Fatalf("cannot determine kic base image versions")
}
data := Data{CurrentVersion: current, StableVersion: stable}
klog.Infof("kic base image versions: 'current' is %s and 'stable' would be %s", data.CurrentVersion, data.StableVersion)
// prepare local kic base image
image, err := prepareImage(ctx, data)
if err != nil {
klog.Fatalf("failed preparing local kic base reference image: %v", err)
}
klog.Infof("local kic base reference image: %s", image)
// update registries
if updated := update.CRUpdateAll(ctx, image, data.StableVersion); !updated {
klog.Fatalf("failed updating all registries")
}
update.Apply(ctx, schema, data, prBranchPrefix, prTitle, prIssue)
}
// KICVersions returns current and stable kic base image versions and any error
func KICVersions() (current, stable string, err error) {
blob, err := ioutil.ReadFile(filepath.Join(update.FSRoot, kicFile))
if err != nil {
return "", "", err
}
re := regexp.MustCompile(versionRE)
ver := re.FindSubmatch(blob)
if ver == nil {
return "", "", nil
}
current = string(ver[1])
stable = strings.Split(current, "-")[0]
return current, stable, nil
}
// prepareImage checks if current image exists locally, tries to pull it if not,
// tags it with release version, returns reference image url and any error
func prepareImage(ctx context.Context, data Data) (image string, err error) {
image, err = update.PullImage(ctx, data.CurrentVersion, data.StableVersion)
if err != nil {
return "", err
}
if err := update.TagImage(ctx, image, data.CurrentVersion, data.StableVersion); err != nil {
return "", err
}
return image, nil
}

View File

@ -0,0 +1,84 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Script expects the following env variables:
- UPDATE_TARGET=<string>: optional - if unset/absent, default option is "fs"; valid options are:
- "fs" - update only local filesystem repo files [default]
- "gh" - update only remote GitHub repo files and create PR (if one does not exist already)
- "all" - update local and remote repo files and create PR (if one does not exist already)
- GITHUB_TOKEN=<string>: GitHub [personal] access token
- note: GITHUB_TOKEN is required if UPDATE_TARGET is "gh" or "all"
*/
package main
import (
"context"
"time"
"k8s.io/klog/v2"
"k8s.io/minikube/hack/update"
)
const (
// default context timeout
cxTimeout = 300 * time.Second
)
var (
schema = map[string]update.Item{
"pkg/minikube/constants/constants.go": {
Replace: map[string]string{
`DefaultKubernetesVersion = ".*`: `DefaultKubernetesVersion = "{{.StableVersion}}"`,
`NewestKubernetesVersion = ".*`: `NewestKubernetesVersion = "{{.LatestVersion}}"`,
},
},
"site/content/en/docs/commands/start.md": {
Replace: map[string]string{
`'stable' for .*,`: `'stable' for {{.StableVersion}},`,
`'latest' for .*\)`: `'latest' for {{.LatestVersion}})`,
},
},
}
// pull request data
prBranchPrefix = "update-kubernetes-version_" // will be appended with first 7 characters of the PR commit SHA
prTitle = `update_kubernetes_version: {stable:"{{.StableVersion}}", latest:"{{.LatestVersion}}"}`
prIssue = 4392
)
// Data holds stable and latest Kubernetes versions
type Data struct {
StableVersion string `json:"StableVersion"`
LatestVersion string `json:"LatestVersion"`
}
func main() {
// set a context with defined timeout
ctx, cancel := context.WithTimeout(context.Background(), cxTimeout)
defer cancel()
// get Kubernetes versions from GitHub Releases
stable, latest, err := update.GHVersions(ctx, "kubernetes", "kubernetes")
if err != nil || stable == "" || latest == "" {
klog.Fatalf("Error getting Kubernetes versions: %v", err)
}
data := Data{StableVersion: stable, LatestVersion: latest}
klog.Infof("Kubernetes versions: 'stable' is %s and 'latest' is %s", data.StableVersion, data.LatestVersion)
update.Apply(ctx, schema, data, prBranchPrefix, prTitle, prIssue)
}

134
hack/update/registry.go Normal file
View File

@ -0,0 +1,134 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package update
import (
"context"
"fmt"
"os"
"os/exec"
"strings"
"time"
"k8s.io/klog/v2"
)
var (
// keep list of registries in sync with those in "pkg/drivers/kic/types.go"
registries = []registry{
{
name: "Google Cloud Container Registry",
image: "gcr.io/k8s-minikube/kicbase",
username: os.Getenv("GCR_USERNAME"),
password: os.Getenv("GCR_TOKEN"),
},
{
name: "Docker Hub Container Registry",
image: "docker.io/kicbase/stable",
username: os.Getenv("DOCKER_USERNAME"),
password: os.Getenv("DOCKER_TOKEN"),
},
{
name: "GitHub Packages Registry",
image: "docker.pkg.github.com/kubernetes/minikube/kicbase",
username: os.Getenv("GITHUB_USERNAME"),
password: os.Getenv("GITHUB_TOKEN"),
},
}
)
// container registry name, image path, credentials, and updated flag
type registry struct {
name string
image string
username string
password string
}
// crUpdate tags image with version, pushes it to container registry, and returns any error
func crUpdate(ctx context.Context, reg registry, image, version string) error {
login := exec.CommandContext(ctx, "docker", "login", "--username", reg.username, "--password-stdin", reg.image)
if err := RunWithRetryNotify(ctx, login, strings.NewReader(reg.password), 1*time.Minute, 10); err != nil {
return fmt.Errorf("failed logging in to %s: %w", reg.name, err)
}
klog.Infof("successfully logged in to %s", reg.name)
tag := exec.CommandContext(ctx, "docker", "tag", image+":"+version, reg.image+":"+version)
if err := RunWithRetryNotify(ctx, tag, nil, 1*time.Minute, 10); err != nil {
return fmt.Errorf("failed tagging %s for %s: %w", reg.image+":"+version, reg.name, err)
}
klog.Infof("successfully tagged %s for %s", reg.image+":"+version, reg.name)
push := exec.CommandContext(ctx, "docker", "push", reg.image+":"+version)
if err := RunWithRetryNotify(ctx, push, nil, 2*time.Minute, 10); err != nil {
return fmt.Errorf("failed pushing %s to %s: %w", reg.image+":"+version, reg.name, err)
}
klog.Infof("successfully pushed %s to %s", reg.image+":"+version, reg.name)
return nil
}
// CRUpdateAll calls crUpdate for each available registry, and returns if at least one got updated
func CRUpdateAll(ctx context.Context, image, version string) (updated bool) {
for _, reg := range registries {
if err := crUpdate(ctx, reg, image, version); err != nil {
klog.Errorf("failed updating %s", reg.name)
continue
}
klog.Infof("successfully updated %s", reg.name)
updated = true
}
return updated
}
// PullImage checks if current image exists locally, tries to pull it if not, and
// returns reference image url and any error
func PullImage(ctx context.Context, current, release string) (image string, err error) {
// check if image exists locally
for _, reg := range registries {
inspect := exec.CommandContext(ctx, "docker", "inspect", reg.image+":"+current, "--format", "{{.Id}}")
if err := RunWithRetryNotify(ctx, inspect, nil, 1*time.Second, 10); err != nil {
continue
}
image = reg.image
break
}
if image == "" {
// try to pull image locally
for _, reg := range registries {
pull := exec.CommandContext(ctx, "docker", "pull", reg.image+":"+current)
if err := RunWithRetryNotify(ctx, pull, nil, 2*time.Minute, 10); err != nil {
continue
}
image = reg.image
break
}
}
if image == "" {
return "", fmt.Errorf("cannot find current image version tag %s locally nor in any registry", current)
}
return image, nil
}
// TagImage tags local image:current with stable version, and returns any error
func TagImage(ctx context.Context, image, current, stable string) error {
tag := exec.CommandContext(ctx, "docker", "tag", image+":"+current, image+":"+stable)
if err := RunWithRetryNotify(ctx, tag, nil, 1*time.Second, 10); err != nil {
return err
}
return nil
}

213
hack/update/update.go Normal file
View File

@ -0,0 +1,213 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Script expects the following env variables:
- UPDATE_TARGET=<string>: optional - if unset/absent, default option is "fs"; valid options are:
- "fs" - update only local filesystem repo files [default]
- "gh" - update only remote GitHub repo files and create PR (if one does not exist already)
- "all" - update local and remote repo files and create PR (if one does not exist already)
- GITHUB_TOKEN=<string>: GitHub [personal] access token
- note: GITHUB_TOKEN is required if UPDATE_TARGET is "gh" or "all"
*/
package update
import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
"io"
"os"
"os/exec"
"regexp"
"text/template"
"time"
"k8s.io/klog/v2"
"github.com/cenkalti/backoff/v4"
)
const (
// FSRoot is relative (to scripts in subfolders) root folder of local filesystem repo to update
FSRoot = "../../../"
)
var (
target = os.Getenv("UPDATE_TARGET")
)
// init klog and check general requirements
func init() {
klog.InitFlags(nil)
// write log statements to stderr instead of to files
if err := flag.Set("logtostderr", "true"); err != nil {
fmt.Printf("Error setting 'logtostderr' klog flag: %v\n", err)
}
flag.Parse()
defer klog.Flush()
if target == "" {
target = "fs"
} else if target != "fs" && target != "gh" && target != "all" {
klog.Fatalf("Invalid UPDATE_TARGET option: '%s'; Valid options are: unset/absent (defaults to 'fs'), 'fs', 'gh', or 'all'", target)
} else if (target == "gh" || target == "all") && ghToken == "" {
klog.Fatalf("GITHUB_TOKEN is required if UPDATE_TARGET is 'gh' or 'all'")
}
}
// Item defines Content where all occurrences of each Replace map key, corresponding to
// GitHub TreeEntry.Path and/or local filesystem repo file path (prefixed with FSRoot),
// would be swapped with its respective actual map value (having placeholders replaced with data),
// creating a concrete update plan.
// Replace map keys can use RegExp and map values can use Golang Text Template
type Item struct {
Content []byte `json:"-"`
Replace map[string]string `json:"replace"`
}
// apply updates Item Content by replacing all occurrences of Replace map's keys
// with their actual map values (with placeholders replaced with data))
func (i *Item) apply(data interface{}) (changed bool, err error) {
if i.Content == nil || i.Replace == nil {
return false, fmt.Errorf("want something, got nothing to update")
}
org := string(i.Content)
str := org
for src, dst := range i.Replace {
tmpl := template.Must(template.New("").Parse(dst))
buf := new(bytes.Buffer)
if err := tmpl.Execute(buf, data); err != nil {
return false, err
}
re := regexp.MustCompile(src)
str = re.ReplaceAllString(str, buf.String())
}
i.Content = []byte(str)
return str != org, nil
}
// Apply applies concrete update plan (schema + data) to GitHub or local filesystem repo
func Apply(ctx context.Context, schema map[string]Item, data interface{}, prBranchPrefix, prTitle string, prIssue int) {
plan, err := GetPlan(schema, data)
if err != nil {
klog.Fatalf("Error parsing schema: %v\n%s", err, plan)
}
klog.Infof("The Plan:\n%s", plan)
if target == "fs" || target == "all" {
changed, err := fsUpdate(FSRoot, schema, data)
if err != nil {
klog.Errorf("Error updating local repo: %v", err)
} else if !changed {
klog.Infof("Local repo update skipped: nothing changed")
} else {
klog.Infof("Local repo updated")
}
}
if target == "gh" || target == "all" {
// update prTitle replacing template placeholders with actual data values
tmpl := template.Must(template.New("prTitle").Parse(prTitle))
buf := new(bytes.Buffer)
if err := tmpl.Execute(buf, data); err != nil {
klog.Fatalf("Error parsing PR Title: %v", err)
}
prTitle = buf.String()
// check if PR already exists
prURL, err := ghFindPR(ctx, prTitle, ghOwner, ghRepo, ghBase, ghToken)
if err != nil {
klog.Errorf("Error checking if PR already exists: %v", err)
} else if prURL != "" {
klog.Infof("PR create skipped: already exists (%s)", prURL)
} else {
// create PR
pr, err := ghCreatePR(ctx, ghOwner, ghRepo, ghBase, prBranchPrefix, prTitle, prIssue, ghToken, schema, data)
if err != nil {
klog.Fatalf("Error creating PR: %v", err)
} else if pr == nil {
klog.Infof("PR create skipped: nothing changed")
} else {
klog.Infof("PR created: %s", *pr.HTMLURL)
}
}
}
}
// GetPlan returns concrete plan replacing placeholders in schema with actual data values,
// returns JSON-formatted representation of the plan and any error
func GetPlan(schema map[string]Item, data interface{}) (prettyprint string, err error) {
for _, item := range schema {
for src, dst := range item.Replace {
tmpl := template.Must(template.New("").Parse(dst))
buf := new(bytes.Buffer)
if err := tmpl.Execute(buf, data); err != nil {
return fmt.Sprintf("%+v", schema), err
}
item.Replace[src] = buf.String()
}
}
str, err := json.MarshalIndent(schema, "", " ")
if err != nil {
return fmt.Sprintf("%+v", schema), err
}
return string(str), nil
}
// RunWithRetryNotify runs command cmd with stdin using exponential backoff for maxTime duration
// up to maxRetries (negative values will make it ignored),
// notifies about any intermediary errors and return any final error.
// similar to pkg/util/retry/retry.go:Expo(), just for commands with params and also with context
func RunWithRetryNotify(ctx context.Context, cmd *exec.Cmd, stdin io.Reader, maxTime time.Duration, maxRetries uint64) error {
be := backoff.NewExponentialBackOff()
be.Multiplier = 2
be.MaxElapsedTime = maxTime
bm := backoff.WithMaxRetries(be, maxRetries)
bc := backoff.WithContext(bm, ctx)
notify := func(err error, wait time.Duration) {
klog.Errorf("Temporary error running '%s' (will retry in %s): %v", cmd.String(), wait, err)
}
if err := backoff.RetryNotify(func() error {
cmd.Stdin = stdin
var stderr bytes.Buffer
cmd.Stderr = &stderr
if err := cmd.Run(); err != nil {
time.Sleep(be.NextBackOff().Round(1 * time.Second))
return fmt.Errorf("%w: %s", err, stderr.String())
}
return nil
}, bc, notify); err != nil {
return err
}
return nil
}
// Run runs command cmd with stdin
func Run(cmd *exec.Cmd, stdin io.Reader) error {
cmd.Stdin = stdin
var out bytes.Buffer
cmd.Stderr = &out
if err := cmd.Run(); err != nil {
return fmt.Errorf("%w: %s", err, out.String())
}
return nil
}

View File

@ -353,9 +353,10 @@ func verifyAddonStatusInternal(cc *config.ClusterConfig, name string, val string
return errors.Wrapf(err, "get kube-client to validate %s addon: %v", name, err)
}
err = kapi.WaitForPods(client, ns, label, time.Minute*3)
// This timeout includes image pull time, which can take a few minutes. 3 is not enough.
err = kapi.WaitForPods(client, ns, label, time.Minute*6)
if err != nil {
return errors.Wrapf(err, "verifying %s addon pods : %v", name, err)
return errors.Wrapf(err, "waiting for %s pods", label)
}
}

View File

@ -43,3 +43,36 @@ func TestIsAddonValid(t *testing.T) {
})
}
}
func TestContains(t *testing.T) {
tests := []struct {
slice []string
str string
expected bool
}{
{
slice: []string{},
str: "test",
expected: false,
},
{
slice: []string{"test", "test1"},
str: "test1",
expected: true,
},
{
slice: []string{"test", "test1"},
str: "test2",
expected: false,
},
}
for _, test := range tests {
t.Run(test.str, func(t *testing.T) {
actual := contains(test.slice, test.str)
if test.expected != actual {
t.Fatalf("slice: %v\nstr: %v\nexpected: %v\nactual:%v\n", test.slice, test.str, test.expected, actual)
}
})
}
}

View File

@ -35,16 +35,16 @@ import (
func RoutableHostIPFromInside(ociBin string, clusterName string, containerName string) (net.IP, error) {
if ociBin == Docker {
if runtime.GOOS == "linux" {
_, gateway, err := dockerNetworkInspect(clusterName)
info, err := dockerNetworkInspect(clusterName)
if err != nil {
if errors.Is(err, ErrNetworkNotFound) {
klog.Infof("The container %s is not attached to a network, this could be because the cluster was created by minikube <v1.14, will try to get the IP using container gatway", containerName)
return containerGatewayIP(Docker, containerName)
}
return gateway, errors.Wrap(err, "network inspect")
return info.gateway, errors.Wrap(err, "network inspect")
}
return gateway, nil
return info.gateway, nil
}
// for windows and mac, the gateway ip is not routable so we use dns trick.
return digDNS(ociBin, containerName, "host.docker.internal")

View File

@ -22,6 +22,7 @@ import (
"fmt"
"net"
"os/exec"
"strconv"
"strings"
"github.com/pkg/errors"
@ -36,6 +37,9 @@ const firstSubnetAddr = "192.168.49.0"
// big enough for a cluster of 254 nodes
const defaultSubnetMask = 24
// name of the default Docker bridge network, used to lookup the MTU (see #9528)
const dockerDefaultBridge = "bridge"
// CreateNetwork creates a network returns gateway and error, minikube creates one network per cluster
func CreateNetwork(ociBin string, name string) (net.IP, error) {
if ociBin != Docker {
@ -46,20 +50,26 @@ func CreateNetwork(ociBin string, name string) (net.IP, error) {
func createDockerNetwork(clusterName string) (net.IP, error) {
// check if the network already exists
subnet, gateway, err := dockerNetworkInspect(clusterName)
info, err := dockerNetworkInspect(clusterName)
if err == nil {
klog.Infof("Found existing network with subnet %s and gateway %s.", subnet, gateway)
return gateway, nil
klog.Infof("Found existing network %+v", info)
return info.gateway, nil
}
// will try to get MTU from the docker network to avoid issue with systems with exotic MTU settings.
// related issue #9528
info, err = dockerNetworkInspect(dockerDefaultBridge)
if err != nil {
klog.Warningf("failed to get mtu information from the docker's default network %q: %v", dockerDefaultBridge, err)
}
attempts := 0
subnetAddr := firstSubnetAddr
// Rather than iterate through all of the valid subnets, give up at 20 to avoid a lengthy user delay for something that is unlikely to work.
// will be like 192.168.49.0/24 ,...,192.168.239.0/24
for attempts < 20 {
gateway, err = tryCreateDockerNetwork(subnetAddr, defaultSubnetMask, clusterName)
info.gateway, err = tryCreateDockerNetwork(subnetAddr, defaultSubnetMask, info.mtu, clusterName)
if err == nil {
return gateway, nil
return info.gateway, nil
}
// don't retry if error is not adddress is taken
@ -77,15 +87,33 @@ func createDockerNetwork(clusterName string) (net.IP, error) {
newSubnet[2] += byte(9 + attempts)
subnetAddr = newSubnet.String()
}
return gateway, fmt.Errorf("failed to create network after 20 attempts")
return info.gateway, fmt.Errorf("failed to create network after 20 attempts")
}
func tryCreateDockerNetwork(subnetAddr string, subnetMask int, name string) (net.IP, error) {
func tryCreateDockerNetwork(subnetAddr string, subnetMask int, mtu int, name string) (net.IP, error) {
gateway := net.ParseIP(subnetAddr)
gateway.To4()[3]++ // first ip for gateway
klog.Infof("attempt to create network %s/%d with subnet: %s and gateway %s...", subnetAddr, subnetMask, name, gateway)
// options documentation https://docs.docker.com/engine/reference/commandline/network_create/#bridge-driver-options
rr, err := runCmd(exec.Command(Docker, "network", "create", "--driver=bridge", fmt.Sprintf("--subnet=%s", fmt.Sprintf("%s/%d", subnetAddr, subnetMask)), fmt.Sprintf("--gateway=%s", gateway), "-o", "--ip-masq", "-o", "--icc", fmt.Sprintf("--label=%s=%s", CreatedByLabelKey, "true"), name))
klog.Infof("attempt to create network %s/%d with subnet: %s and gateway %s and MTU of %d ...", subnetAddr, subnetMask, name, gateway, mtu)
args := []string{
"network",
"create",
"--driver=bridge",
fmt.Sprintf("--subnet=%s", fmt.Sprintf("%s/%d", subnetAddr, subnetMask)),
fmt.Sprintf("--gateway=%s", gateway),
// options documentation https://docs.docker.com/engine/reference/commandline/network_create/#bridge-driver-options
"-o", "--ip-masq",
"-o", "--icc",
fmt.Sprintf("--label=%s=%s", CreatedByLabelKey, "true"),
name,
}
// adding MTU option because #9528
if mtu > 0 {
args = append(args, "-o")
args = append(args, fmt.Sprintf("com.docker.network.driver.mtu=%d", mtu))
}
rr, err := runCmd(exec.Command(Docker, args...))
if err != nil {
// Pool overlaps with other one on this address space
if strings.Contains(rr.Output(), "Pool overlaps") {
@ -99,32 +127,50 @@ func tryCreateDockerNetwork(subnetAddr string, subnetMask int, name string) (net
return gateway, nil
}
// returns subnet and gate if exists
func dockerNetworkInspect(name string) (*net.IPNet, net.IP, error) {
cmd := exec.Command(Docker, "network", "inspect", name, "--format", "{{(index .IPAM.Config 0).Subnet}},{{(index .IPAM.Config 0).Gateway}}")
// netInfo holds part of a docker or podman network information relevant to kic drivers
type netInfo struct {
name string
subnet *net.IPNet
gateway net.IP
mtu int
}
// if exists returns subnet, gateway and mtu
func dockerNetworkInspect(name string) (netInfo, error) {
var info = netInfo{name: name}
cmd := exec.Command(Docker, "network", "inspect", name, "--format", `{{(index .IPAM.Config 0).Subnet}},{{(index .IPAM.Config 0).Gateway}},{{(index .Options "com.docker.network.driver.mtu")}}`)
rr, err := runCmd(cmd)
if err != nil {
logDockerNetworkInspect(name)
if strings.Contains(rr.Output(), "No such network") {
return nil, nil, ErrNetworkNotFound
return info, ErrNetworkNotFound
}
return nil, nil, err
}
// results looks like 172.17.0.0/16,172.17.0.1
ips := strings.Split(strings.TrimSpace(rr.Stdout.String()), ",")
if len(ips) == 0 {
return nil, nil, fmt.Errorf("empty IP list parsed from: %q", rr.Output())
return info, err
}
_, subnet, err := net.ParseCIDR(ips[0])
// results looks like 172.17.0.0/16,172.17.0.1,1500
vals := strings.Split(strings.TrimSpace(rr.Stdout.String()), ",")
if len(vals) == 0 {
return info, fmt.Errorf("empty list network inspect: %q", rr.Output())
}
if len(vals) > 0 {
info.gateway = net.ParseIP(vals[1])
mtu, err := strconv.Atoi(vals[2])
if err != nil {
klog.Warningf("couldn't parse mtu for docker network %q: %v", name, err)
} else {
info.mtu = mtu
}
}
_, info.subnet, err = net.ParseCIDR(vals[0])
if err != nil {
return nil, nil, errors.Wrapf(err, "parse subnet for %s", name)
return info, errors.Wrapf(err, "parse subnet for %s", name)
}
var gateway net.IP
if len(ips) > 0 {
gateway = net.ParseIP(ips[1])
}
return subnet, gateway, nil
return info, nil
}
func logDockerNetworkInspect(name string) {
@ -157,7 +203,7 @@ func RemoveNetwork(name string) error {
}
func networkExists(name string) bool {
_, _, err := dockerNetworkInspect(name)
_, err := dockerNetworkInspect(name)
if err != nil && !errors.Is(err, ErrNetworkNotFound) { // log unexpected error
klog.Warningf("Error inspecting docker network %s: %v", name, err)
}

View File

@ -24,9 +24,9 @@ import (
const (
// Version is the current version of kic
Version = "v0.0.13"
Version = "v0.0.14-snapshot"
// SHA of the kic base image
baseImageSHA = "4d43acbd0050148d4bc399931f1b15253b5e73815b63a67b8ab4a5c9e523403f"
baseImageSHA = "1e303d96e9d72371235cb28ed77f9b3ba67fb4966085202238e635f1d80181f8"
)
var (

View File

@ -142,7 +142,7 @@ func (d *Driver) GetState() (state.State, error) {
return state.Running, nil
}
return kverify.KubeletStatus(d.exec), nil
return kverify.ServiceStatus(d.exec, "kubelet"), nil
}
// Kill stops a host forcefully, including any containers that we are managing.

View File

@ -1,29 +0,0 @@
/*
Copyright 2019 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package initflag
import (
"flag"
)
func init() {
// Workaround for "ERROR: logging before flag.Parse"
// See: https://github.com/kubernetes/kubernetes/issues/17162
fs := flag.NewFlagSet("", flag.ContinueOnError)
_ = fs.Parse([]string{})
flag.CommandLine = fs
}

View File

@ -35,6 +35,8 @@ const (
AppsRunningKey = "apps_running"
// NodeReadyKey is the name used in the flags for waiting for the node status to be ready
NodeReadyKey = "node_ready"
// NodeReadyKey is the name used in the flags for waiting for the node status to be ready
KubeletKey = "kubelet"
)
// vars related to the --wait flag
@ -42,13 +44,13 @@ var (
// DefaultComponents is map of the the default components to wait for
DefaultComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true}
// NoWaitComponents is map of componets to wait for if specified 'none' or 'false'
NoComponents = map[string]bool{APIServerWaitKey: false, SystemPodsWaitKey: false, DefaultSAWaitKey: false, AppsRunningKey: false, NodeReadyKey: false}
NoComponents = map[string]bool{APIServerWaitKey: false, SystemPodsWaitKey: false, DefaultSAWaitKey: false, AppsRunningKey: false, NodeReadyKey: false, KubeletKey: false}
// AllComponents is map for waiting for all components.
AllComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true, DefaultSAWaitKey: true, AppsRunningKey: true}
AllComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true, DefaultSAWaitKey: true, AppsRunningKey: true, KubeletKey: true}
// DefaultWaitList is list of all default components to wait for. only names to be used for start flags.
DefaultWaitList = []string{APIServerWaitKey, SystemPodsWaitKey}
// AllComponentsList list of all valid components keys to wait for. only names to be used used for start flags.
AllComponentsList = []string{APIServerWaitKey, SystemPodsWaitKey, DefaultSAWaitKey, AppsRunningKey, NodeReadyKey}
AllComponentsList = []string{APIServerWaitKey, SystemPodsWaitKey, DefaultSAWaitKey, AppsRunningKey, NodeReadyKey, KubeletKey}
// AppsRunningList running list are valid k8s-app components to wait for them to be running
AppsRunningList = []string{
"kube-dns", // coredns

View File

@ -22,7 +22,6 @@ import (
"strings"
"time"
"github.com/docker/machine/libmachine/state"
"github.com/pkg/errors"
core "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -34,7 +33,6 @@ import (
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/cruntime"
"k8s.io/minikube/pkg/minikube/logs"
"k8s.io/minikube/pkg/minikube/sysinit"
"k8s.io/minikube/pkg/util/retry"
)
@ -155,13 +153,3 @@ func announceProblems(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg conf
time.Sleep(kconst.APICallRetryInterval * 15)
}
}
// KubeletStatus checks the kubelet status
func KubeletStatus(cr command.Runner) state.State {
klog.Infof("Checking kubelet status ...")
active := sysinit.New(cr).Active("kubelet")
if active {
return state.Running
}
return state.Stopped
}

View File

@ -0,0 +1,60 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package kverify verifies a running Kubernetes cluster is healthy
package kverify
import (
"fmt"
"time"
"github.com/docker/machine/libmachine/state"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/command"
"k8s.io/minikube/pkg/minikube/sysinit"
"k8s.io/minikube/pkg/util/retry"
)
// ServiceStatus checks the status of a systemd or init.d service
func ServiceStatus(cr command.Runner, svc string) state.State {
active := sysinit.New(cr).Active(svc)
if active {
return state.Running
}
return state.Stopped
}
// WaitForService will wait for a "systemd" or "init.d" service to be running on the node...
// not to be confused with Kubernetes Services
func WaitForService(cr command.Runner, svc string, timeout time.Duration) error {
pStart := time.Now()
klog.Infof("waiting for %s service to be running ....", svc)
kr := func() error {
if st := ServiceStatus(cr, svc); st != state.Running {
return fmt.Errorf("status %s", st)
}
return nil
}
if err := retry.Local(kr, timeout); err != nil {
return fmt.Errorf("not running: %s", err)
}
klog.Infof("duration metric: took %s WaitForService to wait for %s.", time.Since(pStart), svc)
return nil
}

View File

@ -145,7 +145,7 @@ func storageProvisioner(mirror string) string {
// dashboardFrontend returns the image used for the dashboard frontend
func dashboardFrontend(repo string) string {
if repo == "" {
repo = "kubernetesui"
repo = "docker.io/kubernetesui"
}
// See 'kubernetes-dashboard' in deploy/addons/dashboard/dashboard-dp.yaml
return path.Join(repo, "dashboard:v2.0.3")
@ -154,7 +154,7 @@ func dashboardFrontend(repo string) string {
// dashboardMetrics returns the image used for the dashboard metrics scraper
func dashboardMetrics(repo string) string {
if repo == "" {
repo = "kubernetesui"
repo = "docker.io/kubernetesui"
}
// See 'dashboard-metrics-scraper' in deploy/addons/dashboard/dashboard-dp.yaml
return path.Join(repo, "metrics-scraper:v1.0.4")

View File

@ -25,8 +25,8 @@ import (
func TestAuxiliary(t *testing.T) {
want := []string{
"gcr.io/k8s-minikube/storage-provisioner:v3",
"kubernetesui/dashboard:v2.0.3",
"kubernetesui/metrics-scraper:v1.0.4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}
got := auxiliary("")
if diff := cmp.Diff(want, got); diff != "" {

View File

@ -38,8 +38,8 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/etcd:3.4.3-0",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"kubernetesui/dashboard:v2.0.3",
"kubernetesui/metrics-scraper:v1.0.4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
{"v1.16.1", "mirror.k8s.io", []string{
"mirror.k8s.io/kube-proxy:v1.16.1",
@ -62,8 +62,8 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/etcd:3.3.10",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"kubernetesui/dashboard:v2.0.3",
"kubernetesui/metrics-scraper:v1.0.4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
{"v1.14.0", "", []string{
"k8s.gcr.io/kube-proxy:v1.14.0",
@ -74,8 +74,8 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/etcd:3.3.10",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"kubernetesui/dashboard:v2.0.3",
"kubernetesui/metrics-scraper:v1.0.4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
{"v1.13.0", "", []string{
"k8s.gcr.io/kube-proxy:v1.13.0",
@ -86,8 +86,8 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/etcd:3.2.24",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"kubernetesui/dashboard:v2.0.3",
"kubernetesui/metrics-scraper:v1.0.4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
{"v1.12.0", "", []string{
"k8s.gcr.io/kube-proxy:v1.12.0",
@ -98,8 +98,8 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/etcd:3.2.24",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"kubernetesui/dashboard:v2.0.3",
"kubernetesui/metrics-scraper:v1.0.4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
}
for _, tc := range tests {

View File

@ -392,10 +392,13 @@ func (k *Bootstrapper) client(ip string, port int) (*kubernetes.Clientset, error
// WaitForNode blocks until the node appears to be healthy
func (k *Bootstrapper) WaitForNode(cfg config.ClusterConfig, n config.Node, timeout time.Duration) error {
start := time.Now()
register.Reg.SetStep(register.VerifyingKubernetes)
out.T(style.HealthCheck, "Verifying Kubernetes components...")
// regardless if waiting is set or not, we will make sure kubelet is not stopped
// to solve corner cases when a container is hibernated and once coming back kubelet not running.
if err := k.ensureServiceStarted("kubelet"); err != nil {
klog.Warningf("Couldn't ensure kubelet is started this might cause issues: %v", err)
}
// TODO: #7706: for better performance we could use k.client inside minikube to avoid asking for external IP:PORT
cp, err := config.PrimaryControlPlane(&cfg)
if err != nil {
@ -455,6 +458,12 @@ func (k *Bootstrapper) WaitForNode(cfg config.ClusterConfig, n config.Node, time
}
}
}
if cfg.VerifyComponents[kverify.KubeletKey] {
if err := kverify.WaitForService(k.c, "kubelet", timeout); err != nil {
return errors.Wrap(err, "waiting for kubelet")
}
}
if cfg.VerifyComponents[kverify.NodeReadyKey] {
if err := kverify.WaitForNodeReady(client, timeout); err != nil {
@ -471,6 +480,15 @@ func (k *Bootstrapper) WaitForNode(cfg config.ClusterConfig, n config.Node, time
return nil
}
// ensureKubeletStarted will start a systemd or init.d service if it is not running.
func (k *Bootstrapper) ensureServiceStarted(svc string) error {
if st := kverify.ServiceStatus(k.c, svc); st != state.Running {
klog.Warningf("surprisingly %q service status was %s!. will try to start it, could be related to this issue https://github.com/kubernetes/minikube/issues/9458", svc, st)
return sysinit.New(k.c).Start(svc)
}
return nil
}
// needsReconfigure returns whether or not the cluster needs to be reconfigured
func (k *Bootstrapper) needsReconfigure(conf string, hostname string, port int, client *kubernetes.Clientset, version string) bool {
if rr, err := k.c.RunCmd(exec.Command("sudo", "diff", "-u", conf, conf+".new")); err != nil {
@ -655,18 +673,17 @@ func (k *Bootstrapper) JoinCluster(cc config.ClusterConfig, n config.Node, joinC
klog.Infof("kubeadm reset failed, continuing anyway: %v", err)
}
out, err := k.c.RunCmd(exec.Command("/bin/bash", "-c", joinCmd))
_, err = k.c.RunCmd(exec.Command("/bin/bash", "-c", joinCmd))
if err != nil {
if strings.Contains(err.Error(), "status \"Ready\" already exists in the cluster") {
klog.Infof("Node %s already joined the cluster, skip failure.", n.Name)
} else {
return errors.Wrapf(err, "cmd failed: %s\n%+v\n", joinCmd, out.Output())
klog.Info("still waiting for the worker node to register with the api server")
}
return errors.Wrapf(err, "kubeadm join")
}
return nil
}
if err := retry.Expo(join, 10*time.Second, 1*time.Minute); err != nil {
if err := retry.Expo(join, 10*time.Second, 3*time.Minute); err != nil {
return errors.Wrap(err, "joining cp")
}

View File

@ -651,7 +651,14 @@ func (c Flannel) Apply(r Runner) error {
if driver.IsKIC(c.cc.Driver) {
conflict := "/etc/cni/net.d/100-crio-bridge.conf"
_, err := r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict))))
_, err := r.RunCmd(exec.Command("stat", conflict))
if err != nil {
klog.Warningf("%s not found, skipping disable step: %v", conflict, err)
return nil
}
_, err = r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict))))
if err != nil {
klog.Errorf("unable to disable %s: %v", conflict, err)
}

View File

@ -204,7 +204,7 @@ func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile,
if err != nil {
return nil, nil, err
}
// try to get profiles list based on all contrainers created by docker driver
// try to get profiles list based on all containers created by docker driver
cs, err := oci.ListOwnedContainers(oci.Docker)
if err == nil {
pDirs = append(pDirs, cs...)

View File

@ -26,7 +26,7 @@ import (
// Profile represents a minikube profile
type Profile struct {
Name string
Status string // running, stopped
Status string // running, stopped, paused, unknown
Config *ClusterConfig
}
@ -78,6 +78,7 @@ type ClusterConfig struct {
type KubernetesConfig struct {
KubernetesVersion string
ClusterName string
Namespace string
APIServerName string
APIServerNames []string
APIServerIPs []net.IP

View File

@ -68,6 +68,10 @@ const (
MinikubeActiveDockerdEnv = "MINIKUBE_ACTIVE_DOCKERD"
// PodmanVarlinkBridgeEnv is used for podman settings
PodmanVarlinkBridgeEnv = "PODMAN_VARLINK_BRIDGE"
// PodmanContainerHostEnv is used for podman settings
PodmanContainerHostEnv = "CONTAINER_HOST"
// PodmanContainerSSHKeyEnv is used for podman settings
PodmanContainerSSHKeyEnv = "CONTAINER_SSHKEY"
// MinikubeActivePodmanEnv holds the podman service that the user's shell is pointing at
// value would be profile or empty if pointing to the user's host.
MinikubeActivePodmanEnv = "MINIKUBE_ACTIVE_PODMAN"

View File

@ -30,6 +30,7 @@ import (
"github.com/pkg/errors"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/download"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/minikube/style"
@ -55,13 +56,12 @@ func InstallOrUpdate(name string, directory string, v semver.Version, interactiv
defer releaser.Release()
exists := driverExists(executable)
path, err := validateDriver(executable, v)
path, err := validateDriver(executable, minAcceptableDriverVersion(name, v))
if !exists || (err != nil && autoUpdate) {
klog.Warningf("%s: %v", executable, err)
path = filepath.Join(directory, executable)
derr := download.Driver(executable, path, v)
if derr != nil {
return derr
if err := download.Driver(executable, path, v); err != nil {
return err
}
}
return fixDriverPermissions(name, path, interactive)
@ -133,6 +133,8 @@ func validateDriver(executable string, v semver.Version) (string, error) {
if err != nil {
return path, errors.Wrap(err, "can't parse driver version")
}
klog.Infof("%s version is %s", path, driverVersion)
if driverVersion.LT(v) {
return path, fmt.Errorf("%s is version %s, want %s", executable, driverVersion, v)
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package driver
import (
"github.com/blang/semver"
"k8s.io/klog/v2"
)
// minHyperkitVersion is the minimum version of the minikube hyperkit driver compatible with the current minikube code
var minHyperkitVersion *semver.Version
const minHyperkitVersionStr = "1.11.0"
func init() {
v, err := semver.New(minHyperkitVersionStr)
if err != nil {
klog.Errorf("Failed to parse the hyperkit driver version: %v", err)
} else {
minHyperkitVersion = v
}
}
// minAcceptableDriverVersion is the minimum version of driver supported by current version of minikube
func minAcceptableDriverVersion(driver string, mkVer semver.Version) semver.Version {
switch driver {
case HyperKit:
if minHyperkitVersion != nil {
return *minHyperkitVersion
}
return mkVer
case KVM2:
return mkVer
default:
klog.Warningf("Unexpected driver: %v", driver)
return mkVer
}
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package driver
import (
"testing"
"github.com/blang/semver"
)
func Test_minDriverVersion(t *testing.T) {
tests := []struct {
desc string
driver string
mkV string
want semver.Version
}{
{"Hyperkit", HyperKit, "1.1.1", *minHyperkitVersion},
{"Invalid", "_invalid_", "1.1.1", v("1.1.1")},
{"KVM2", KVM2, "1.1.1", v("1.1.1")},
}
for _, tt := range tests {
t.Run(tt.desc, func(t *testing.T) {
if got := minAcceptableDriverVersion(tt.driver, v(tt.mkV)); !got.EQ(tt.want) {
t.Errorf("Invalid min supported version, got: %v, want: %v", got, tt.want)
}
})
}
}
func v(s string) semver.Version {
r, err := semver.New(s)
if err != nil {
panic(err)
}
return *r
}

View File

@ -29,10 +29,6 @@ import (
"strconv"
"strings"
// initflag must be imported before any other minikube pkg.
// Fix for https://github.com/kubernetes/minikube/issues/4866
_ "k8s.io/minikube/pkg/initflag"
"github.com/golang-collections/collections/stack"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/util/lock"

View File

@ -33,6 +33,9 @@ type Settings struct {
// The name of the cluster for this context
ClusterName string
// The name of the namespace for this context
Namespace string
// ClusterServerAddress is the address of the Kubernetes cluster
ClusterServerAddress string
@ -104,6 +107,7 @@ func PopulateFromSettings(cfg *Settings, apiCfg *api.Config) error {
contextName := cfg.ClusterName
context := api.NewContext()
context.Cluster = cfg.ClusterName
context.Namespace = cfg.Namespace
context.AuthInfo = userName
apiCfg.Contexts[contextName] = context

View File

@ -42,14 +42,14 @@ func CreateSSHShell(api libmachine.API, cc config.ClusterConfig, n config.Node,
return errors.Errorf("%q is not running", machineName)
}
client, err := host.CreateSSHClient()
if native {
ssh.SetDefaultClient(ssh.Native)
} else {
ssh.SetDefaultClient(ssh.External)
}
client, err := host.CreateSSHClient()
if err != nil {
return errors.Wrap(err, "Creating ssh client")
}

View File

@ -80,6 +80,7 @@ func trySSHPowerOff(h *host.Host) error {
return nil
}
register.Reg.SetStep(register.PowerOff)
out.T(style.Shutdown, `Powering off "{{.profile_name}}" via SSH ...`, out.V{"profile_name": h.Name})
// differnet for kic because RunSSHCommand is not implemented by kic
if driver.IsKIC(h.DriverName) {

View File

@ -72,7 +72,7 @@ func Partial(name string, miniHome ...string) (libmachine.API, *config.ClusterCo
cc, err := config.Load(name, miniHome...)
if err != nil {
if config.IsNotExist(err) {
out.T(style.Shrug, `There is no local cluster named "{{.cluster}}"`, out.V{"cluster": name})
out.T(style.Shrug, `Profile "{{.cluster}}" not found. Run "minikube profile list" to view all profiles.`, out.V{"cluster": name})
exitTip("start", name, reason.ExGuestNotFound)
}
exit.Error(reason.HostConfigLoad, "Error getting cluster config", err)
@ -174,6 +174,6 @@ func ExampleCmd(cname string, action string) string {
// exitTip returns an action tip and exits
func exitTip(action string, profile string, code int) {
command := ExampleCmd(profile, action)
out.T(style.Workaround, `To fix this, run: "{{.command}}"`, out.V{"command": command})
out.T(style.Workaround, `To start a cluster, run: "{{.command}}"`, out.V{"command": command})
os.Exit(code)
}

View File

@ -133,6 +133,9 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) {
return nil, errors.Wrap(err, "setting up certs")
}
if err := bs.UpdateNode(*starter.Cfg, *starter.Node, cr); err != nil {
return nil, errors.Wrap(err, "update node")
}
}
var wg sync.WaitGroup
@ -167,10 +170,6 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) {
prepareNone()
}
} else {
if err := bs.UpdateNode(*starter.Cfg, *starter.Node, cr); err != nil {
return nil, errors.Wrap(err, "update node")
}
// Make sure to use the command runner for the control plane to generate the join token
cpBs, cpr, err := cluster.ControlPlaneBootstrapper(starter.MachineAPI, starter.Cfg, viper.GetString(cmdcfg.Bootstrapper))
if err != nil {
@ -196,7 +195,7 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) {
}
}
klog.Infof("Will wait %s for node ...", waitTimeout)
klog.Infof("Will wait %s for node up to ", viper.GetDuration(waitTimeout))
if err := bs.WaitForNode(*starter.Cfg, *starter.Node, viper.GetDuration(waitTimeout)); err != nil {
return nil, errors.Wrapf(err, "wait %s for node", viper.GetDuration(waitTimeout))
}
@ -319,6 +318,7 @@ func setupKubeconfig(h *host.Host, cc *config.ClusterConfig, n *config.Node, clu
}
kcs := &kubeconfig.Settings{
ClusterName: clusterName,
Namespace: cc.KubernetesConfig.Namespace,
ClusterServerAddress: addr,
ClientCertificate: localpath.ClientCert(cc.Name),
ClientKey: localpath.ClientKey(cc.Name),

View File

@ -39,6 +39,7 @@ const (
Done RegStep = "Done"
Stopping RegStep = "Stopping"
PowerOff RegStep = "PowerOff"
Deleting RegStep = "Deleting"
Pausing RegStep = "Pausing"
Unpausing RegStep = "Unpausing"
@ -78,7 +79,7 @@ func init() {
Done,
},
Stopping: {Stopping, Done},
Stopping: {Stopping, PowerOff, Done},
Pausing: {Pausing, Done},
Unpausing: {Unpausing, Done},
Deleting: {Deleting, Stopping, Deleting, Done},
@ -126,5 +127,3 @@ func (r *Register) SetStep(s RegStep) {
r.current = s
}
// recordStep records the current step

View File

@ -38,8 +38,8 @@ func TestTimeCommandLogs(t *testing.T) {
if !ok {
t.Fatalf("expected log %s but didn't find it", log)
}
// Let's give a little wiggle room so we don't fail if time is 3 and actualTime is 2.999
if actualTime < time && time-actualTime > 0.001 {
// Let's give a little wiggle room so we don't fail if time is 3 and actualTime is 2.99...
if actualTime < time && time-actualTime > 0.01 {
t.Fatalf("expected log \"%s\" to take more time than it actually did. got %v, expected > %v", log, actualTime, time)
}
}

View File

@ -176,7 +176,7 @@ func SetDockerEnv() []string {
}
if isLocalProxy(u.Host) {
out.WarningT("Not passing {{.name}}={{.value}} to docker env.", out.V{"name": k, "value": v})
out.WarningT("Local proxy ignored: not passing {{.name}}={{.value}} to docker env.", out.V{"name": k, "value": v})
continue
}
}

View File

@ -22,7 +22,7 @@ import (
"fmt"
"os/exec"
parallels "github.com/Parallels/docker-machine-parallels"
parallels "github.com/Parallels/docker-machine-parallels/v2"
"github.com/docker/machine/libmachine/drivers"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/download"
@ -55,9 +55,9 @@ func configure(cfg config.ClusterConfig, n config.Node) (interface{}, error) {
}
func status() registry.State {
_, err := exec.LookPath("docker-machine-driver-parallels")
_, err := exec.LookPath("prlctl")
if err != nil {
return registry.State{Error: err, Fix: "Install docker-machine-driver-parallels", Doc: "https://minikube.sigs.k8s.io/docs/reference/drivers/parallels/"}
return registry.State{Error: err, Fix: "Install Parallels Desktop for Mac", Doc: "https://minikube.sigs.k8s.io/docs/drivers/parallels/"}
}
return registry.State{Installed: true, Healthy: true, Running: true}
return registry.State{Installed: true, Healthy: true}
}

View File

@ -104,7 +104,8 @@ func DetermineLocale() {
// setPreferredLanguageTag configures which language future messages should use.
func setPreferredLanguageTag(l language.Tag) {
klog.Infof("Setting Language to %s ...", l)
// output message only if verbosity level is set and we still haven't got all the flags parsed in main()
klog.V(1).Infof("Setting Language to %s ...", l)
preferredLanguage = l
}

View File

@ -11,7 +11,7 @@ minikube quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows
![Screenshot](/images/screenshot.png)
🎉 Latest Release: *v1.13.0* - September 3, 2020 ([changelog](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md))
🎉 Latest Release: *v1.14.2* - October 27, 2020 ([changelog](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md))
## Highlights

View File

@ -17,23 +17,19 @@ addons modifies minikube addons files using subcommands like "minikube addons en
minikube addons SUBCOMMAND [flags]
```
### Options
```
-h, --help help for addons
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -54,23 +50,19 @@ Configures the addon w/ADDON_NAME within minikube (example: minikube addons conf
minikube addons configure ADDON_NAME [flags]
```
### Options
```
-h, --help help for configure
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -91,23 +83,19 @@ Disables the addon w/ADDON_NAME within minikube (example: minikube addons disabl
minikube addons disable ADDON_NAME [flags]
```
### Options
```
-h, --help help for disable
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -128,23 +116,19 @@ Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable
minikube addons enable ADDON_NAME [flags]
```
### Options
```
-h, --help help for enable
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -166,23 +150,19 @@ Simply type addons help [path to command] for full details.
minikube addons help [command] [flags]
```
### Options
```
-h, --help help for help
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -206,7 +186,6 @@ minikube addons list [flags]
### Options
```
-h, --help help for list
-o, --output string minikube addons list --output OUTPUT. json, list (default "list")
```
@ -216,11 +195,13 @@ minikube addons list [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -245,7 +226,6 @@ minikube addons open ADDON_NAME [flags]
```
--format string Format to output addons URL in. This format will be applied to each url individually and they will be printed one at a time. (default "http://{{.IP}}:{{.Port}}")
-h, --help help for open
--https Open the addons URL with https instead of http
--interval int The time interval for each check that wait performs in seconds (default 1)
--url Display the Kubernetes addons URL in the CLI instead of opening it in the default browser
@ -258,11 +238,13 @@ minikube addons open ADDON_NAME [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -13,23 +13,19 @@ Add, delete, or push a local image into minikube
Add, delete, or push a local image into minikube
### Options
```
-h, --help help for cache
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -50,23 +46,19 @@ Add an image to local cache.
minikube cache add [flags]
```
### Options
```
-h, --help help for add
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -87,23 +79,19 @@ Delete an image from the local cache.
minikube cache delete [flags]
```
### Options
```
-h, --help help for delete
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -125,23 +113,19 @@ Simply type cache help [path to command] for full details.
minikube cache help [command] [flags]
```
### Options
```
-h, --help help for help
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -167,7 +151,6 @@ minikube cache list [flags]
```
--format string Go template format string for the cache list output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#CacheListTemplate (default "{{.CacheImage}}\n")
-h, --help help for list
```
### Options inherited from parent commands
@ -176,11 +159,13 @@ minikube cache list [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -201,23 +186,19 @@ reloads images previously added using the 'cache add' subcommand
minikube cache reload [flags]
```
### Options
```
-h, --help help for reload
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -38,23 +38,19 @@ Outputs minikube shell completion for the given shell (bash, zsh or fish)
minikube completion SHELL [flags]
```
### Options
```
-h, --help help for completion
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -47,23 +47,19 @@ Configurable fields:
minikube config SUBCOMMAND [flags]
```
### Options
```
-h, --help help for config
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -90,7 +86,6 @@ minikube config defaults PROPERTY_NAME [flags]
### Options
```
-h, --help help for defaults
--output string Output format. Accepted values: [json]
```
@ -100,11 +95,13 @@ minikube config defaults PROPERTY_NAME [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -125,23 +122,19 @@ Returns the value of PROPERTY_NAME from the minikube config file. Can be overwr
minikube config get PROPERTY_NAME [flags]
```
### Options
```
-h, --help help for get
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -163,23 +156,19 @@ Simply type config help [path to command] for full details.
minikube config help [command] [flags]
```
### Options
```
-h, --help help for help
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -201,23 +190,19 @@ Sets the PROPERTY_NAME config value to PROPERTY_VALUE
minikube config set PROPERTY_NAME PROPERTY_VALUE [flags]
```
### Options
```
-h, --help help for set
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -238,23 +223,19 @@ unsets PROPERTY_NAME from the minikube config file. Can be overwritten by flags
minikube config unset PROPERTY_NAME [flags]
```
### Options
```
-h, --help help for unset
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -280,7 +261,6 @@ minikube config view [flags]
```
--format string Go template format string for the config view output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd/config#ConfigViewTemplate (default "- {{.ConfigKey}}: {{.ConfigValue}}\n")
-h, --help help for view
```
### Options inherited from parent commands
@ -289,11 +269,13 @@ minikube config view [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -20,8 +20,7 @@ minikube dashboard [flags]
### Options
```
-h, --help help for dashboard
--url Display dashboard URL instead of opening a browser
--url Display dashboard URL instead of opening a browser
```
### Options inherited from parent commands
@ -30,11 +29,13 @@ minikube dashboard [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -22,7 +22,6 @@ minikube delete [flags]
```
--all Set flag to delete all profiles
-h, --help help for delete
--purge Set this flag to delete the '.minikube' folder from your user directory.
```
@ -32,11 +31,13 @@ minikube delete [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -20,7 +20,6 @@ minikube docker-env [flags]
### Options
```
-h, --help help for docker-env
--no-proxy Add machine IP to NO_PROXY environment variable
--shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect
-u, --unset Unset variables instead of setting them
@ -32,11 +31,13 @@ minikube docker-env [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -18,23 +18,19 @@ Simply type minikube help [path to command] for full details.
minikube help [command] [flags]
```
### Options
```
-h, --help help for help
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -17,23 +17,19 @@ Retrieves the IP address of the running cluster, and writes it to STDOUT.
minikube ip [flags]
```
### Options
```
-h, --help help for ip
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -21,23 +21,19 @@ minikube kubectl -- get pods --namespace kube-system
minikube kubectl [flags]
```
### Options
```
-h, --help help for kubectl
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -21,7 +21,6 @@ minikube logs [flags]
```
-f, --follow Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.
-h, --help help for logs
-n, --length int Number of lines back to go within the log (default 60)
--node string The node to get logs from. Defaults to the primary control plane.
--problems Show only log entries which point to known problems
@ -33,11 +32,13 @@ minikube logs [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -22,7 +22,6 @@ minikube mount [flags] <source directory>:<target directory>
```
--9p-version string Specify the 9p version that the mount should use (default "9p2000.L")
--gid string Default group id used for the mount (default "docker")
-h, --help help for mount
--ip string Specify the ip that the mount should be setup on
--kill Kill the mount process spawned by minikube start
--mode uint File permissions used for the mount (default 493)
@ -38,11 +37,13 @@ minikube mount [flags] <source directory>:<target directory>
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -17,23 +17,19 @@ Operations on nodes
minikube node [flags]
```
### Options
```
-h, --help help for node
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -59,7 +55,6 @@ minikube node add [flags]
```
--control-plane If true, the node added will also be a control plane in addition to a worker.
--delete-on-failure If set, delete the current cluster if start fails and try again. Defaults to false.
-h, --help help for add
--worker If true, the added node will be marked for work. Defaults to true. (default true)
```
@ -69,11 +64,13 @@ minikube node add [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -94,23 +91,19 @@ Deletes a node from a cluster.
minikube node delete [flags]
```
### Options
```
-h, --help help for delete
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -132,23 +125,19 @@ Simply type node help [path to command] for full details.
minikube node help [command] [flags]
```
### Options
```
-h, --help help for help
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -169,23 +158,19 @@ List existing minikube nodes.
minikube node list [flags]
```
### Options
```
-h, --help help for list
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -210,7 +195,6 @@ minikube node start [flags]
```
--delete-on-failure If set, delete the current cluster if start fails and try again. Defaults to false.
-h, --help help for start
```
### Options inherited from parent commands
@ -219,11 +203,13 @@ minikube node start [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
@ -244,23 +230,19 @@ Stops a node in a cluster.
minikube node stop [flags]
```
### Options
```
-h, --help help for stop
```
### Options inherited from parent commands
```
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -22,7 +22,7 @@ minikube pause [flags]
```
-n, ----namespaces strings namespaces to pause (default [kube-system,kubernetes-dashboard,storage-gluster,istio-operator])
-A, --all-namespaces If set, pause all namespaces
-h, --help help for pause
-o, --output string Format to print stdout in. Options include: [text,json] (default "text")
```
### Options inherited from parent commands
@ -31,11 +31,13 @@ minikube pause [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

View File

@ -20,7 +20,6 @@ minikube podman-env [flags]
### Options
```
-h, --help help for podman-env
--shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect
-u, --unset Unset variables instead of setting them
```
@ -31,11 +30,13 @@ minikube podman-env [flags]
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files

Some files were not shown because too many files have changed in this diff Show More