Updated localkube docker instructions, added build to main makefile

pull/1106/head
Aaron Prindle 2017-02-08 11:10:12 -08:00
parent 1548cb78e9
commit 6011819e3a
5 changed files with 26 additions and 68 deletions

View File

@ -20,6 +20,7 @@ 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)
BUILDROOT_BRANCH ?= 2016.08
REGISTRY?=gcr.io/k8s-minikube
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
@ -44,6 +45,7 @@ BUILD_OS := $(shell uname -s)
LOCALKUBE_VERSION := $(shell $(PYTHON) hack/get_k8s_version.py --k8s-version-only 2>&1)
LOCALKUBE_BUCKET := gs://minikube/k8sReleases
TAG ?= $(LOCALKUBE_VERSION)
# Set the version information for the Kubernetes servers, and build localkube statically
K8S_VERSION_LDFLAGS := $(shell $(PYTHON) hack/get_k8s_version.py 2>&1)
@ -172,3 +174,9 @@ release-localkube: out/localkube checksum
update-releases:
gsutil cp deploy/minikube/k8s_releases.json gs://minikube/k8s_releases.json
out/localkube-image: out/localkube
# TODO(aprindle) make addons placed into container configurable
docker build -t $(REGISTRY)/localkube-image:$(TAG) -f deploy/docker/Dockerfile .
@echo ""
@echo "${REGISTRY}/localkube-image:$(TAG) succesfully built"
@echo "See https://github.com/kubernetes/minikube/tree/master/deploy/docker for instrucions on how to run image"

View File

@ -27,6 +27,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Copy over important files
COPY localkube /
COPY static-pods /etc/kubernetes/manifests
COPY addons /etc/kubernetes/addons
COPY out/localkube /
COPY out/deploy/addons/addon-manager.yaml /etc/kubernetes/manifests/addon-manager.yaml
COPY out/deploy/addons /etc/kubernetes/addons

View File

@ -1,31 +0,0 @@
# Copyright 2016 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.
REGISTRY?=gcr.io/google_containers
ARCH?=amd64
TEMP_DIR:=$(shell mktemp -d)
all: build
build:
ifndef VERSION
$(error VERSION is undefined)
endif
cp -r ./* $(TEMP_DIR)
cp -r ../addons ./static-pods $(TEMP_DIR)
cp ../../out/localkube $(TEMP_DIR)
chmod +x $(TEMP_DIR)/localkube
docker build -t $(REGISTRY)/localkube-$(ARCH):$(VERSION) $(TEMP_DIR)

View File

@ -1,11 +1,11 @@
### Run localkube in a docker container (experimental)
**Warning:** This is very experimental code at the moment.
**Warning:** This is experimental code at the moment.
#### How to build
From root minikube/ directory run:
```console
$ make VERSION=vX.Y.Z
$ make localkube-image #optional env-vars: TAG=LOCALKUBE_VERSION REGISTRY=gcr.io/k8s-minikube
```
#### How to run
@ -20,7 +20,17 @@ $ docker run -d \
--net=host \
--pid=host \
--privileged \
gcr.io/google_containers/localkube-amd64:vX.Y.Z \
gcr.io/k8s-minikube/localkube-amd64:LOCALKUBE_VERSION \
/localkube start \
--apiserver-insecure-address=0.0.0.0 \
--apiserver-insecure-port=8080 \
--logtostderr=true \
--containerized
```
```
Then to setup `kubectl` to use this cluster:
```console
kubectl config set-cluster localkube-image --server=http://127.0.0.1:8080 --api-version=v1
kubectl config set-context localkube-image --cluster=localkube-image
kubectl config use-context localkube-image
```
Now `kubectl` should be configured to properly access your local k8s environment

View File

@ -1,29 +0,0 @@
# Copyright 2016 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.
apiVersion: v1
kind: Pod
metadata:
name: kube-addon-manager
namespace: kube-system
version: v2
spec:
hostNetwork: true
containers:
- name: kube-addon-manager
image: gcr.io/google-containers/kube-addon-manager-amd64:v2
resources:
requests:
cpu: 5m
memory: 50Mi