提交 f5e73b08 编写于 作者: M Matt Rickard 提交者: GitHub

Merge pull request #1410 from r2d4/doc-redesign

Refactor docs
......@@ -16,9 +16,24 @@
* Updated ingress addon to v0.9-beta.3
* Made localkube versions backwards compatible for versions without `--apiserver-name`
* [Minikube ISO] ISO will now be versioned the same as minikube
* [Minikube ISO] Added timezone data
* [Minikube ISO] Added `jq` and `coreutils` packages
* [Minikube ISO] Enabled RDB Kernel module
* [Minikube ISO] Added dockerized build for iso image
* [Minikube ISO] Enabled NFS_v4_2 in kernel
* [Minikube ISO] Added CIFS-utils
## Version 0.17.1 - 3/2/2017
* Removed vendored KVM driver so minikube doesn't have a dependency on libvirt-bin
* [Minikube ISO] Added ethtool
* [Minikube ISO] Added bootlocal.sh script for custom startup options
* [Minikube ISO] Added version info in /etc/VERSION
* [Minikube ISO] Bumped rkt to v1.24.0
* [Minikube ISO] Enabled user namespaces in kernel
* [Minikube ISO] `/tmp/hostpath_pv` and `/tmp/hostpath-provisioner` are now persisted
## Version 0.17.0 - 3/2/2017
* Added external hostpath provisioner to localkube
* Added unit test coverage
......@@ -35,6 +50,16 @@
* Added check for minimum disk size
* Updated kubernetes to v1.5.2
* [Minikube ISO] Added back in curl, git, and rsync
* [Minikube ISO] Enabled CONFIG_TUN in kernel
* [Minikube ISO] Added NFS packages
* [Minikube ISO] Enabled swapon on start/stop
* [Minikube ISO] Updated CNI to v0.4.0
* [Minikube ISO] Fix permissions for /data directory
* [Minikube ISO] Updated RKT to v1.23.0
* [Minikube ISO] Added in CoreOS toolbox binary
* [Minikube ISO] Fixed vboxFS permission error
## Version 0.15.0 - 1/10/2017
* Update Dashboard to v1.5.1, fixes a CSRF vulnerability in the dashboard
* Updated Kube-DNS addon to v1.9
......
......@@ -10,14 +10,7 @@ File issues using the standard Github issue tracker for the repo.
We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles.
Please fill out either the individual or corporate Contributor License Agreement (CLA).
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.
***NOTE***: Only original source code from you and other people that have signed the CLA can be accepted into the main repository.
[Please fill out either the individual or corporate Contributor License Agreement (CLA)](https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ)
### Contributing A Patch
......
# Minikube ISO Release Notes
## Version 0.18.0 - 4/6/2017
* ISO will now be versioned the same as minikube
* Added timezone data
* Added `jq` and `coreutils` packages
* Enabled RDB Kernel module
* Added dockerized build for iso image
* Enabled NFS_v4_2 in kernel
* Added CIFS-utils
## Version 1.0.7 - 3/2/2017
* Added ethtool
* Added bootlocal.sh script for custom startup options
* Added version info in /etc/VERSION
* Bumped rkt to v1.24.0
* Enabled user namespaces in kernel
* `/tmp/hostpath_pv` and `/tmp/hostpath-provisioner` are now persisted
## Version 1.0.6 - 2/2/2017
* Added back in curl, git, and rsync
* Enabled CONFIG_TUN in kernel
* Added NFS packages
* Enabled swapon on start/stop
* Updated CNI to v0.4.0
* Fix permissions for /data directory
* Updated RKT to v1.23.0
* Added in CoreOS toolbox binary
* Fixed vboxFS permission error
此差异已折叠。
## minikube ISO image
This includes the configuration for an alternative bootable ISO image meant to be used in conjection with minikube.
It includes:
- systemd as the init system
- rkt
- docker
## Configurations
The following configurations have been tested:
* OSX
* Virtualbox
* VMware Fusion
* Linux
* Virtualbox
* KVM
The following configurations are known to have issues currently:
* OSX
* xhyve (https://github.com/zchee/docker-machine-driver-xhyve/issues/135)
## Hacking
### Requirements
* Linux
```
sudo apt-get install build-essential gnupg2 p7zip-full git wget cpio python \
unzip bc gcc-multilib automake libtool locales
```
Either import your private key or generate a sign-only key using `gpg2 --gen-key`.
Also be sure to have an UTF-8 locale set up in order to build the ISO.
### Build instructions
```
$ git clone https://github.com/kubernetes/minikube
$ cd minikube
$ make buildroot-image
$ make out/minikube.iso
```
The build will occurs inside a docker container, if you want to do this
baremetal, replace `make out/minikube.iso` with `IN_DOCKER=1 make out/minikube.iso`.
The bootable ISO image will be available in `out/minikube.iso`.
### Testing local minikube-iso changes
```
$ ./out/minikube start \
--container-runtime=rkt \
--network-plugin=cni \
--iso-url=file:///$GOPATH/k8s.io/minikube/out/buildroot/output/images/rootfs.iso9660
```
When testing a custom image and something goes bad, you will have to delete the
VM and start it again. The start command does not delete the VM if the creation
fails, and if you don't do it, you will end up starting the same incorrect
VM over and over.
```
$ ./out/minikube start --iso-url=file://...
# a wild error appears...
$ ./out/minikube delete
Deleting local Kubernetes cluster...
Machine deleted.
$ ./out/minikube start --iso-url=file://...
```
### Buildroot configuration
To change the buildroot configuration, execute:
```
$ cd out/buildroot
$ make menuconfig
$ make
```
To change the kernel configuration, execute:
```
$ cd out/buildroot
$ make linux-menuconfig
$ make
```
The last commands copies changes made to the kernel configuration to the minikube-iso defconfig.
### Saving buildroot/kernel configuration changes
To save any buildroot configuration changes made with `make menuconfig`, execute:
```
$ cd out/buildroot
$ make savedefconfig
```
The changes will be reflected in the `minikube-iso/configs/minikube_defconfig` file.
```
$ git stat
## master
M deploy/iso/minikube-iso/configs/minikube_defconfig
```
To save any kernel configuration changes made with `make linux-menuconfig`, execute:
```
$ cd out/buildroot
$ make linux-savedefconfig
$ cp output/build/linux-4.9.13/defconfig \
../../deploy/iso/minikube-iso/board/coreos/minikube/linux-4.9_defconfig
```
The changes will be reflected in the `deploy/iso/minikube-iso/configs/minikube_defconfig` file.
The documentation for building and hacking on the minikube ISO can be found at [docs/contributors/minikube_iso.md](docs/contributors/minikube_iso.md).
\ No newline at end of file
## Advanced Topics and Tutorials
### Cluster Configuration
* **Alternative Runtimes** ([alternative_runtimes.md](alternative_runtimes.md)): How to run minikube with rkt as the container runtime
* **Environment Variables** ([env_vars.md](env_vars.md)): The different environment variables that minikube understands
* **Minikube Addons** ([addons.md](addons.md)): Information on configuring addons to be run on minikube
* **Configuring Kubernetes** ([configuring_kubernetes.md](configuring_kubernetes.md)): Configuring different kubernetes components in minikube
### Installation and debugging
* **Driver installation** ([drivers.md](drivers.md)): In depth instructions for installing the various hypervisor drivers
* **Debugging minikube** ([debugging.md](debugging.md)): General practices for debugging the minikube binary itself
### Developing on the minikube cluster
* **Reusing the Docker Daemon** ([reusing_the_docker_daemon.md](reusing_the_docker_daemon.md)): How to point your docker CLI to the docker daemon running inside minikube
#### Storage
* **Persistent Volumes** ([persistent_volumes.md](persistent_volumes.md)): Persistent Volumes in Minikube and persistented locations in the VM
* **Host Folder Mounting** ([host_folder_mount.md](host_folder_mount.md)): How to mount your files from your host into the minikube VM
#### Networking
* **HTTP Proxy** ([http_proxy.md](http_proxy.md)): Instruction on how to run minikube behind a HTTP Proxy
* **Insecure or Private Registries** ([insecure_registry.md](insecure_registry.md)): How to use private or insecure registries with minikube
* **Accessing etcd from inside the cluster** ([accessing_etcd.md](accessing_etcd.md))
* **Networking** ([networking.md](networking.md)): FAQ about networking between the host and minikube VM
## Accessing Localkube Resources From Inside A Pod: Example etcd
In order to access localkube resources from inside a pod, localkube's host ip address must be used. This can be obtained by running:
```shell
$ minikube ssh -- "sudo /usr/local/bin/localkube --host-ip"
localkube host ip: 10.0.2.15
```
You can use the host-ip:`10.0.2.15` to access localkube's resources, for example its etcd cluster. In order to access etcd from within a pod, you can run the following command inside:
```shell
curl -L -X PUT http://10.0.2.15:2379/v2/keys/message -d value="Hello"
```
\ No newline at end of file
## Add-ons
Minikube has a set of built in addons that can be used enabled, disabled, and opened inside of the local k8s environment. Below is an exampe of this functionality for the `heapster` addon:
```shell
$ minikube addons list
- addon-manager: enabled
- dashboard: enabled
- kube-dns: enabled
- heapster: disabled
- registry-creds: disabled
# minikube must be running for these commands to take effect
$ minikube addons enable heapster
heapster was successfully enabled
$ minikube addons open heapster # This will open grafana (interacting w/ heapster) in the browser
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Created new window in existing browser session.
```
The currently supported addons include:
* [Kubernetes Dashboard](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dashboard)
* [Kube-dns](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns)
* [Heapster](https://github.com/kubernetes/heapster): [Troubleshooting Guide](https://github.com/kubernetes/heapster/blob/master/docs/influxdb.md) Note:You will need to login to Grafana as admin/admin in order to access the console
* [Registry Credentials](https://github.com/upmc-enterprises/registry-creds)
If you would like to have minikube properly start/restart custom addons, place the addon(s) you wish to be launched with minikube in the `.minikube/addons` directory. Addons in this folder will be moved to the minikubeVM and launched each time minikube is started/restarted.
If you have a request for an addon in minikube, please open an issue with the name and preferably a link to the addon with a description of its purpose and why it should be added. You can also attempt to add the addon to minikube by following the guide at [ADD_ADDON.md](./ADD_ADDON.md)
### Using rkt container engine
To use [rkt](https://github.com/coreos/rkt) as the container runtime run:
```shell
$ minikube start \
--network-plugin=cni \
--container-runtime=rkt \
```
\ No newline at end of file
### Configuring Kubernetes
Minikube has a "configurator" feature that allows users to configure the Kubernetes components with arbitrary values.
To use this feature, you can use the `--extra-config` flag on the `minikube start` command.
This flag is repeated, so you can pass it several times with several different values to set multiple options.
This flag takes a string of the form `component.key=value`, where `component` is one of the strings from the list below, `key` is a value on the
configuration struct and `value` is the value to set.
Valid `key`s can be found by examining the documentation for the Kubernetes `componentconfigs` for each component.
Here is the documentation for each supported configuration:
* [kubelet](https://godoc.org/k8s.io/kubernetes/pkg/apis/componentconfig#KubeletConfiguration)
* [apiserver](https://godoc.org/k8s.io/kubernetes/cmd/kube-apiserver/app/options#APIServer)
* [proxy](https://godoc.org/k8s.io/kubernetes/pkg/apis/componentconfig#KubeProxyConfiguration)
* [controller-manager](https://godoc.org/k8s.io/kubernetes/pkg/apis/componentconfig#KubeControllerManagerConfiguration)
* [etcd](https://godoc.org/github.com/coreos/etcd/etcdserver#ServerConfig)
* [scheduler](https://godoc.org/k8s.io/kubernetes/pkg/apis/componentconfig#KubeSchedulerConfiguration)
You can enable feature gates for alpha and experimental features with the `--feature-gates` flag on `minikube start`. As of v1.5.1, the options are:
* AllAlpha=true|false (ALPHA - default=false)
* AllowExtTrafficLocalEndpoints=true|false (BETA - default=true)
* AppArmor=true|false (BETA - default=true)
* DynamicKubeletConfig=true|false (ALPHA - default=false)
* DynamicVolumeProvisioning=true|false (ALPHA - default=true)
* ExperimentalHostUserNamespaceDefaulting=true|false (ALPHA - default=false)
* StreamingProxyRedirects=true|false (ALPHA - default=false)
Note: All alpha and experimental features are not guaranteed to work with minikube.
#### Examples
To change the `MaxPods` setting to 5 on the Kubelet, pass this flag: `--extra-config=kubelet.MaxPods=5`.
This feature also supports nested structs. To change the `LeaderElection.LeaderElect` setting to `true` on the scheduler, pass this flag: `--extra-config=scheduler.LeaderElection.LeaderElect=true`.
To set the `AuthorizationMode` on the `apiserver` to `RBAC`, you can use: `--extra-config=apiserver.Authorization.Mode=RBAC`.
To enable all alpha feature gates, you can use: `--feature-gates=AllAlpha=true`
## Contributing
* **New contributors** ([contributors.md](./contributing.md)): Process for new contributors, CLA instructions
* **Roadmap** ([roadmap.md](roadmap.md)): The roadmap for future minikube development
## New Features and Dependencies
* **Adding a dependency** ([adding_a_dependency.md](adding_a_dependency.md)): How to add or update vendored code
* **Adding a new addon** ([adding_an_addon.md](adding_an_addon.md)): How to add a new addon to minikube for `minikube addons`
* **Updating Kubernetes** ([updating_kubernetes.md](updating_kubernetes.md)): Updating the version of Kubernetes in Localkube
## Building and Releasing
* **Build Guide** ([build_guide.md](build_guide.md)): How to build minikube from source
* **ISO Build Guide** ([minikube_iso.md](minikube_iso.md)): How to build and hack on the ISO image that minikube uses
* **CI Builds** ([ci_builds.md](./ci_builds.md)): Accessing CI build artifacts from Jenkins
* **Releasing minikube** ([releasing_minikube.md](releasing_minikube.md)): Steps to release a new version of minikube
* **Releasing localkube** ([releasing_localkube.md](releasing_localkube.md)): Steps to release a new version of localkube
### CI Builds
We publish CI builds of minikube, built at every Pull Request. Builds are available at (substitute in the relevant PR number):
- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-darwin-amd64
- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-linux-amd64
- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-windows-amd64.exe
We also publish CI builds of minikube-iso, built at every Pull Request that touches deploy/iso/minikube-iso. Builds are available at:
- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-testing.iso
## minikube ISO image
This includes the configuration for an alternative bootable ISO image meant to be used in conjection with minikube.
It includes:
- systemd as the init system
- rkt
- docker
## Hacking
### Requirements
* Linux
```
sudo apt-get install build-essential gnupg2 p7zip-full git wget cpio python \
unzip bc gcc-multilib automake libtool locales
```
Either import your private key or generate a sign-only key using `gpg2 --gen-key`.
Also be sure to have an UTF-8 locale set up in order to build the ISO.
### Build instructions
```
$ git clone https://github.com/kubernetes/minikube
$ cd minikube
$ make buildroot-image
$ make out/minikube.iso
```
The build will occurs inside a docker container, if you want to do this
baremetal, replace `make out/minikube.iso` with `IN_DOCKER=1 make out/minikube.iso`.
The bootable ISO image will be available in `out/minikube.iso`.
### Testing local minikube-iso changes
```
$ ./out/minikube start \
--container-runtime=rkt \
--network-plugin=cni \
--iso-url=file:///$GOPATH/k8s.io/minikube/out/minikube.iso
```
### Buildroot configuration
To change the buildroot configuration, execute:
```
$ cd out/buildroot
$ make menuconfig
$ make
```
To change the kernel configuration, execute:
```
$ cd out/buildroot
$ make linux-menuconfig
$ make
```
The last commands copies changes made to the kernel configuration to the minikube-iso defconfig.
### Saving buildroot/kernel configuration changes
To save any buildroot configuration changes made with `make menuconfig`, execute:
```
$ cd out/buildroot
$ make savedefconfig
```
The changes will be reflected in the `minikube-iso/configs/minikube_defconfig` file.
```
$ git stat
## master
M deploy/iso/minikube-iso/configs/minikube_defconfig
```
To save any kernel configuration changes made with `make linux-menuconfig`, execute:
```
$ cd out/buildroot
$ make linux-savedefconfig
$ cp output/build/linux-4.9.13/defconfig \
../../deploy/iso/minikube-iso/board/coreos/minikube/linux-4.9_defconfig
```
The changes will be reflected in the `deploy/iso/minikube-iso/configs/minikube_defconfig` file.
......@@ -16,7 +16,7 @@ This isn't strictly necessary, but it usually helps.
```shell
cd minikube
godep restore ./...
./hack/godep/godep-restore.sh
```
3. Kubernetes should now be on your GOPATH. Check it out to the right version.
......@@ -44,7 +44,7 @@ Make sure to also fetch tags, as Godep relies on these.
```shell
git checkout $DESIREDTAG
godep restore ./...
./hack/godep-restore.sh
```
4. Build and test minikube, making any manual changes necessary to build.
......@@ -53,8 +53,7 @@ Make sure to also fetch tags, as Godep relies on these.
```shell
cd $GOPATH/src/k8s.io/minikube
rm -rf Godeps/ vendor/
godep save ./...
./hack/godep/godep-save.sh
```
6. Verify that the correct tag is marked in the Godeps.json file by running this script:
......@@ -86,8 +85,4 @@ git add --all
git commit -m "Manual changes to update Kubernetes to foo"
```
As a final part of updating kubernetes, a new version of localkube should be uploaded to GCS so that users can select this version of kubernetes/localkube in later minikube/localkube builds. For instructions on how to do this, see [LOCALKUBE_RELEASING.md](https://github.com/kubernetes/minikube/blob/master/LOCALKUBE_RELEASING.md)
#### Note on bugfix from Kubernetes
In case that specific bugfix patches have been applied to the k8s vendor tree, the patches could be at some point overwritten by next Kubernetes updates. So contributors should check if the vendor tree still contains the bugfixes even after having updated the vendor tree.
As a final part of updating kubernetes, a new version of localkube should be uploaded to GCS so that users can select this version of kubernetes/localkube in later minikube/localkube builds. For instructions on how to do this, see [releasing_localkube.md](https://github.com/kubernetes/minikube/blob/master/docs/contributing/releasing_localkube.md)
### Debugging Issues With Minikube
To debug issues with minikube (not kubernetes but minikube itself), you can use the -v flag to see debug level info. The specified values for v will do the following (the values are all encompassing in that higher values will give you all lower value outputs as well):
* --v=0 INFO level logs
* --v=1 WARNING level logs
* --v=2 ERROR level logs
* --v=3 libmachine logging
* --v=7 libmachine --debug level logging
If you need to access additional tools for debugging, minikube also includes the [CoreOS toolbox](https://github.com/coreos/toolbox)
You can ssh into the toolbox and access these additional commands using:
`minikube ssh toolbox`
\ No newline at end of file
......@@ -19,6 +19,7 @@ Minikube is currently tested against [`docker-machine-driver-kvm` v0.10.0](https
After following the instructions on the KVM driver releases page, you need to make sure that have the necessary packages and permissions by following these instructions:
```
# Install libvirt and qemu-kvm on your system, e.g.
# Debian/Ubuntu
$ sudo apt install libvirt-bin qemu-kvm
......
## Minikube Environment Variables
Minikube supports passing environment variables instead of flags for every value listed in `minikube config list`. This is done by passing an environment variable with the prefix `MINIKUBE_`For example the `minikube start --iso-url="$ISO_URL"` flag can also be set by setting the `MINIKUBE_ISO_URL="$ISO_URL"` environment variable.
Some features can only be accessed by environment variables, here is a list of these features:
* **MINIKUBE_HOME** - (string) sets the path for the .minikube directory that minikube uses for state/configuration
* **MINIKUBE_WANTUPDATENOTIFICATION** - (bool) sets whether the user wants an update notification for new minikube versions
* **MINIKUBE_REMINDERWAITPERIODINHOURS** - (int) sets the number of hours to check for an update notification
* **MINIKUBE_WANTREPORTERROR** - (bool) sets whether the user wants to send anonymous errors reports to help improve minikube
* **MINIKUBE_WANTREPORTERRORPROMPT** - (bool) sets whether the user wants to be prompted on an error that they can report them to help improve minikube
* **MINIKUBE_WANTKUBECTLDOWNLOADMSG** - (bool) sets whether minikube should tell a user that `kubectl` cannot be found on there path
* **MINIKUBE_ENABLE_PROFILING** - (int, `1` enables it) enables trace profiling to be generated for minikube which can be analyzed via:
```shell
# set env var and then run minikube
$ MINIKUBE_ENABLE_PROFILING=1 ./out/minikube start
2017/01/09 13:18:00 profile: cpu profiling enabled, /tmp/profile933201292/cpu.pprof
Starting local Kubernetes cluster...
Kubectl is now configured to use the cluster.
2017/01/09 13:19:06 profile: cpu profiling disabled, /tmp/profile933201292/cpu.pprof
# Then you can examine the profile with:
$ go tool pprof /tmp/profile933201292/cpu.pprof
```
\ No newline at end of file
## Mounting Host Folders
`minikube mount /path/to/dir/to/mount:/vm-mount-path` is the recommended way to mount directories into minikube so that they can be used in your local kubernetes cluster. The command works on all supported platforms. Below is an example workflow for using `minikube mount`:
```
# terminal 1
$ mkdir ~/mount-dir
$ minikube mount ~/mount-dir:/mount-9p
Mounting /home/user/mount-dir/ into /mount-9p on the minikubeVM
This daemon process needs to stay alive for the mount to still be accessible...
ufs starting
# This process has to stay open, so in another terminal...
```
```
# terminal 2
$ echo "hello from host" > ~/mount-dir/hello-from-host
$ kubectl run -i --rm --tty ubuntu --overrides='
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "ubuntu"
},
"spec": {
"containers": [
{
"name": "ubuntu",
"image": "ubuntu:14.04",
"args": [
"bash"
],
"stdin": true,
"stdinOnce": true,
"tty": true,
"workingDir": "/mount-9p",
"volumeMounts": [{
"mountPath": "/mount-9p",
"name": "host-mount"
}]
}
],
"volumes": [
{
"name": "host-mount",
"hostPath": {
"path": "/mount-9p"
}
}
]
}
}
' --image=ubuntu:14.04 --restart=Never -- bash
Waiting for pod default/ubuntu to be running, status is Pending, pod ready: false
Waiting for pod default/ubuntu to be running, status is Running, pod ready: false
# ======================================================================================
# We are now in the pod
#=======================================================================================
root@ubuntu:/mount-9p# cat hello-from-host
hello from host
root@ubuntu:/mount-9p# echo "hello from pod" > /mount-9p/hello-from-pod
root@ubuntu:/mount-9p# ls
hello-from-host hello-from-pod
root@ubuntu:/mount-9p# exit
exit
Waiting for pod default/ubuntu to terminate, status is Running
pod "ubuntu" deleted
# ======================================================================================
# We are back on the host
#=======================================================================================
$ cat ~/mount-dir/hello-from-pod
hello from pod
```
Some drivers themselves provide host-folder sharing options, but we plan to deprecate these in the future as they are all implemented differently and they are not configurable through minikube.
\ No newline at end of file
## Using Minikube with an HTTP Proxy
Minikube creates a Virtual Machine that includes Kubernetes and a Docker daemon.
When Kubernetes attempts to schedule containers using Docker, the Docker daemon may require external network access to pull containers.
If you are behind an HTTP proxy, you may need to supply Docker with the proxy settings.
To do this, pass the required environment variables as flags during `minikube start`.
For example:
```shell
$ minikube start --docker-env HTTP_PROXY=http://$YOURPROXY:PORT \
--docker-env HTTPS_PROXY=https://$YOURPROXY:PORT
```
\ No newline at end of file
## Enabling Docker Insecure Registry
Minikube allows users to configure the docker engine's `--insecure-registry` flag. You can use the `--insecure-registry` flag on the
`minikube start` command to enable insecure communication between the docker engine and registries listening to requests from the CIDR range.
One nifty hack is to allow the kubelet running in minikube to talk to registries deployed inside a pod in the cluster without backing them
with TLS certificates. Because the default service cluster IP is known to be available at 10.0.0.1, users can pull images from registries
deployed inside the cluster by creating the cluster with `minikube start --insecure-registry "10.0.0.0/24"`.
## Private Container Registries
**GCR/ECR/Docker**: Minikube has an addon, `registry-creds` which maps credentials into Minikube to support pulling from Google Container Registry (GCR), Amazon's EC2 Container Registry (ECR), and Private Docker registries. You will need to run `minikube addons configure registry-creds` and `minikube addons enable registry-creds` to get up and running. An example of this is below:
```shell
$ minikube addons configure registry-creds
Do you want to enable AWS Elastic Container Registry? [y/n]: n
Do you want to enable Google Container Registry? [y/n]: y
-- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):/home/user/.config/gcloud/application_default_credentials.json
Do you want to enable Docker Registry? [y/n]: n
registry-creds was successfully configured
$ minikube addons enable registry-creds
```
For additional information on private container registries, see [this page](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/).
We recommend you use ImagePullSecrets, but if you would like to configure access on the minikube VM you can place the `.dockercfg` in the `/home/docker` directory or the `config.json` in the `/home/docker/.docker` directory.
\ No newline at end of file
## Networking
The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command.
Any services of type `NodePort` can be accessed over that IP address, on the NodePort.
To determine the NodePort for your service, you can use a `kubectl` command like this:
`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].NodePort}"'`
\ No newline at end of file
## Persistent Volumes
Minikube supports [PersistentVolumes](http://kubernetes.io/docs/user-guide/persistent-volumes/) of type `hostPath`.
These PersistentVolumes are mapped to a directory inside the minikube VM.
The Minikube VM boots into a tmpfs, so most directories will not be persisted across reboots (`minikube stop`).
However, Minikube is configured to persist files stored under the following directories in the minikube VM:
* `/data`
* `/var/lib/localkube`
* `/var/lib/docker`
* `/tmp/hostpath_pv`
* `/tmp/hostpath-provisioner`
Here is an example PersistentVolume config to persist data in the '/data' directory:
```yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 5Gi
hostPath:
path: /data/pv0001/
```
You can also achieve persistence by creating a PV in a mounted host folder.
### Reusing the Docker daemon
When using a single VM of kubernetes it's really handy to reuse the Docker daemon inside the VM; as this means you don't have to build on your host machine and push the image into a docker registry - you can just build inside the same docker daemon as minikube which speeds up local experiments.
To be able to work with the docker daemon on your mac/linux host use the [docker-env command](./docs/minikube_docker-env.md) in your shell:
```
eval $(minikube docker-env)
```
you should now be able to use docker on the command line on your host mac/linux machine talking to the docker daemon inside the minikube VM:
```
docker ps
```
On Centos 7, docker may report the following error:
```
Could not read CA certificate "/etc/docker/ca.pem": open /etc/docker/ca.pem: no such file or directory
```
The fix is to update /etc/sysconfig/docker to ensure that minikube's environment changes are respected:
```
< DOCKER_CERT_PATH=/etc/docker
---
> if [ -z "${DOCKER_CERT_PATH}" ]; then
> DOCKER_CERT_PATH=/etc/docker
> fi
```
Remember to turn off the imagePullPolicy:Always, as otherwise kubernetes won't use images you built locally.
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册