Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kubernetes/minikube into …
Browse files Browse the repository at this point in the history
…storage-provisioner-as-pod
  • Loading branch information
Author Name committed Oct 30, 2017
2 parents 9eb7c1d + bb9b7b1 commit eaac53f
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 53 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Minikube Release Notes

# Version 0.23.0 - 10/26/2017
* Upgraded to go 1.9 [#2113](https://github.com/kubernetes/minikube/pull/2113)
* Localkube is no longer packaged in minikube bin-data [#2089](https://github.com/kubernetes/minikube/pull/2089)
* Upgraded to Kubernetes 1.8 [#2088](https://github.com/kubernetes/minikube/pull/2088)
* Added more verbose logging to minikube start [#2078](https://github.com/kubernetes/minikube/pull/2078)
* Added CoreDNS as an Addon
* Updated Ingress Addon to v0.9.0-beta.15
* Updated Dashboard to v1.7.0
* Force the none driver to use netgo [#2074](https://github.com/kubernetes/minikube/pull/2074)
* [kvm driver] Driver now returns state.Running for DOM_SHUTDOWN [#2109](https://github.com/kubernetes/minikube/pull/2109)
* [localkube] Added support for CRI-O
* [kubeadm] Added support for CRI-O [#2052](https://github.com/kubernetes/minikube/pull/2052)
* [kubeadm] Added support for feature gates [#2037](https://github.com/kubernetes/minikube/pull/2037)
* [Minikube ISO] Bumped to version v0.23.6 [#2091](https://github.com/kubernetes/minikube/pull/2091)
* [Minikube ISO] Upgraded to Docker 17.05-ce [#1542](https://github.com/kubernetes/minikube/pull/1542)
* [Minikube ISO] Upgraded to CRI-O v1.0.0 [#2069](https://github.com/kubernetes/minikube/pull/2069)

# Version 0.22.3 - 10/3/2017
* Update dnsmasq to 1.14.5 [2022](https://github.com/kubernetes/minikube/pull/2022)
* Windows cache path fix [2000](https://github.com/kubernetes/minikube/pull/2000)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

# Bump these on release
VERSION_MAJOR ?= 0
VERSION_MINOR ?= 22
VERSION_BUILD ?= 3
VERSION_MINOR ?= 23
VERSION_BUILD ?= 0
VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
DEB_VERSION ?= $(VERSION_MAJOR).$(VERSION_MINOR)-$(VERSION_BUILD)
INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
Expand Down
37 changes: 28 additions & 9 deletions cmd/minikube/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,34 @@ type Status struct {
KubeconfigStatus string
}

const internalErrorCode = -1

const (
minikubeNotRunningStatusFlag = 1 << 0
clusterNotRunningStatusFlag = 1 << 1
k8sNotRunningStatusFlag = 1 << 2
)

// statusCmd represents the status command
var statusCmd = &cobra.Command{
Use: "status",
Short: "Gets the status of a local kubernetes cluster",
Long: `Gets the status of a local kubernetes cluster.`,
Long: `Gets the status of a local kubernetes cluster.
Exit status contains the status of minikube's VM, cluster and kubernetes encoded on it's bits in this order from right to left.
Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for kubernetes NOK)`,
Run: func(cmd *cobra.Command, args []string) {
var returnCode = 0
api, err := machine.NewAPIClient()
if err != nil {
fmt.Fprintf(os.Stderr, "Error getting client: %s\n", err)
os.Exit(1)
os.Exit(internalErrorCode)
}
defer api.Close()

ms, err := cluster.GetHostStatus(api)
if err != nil {
glog.Errorln("Error getting machine status:", err)
cmdUtil.MaybeReportErrorAndExit(err)
cmdUtil.MaybeReportErrorAndExitWithCode(err, internalErrorCode)
}

cs := state.None.String()
Expand All @@ -67,43 +78,51 @@ var statusCmd = &cobra.Command{
clusterBootstrapper, err := GetClusterBootstrapper(api, viper.GetString(cmdcfg.Bootstrapper))
if err != nil {
glog.Errorf("Error getting cluster bootstrapper: %s", err)
cmdUtil.MaybeReportErrorAndExit(err)
cmdUtil.MaybeReportErrorAndExitWithCode(err, internalErrorCode)
}
cs, err = clusterBootstrapper.GetClusterStatus()
if err != nil {
glog.Errorln("Error cluster status:", err)
cmdUtil.MaybeReportErrorAndExit(err)
cmdUtil.MaybeReportErrorAndExitWithCode(err, internalErrorCode)
} else if cs != state.Running.String() {
returnCode |= clusterNotRunningStatusFlag
}

ip, err := cluster.GetHostDriverIP(api)
if err != nil {
glog.Errorln("Error host driver ip status:", err)
cmdUtil.MaybeReportErrorAndExit(err)
cmdUtil.MaybeReportErrorAndExitWithCode(err, internalErrorCode)
}
kstatus, err := kubeconfig.GetKubeConfigStatus(ip, cmdUtil.GetKubeConfigPath(), config.GetMachineName())
if err != nil {
glog.Errorln("Error kubeconfig status:", err)
cmdUtil.MaybeReportErrorAndExit(err)
cmdUtil.MaybeReportErrorAndExitWithCode(err, internalErrorCode)
}
if kstatus {
ks = "Correctly Configured: pointing to minikube-vm at " + ip.String()
} else {
ks = "Misconfigured: pointing to stale minikube-vm." +
"\nTo fix the kubectl context, run minikube update-context"
returnCode |= k8sNotRunningStatusFlag
}
} else {
returnCode |= minikubeNotRunningStatusFlag
}

status := Status{ms, cs, ks}

tmpl, err := template.New("status").Parse(statusFormat)
if err != nil {
glog.Errorln("Error creating status template:", err)
os.Exit(1)
os.Exit(internalErrorCode)
}
err = tmpl.Execute(os.Stdout, status)
if err != nil {
glog.Errorln("Error executing status template:", err)
os.Exit(1)
os.Exit(internalErrorCode)
}

os.Exit(returnCode)
},
}

Expand Down
6 changes: 5 additions & 1 deletion cmd/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ func UploadError(b []byte, url string) error {
}

func MaybeReportErrorAndExit(errToReport error) {
MaybeReportErrorAndExitWithCode(errToReport, 1)
}

func MaybeReportErrorAndExitWithCode(errToReport error, returnCode int) {
var err error
if viper.GetBool(config.WantReportError) {
err = ReportError(errToReport, constants.ReportingURL)
Expand All @@ -146,7 +150,7 @@ To opt out of these messages, run the command:
if err != nil {
glog.Errorf(err.Error())
}
os.Exit(1)
os.Exit(returnCode)
}

func getInput(input chan string, r io.Reader) {
Expand Down
1 change: 0 additions & 1 deletion deploy/addons/storage-provisioner/storage-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ metadata:
labels:
integration-test: storage-provisioner
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/minikube-addons: storage-provisioner
spec:
hostNetwork: true
containers:
Expand Down
8 changes: 8 additions & 0 deletions deploy/minikube/releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"name": "v0.23.0",
"checksums": {
"darwin": "3d0c5581cd14f85637fb888c1e2e124152c4c9643a257ba90c8cd929d2c2b8b3",
"linux": "cd9c6c640a1632e8c44d9b335e68db869da28442b6ab0642a2b7adbc1e4ef334",
"windows": "ddee80b2505447197994377f40e574061e1d59203019b587361be2b28762fd61"
}
},
{
"name": "v0.22.3",
"checksums": {
Expand Down
3 changes: 0 additions & 3 deletions deploy/storage-provisioner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@
# limitations under the License.

FROM ubuntu:16.04

COPY main main

CMD ["/main"]

7 changes: 6 additions & 1 deletion hack/jenkins/minikube_cross_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ export GOPATH=/var/lib/jenkins/go

docker kill $(docker ps -q) || true
docker rm $(docker ps -aq) || true

set +e
make -j 16 all
set -e

gsutil cp gs://minikube-builds/logs/index.html gs://minikube-builds/logs/${ghprbPullId}/index.html

# Exit if the cross build failed.
if [ "$?"-ne 0]; then echo "cross build failed"; exit 1; fi

# If there are ISO changes, build and upload the ISO
# then set the default to the newly built ISO for testing
if out="$(git diff ${ghprbActualCommit} --name-only $(git merge-base origin/master ${ghprbActualCommit}) | grep deploy/iso/minikube)" &> /dev/null; then
Expand Down
27 changes: 3 additions & 24 deletions hack/jenkins/release_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,45 +30,24 @@ export TAGNAME=v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}
export DEB_VERSION=${VERSION_MAJOR}.${VERSION_MINOR}-${VERSION_BUILD}
export GOPATH=~/go

# Build all binaries in docker
export BUILD_IN_DOCKER=y

# Sanity checks
git status

# Make sure the tag matches the Makefile
cat Makefile | grep "VERSION_MAJOR ?=" | grep $VERSION_MAJOR
cat Makefile | grep "VERSION_MINOR ?=" | grep $VERSION_MINOR
cat Makefile | grep "VERSION_BUILD ?=" | grep $VERSION_BUILD

# Build and upload
make cross checksum

gsutil cp out/minikube-linux-amd64 gs://$BUCKET/releases/$TAGNAME/
gsutil cp out/minikube-linux-amd64.sha256 gs://$BUCKET/releases/$TAGNAME/
gsutil cp out/minikube-darwin-amd64 gs://$BUCKET/releases/$TAGNAME/
gsutil cp out/minikube-darwin-amd64.sha256 gs://$BUCKET/releases/$TAGNAME/
gsutil cp out/minikube-windows-amd64.exe gs://$BUCKET/releases/$TAGNAME/
gsutil cp out/minikube-windows-amd64.exe.sha256 gs://$BUCKET/releases/$TAGNAME/

make out/minikube-installer.exe
gsutil cp out/minikube-installer.exe gs://$BUCKET/releases/$TAGNAME/

make out/minikube_${DEB_VERSION}.deb
gsutil cp out/minikube_${DEB_VERSION}.deb gs://$BUCKET/releases/$TAGNAME/
BUILD_IN_DOCKER=y make -j 16 all out/minikube-installer.exe out/minikube_${DEB_VERSION}.deb
gsutil -m cp out/* gs://$BUCKET/releases/$TAGNAME/

# Bump latest
gsutil cp -r gs://$BUCKET/releases/$TAGNAME/* gs://$BUCKET/releases/latest/

# Build and upload localkube containers
make localkube-image
# Upload localkube containers
TAG="$(docker images "gcr.io/k8s-minikube/localkube-image" --format="{{.Tag}}" | head -n 1)"
gcloud docker -- push gcr.io/k8s-minikube/localkube-image:$TAG

make localkube-dind-image
TAG="$(docker images "gcr.io/k8s-minikube/localkube-dind-image" --format="{{.Tag}}" | head -n 1)"
gcloud docker -- push gcr.io/k8s-minikube/localkube-dind-image:$TAG

make localkube-dind-image-devshell
TAG="$(docker images "gcr.io/k8s-minikube/localkube-dind-image-devshell" --format="{{.Tag}}" | head -n 1)"
gcloud docker -- push gcr.io/k8s-minikube/localkube-dind-image-devshell:$TAG
26 changes: 18 additions & 8 deletions hack/jenkins/release_github_page.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,21 @@ github-release release \
--description "${DESCRIPTION}"

# Uploading the files into github
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube-linux-amd64" --file out/minikube-linux-amd64
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube-linux-amd64.sha256" --file out/minikube-linux-amd64.sha256
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube-darwin-amd64" --file out/minikube-darwin-amd64
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube-darwin-amd64.sha256" --file out/minikube-darwin-amd64.sha256
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube-windows-amd64" --file out/minikube-windows-amd64.exe
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube-windows-amd64.sha256" --file out/minikube-windows-amd64.exe.sha256
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube-installer.exe" --file out/minikube-installer.exe
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name "minikube_${DEB_VERSION}.deb" --file out/minikube_${DEB_VERSION}.deb
FILES_TO_UPLOAD=(
'minikube-linux-amd64'
'minikube-linux-amd64.sha256'
'minikube-darwin-amd64'
'minikube-darwin-amd64.sha256'
'minikube-windows-amd64'
'minikube-installer.exe'
"minikube_${DEB_VERSION}.deb"
'docker-machine-driver-kvm2'
'docker-machine-driver-hyperkit'
'localkube'
'localkube.sha256'
)

for UPLOAD in "${FILES_TO_UPLOAD[@]}"
do
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${TAGNAME} --name $UPLOAD --file out/$UPLOAD
done
3 changes: 2 additions & 1 deletion hack/jenkins/release_update_installers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ EOF
{
"title": "Update minikube to ${REPLACE_PKG_VERSION}",
"head": "minikube-bot:${REPLACE_PKG_VERSION}",
"base": "master"
"base": "master",
"body": "cc @r2d4"
}
EOF
Expand Down
3 changes: 2 additions & 1 deletion pkg/localkube/storage_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (lk LocalkubeServer) NewStorageProvisionerServer() Server {
}

func StartStorageProvisioner(lk LocalkubeServer) func() error {

return func() error {
config, err := restclient.InClusterConfig()
if err != nil {
Expand All @@ -139,7 +140,7 @@ func StartStorageProvisioner(lk LocalkubeServer) func() error {
// PVs
pc := controller.NewProvisionController(clientset, provisionerName, hostPathProvisioner, serverVersion.GitVersion)

fmt.Println("wait never stop")
glog.Info("Starting storage provisioner server")
pc.Run(wait.NeverStop)
return nil
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ var LocalkubeCachedImages = []string{

// Pause
"gcr.io/google_containers/pause-amd64:3.0",

//Storage provisioner
"gcr.io/k8s-minikube/storage-provisioner:v1.8.0",
}

func GetKubeadmCachedImages(version string) []string {
Expand All @@ -206,6 +209,9 @@ func GetKubeadmCachedImages(version string) []string {
"gcr.io/google_containers/kube-scheduler-amd64:" + version,
"gcr.io/google_containers/kube-controller-manager-amd64:" + version,
"gcr.io/google_containers/kube-apiserver-amd64:" + version,

//Storage provisioner
"gcr.io/k8s-minikube/storage-provisioner:" + version,
}
}

Expand Down
8 changes: 7 additions & 1 deletion pkg/minikube/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"text/template"

"k8s.io/apimachinery/pkg/labels"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/util"
)
Expand Down Expand Up @@ -63,7 +64,12 @@ func (k *K8sClientGetter) GetCoreClient() (corev1.CoreV1Interface, error) {

func (*K8sClientGetter) GetClientset() (*kubernetes.Clientset, error) {
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
configOverrides := &clientcmd.ConfigOverrides{}
configOverrides := &clientcmd.ConfigOverrides{
Context: clientcmdapi.Context{
Cluster: "minikube",
AuthInfo: "minikube",
},
}
kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides)
config, err := kubeConfig.ClientConfig()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions test/integration/start_stop_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
func TestStartStop(t *testing.T) {

runner := NewMinikubeRunner(t)
runner.RunCommand("config set WantReportErrorPrompt false", true)
runner.RunCommand("delete", false)
runner.CheckStatus(state.None.String())

Expand Down
2 changes: 1 addition & 1 deletion test/integration/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (m *MinikubeRunner) SetEnvFromEnvCmdOutput(dockerEnvVars string) error {
}

func (m *MinikubeRunner) GetStatus() string {
return m.RunCommand(fmt.Sprintf("status --format={{.MinikubeStatus}} %s", m.Args), true)
return m.RunCommand(fmt.Sprintf("status --format={{.MinikubeStatus}} %s", m.Args), false)
}

func (m *MinikubeRunner) GetLogs() string {
Expand Down

0 comments on commit eaac53f

Please sign in to comment.