Merge pull request #7603 from alonyb/w/add-registery-addon
Add registry addon feature for docker on mac/windowspull/7769/head
commit
825ba532d1
|
@ -28,9 +28,12 @@ import (
|
|||
|
||||
"github.com/golang/glog"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"k8s.io/minikube/pkg/drivers/kic/oci"
|
||||
"k8s.io/minikube/pkg/minikube/assets"
|
||||
"k8s.io/minikube/pkg/minikube/command"
|
||||
"k8s.io/minikube/pkg/minikube/config"
|
||||
"k8s.io/minikube/pkg/minikube/constants"
|
||||
"k8s.io/minikube/pkg/minikube/driver"
|
||||
"k8s.io/minikube/pkg/minikube/exit"
|
||||
"k8s.io/minikube/pkg/minikube/machine"
|
||||
|
@ -176,6 +179,17 @@ https://github.com/kubernetes/minikube/issues/7332`, out.V{"driver_name": cc.Dri
|
|||
return nil
|
||||
}
|
||||
|
||||
if name == "registry" {
|
||||
if driver.NeedsPortForward(cc.Driver) {
|
||||
port, err := oci.ForwardedPort(cc.Driver, cc.Name, constants.RegistryAddonPort)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "registry port")
|
||||
}
|
||||
out.T(out.Tip, `Registry addon on with {{.driver}} uses {{.port}} please use that instead of default 5000`, out.V{"driver": cc.Driver, "port": port})
|
||||
out.T(out.Documentation, `For more information see: https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}`, out.V{"driver": cc.Driver})
|
||||
}
|
||||
}
|
||||
|
||||
cmd, err := machine.CommandRunner(host)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "command runner")
|
||||
|
|
|
@ -93,6 +93,10 @@ func (d *Driver) Create() error {
|
|||
ListenAddress: oci.DefaultBindIPV4,
|
||||
ContainerPort: constants.DockerDaemonPort,
|
||||
},
|
||||
oci.PortMapping{
|
||||
ListenAddress: oci.DefaultBindIPV4,
|
||||
ContainerPort: constants.RegistryAddonPort,
|
||||
},
|
||||
)
|
||||
|
||||
exists, err := oci.ContainerExists(d.OCIBinary, params.Name)
|
||||
|
|
|
@ -40,6 +40,8 @@ const (
|
|||
APIServerPort = 8443
|
||||
// SSHPort is the SSH serviceport on the node vm and container
|
||||
SSHPort = 22
|
||||
// RegistryAddonPort os the default registry addon port
|
||||
RegistryAddonPort = 5000
|
||||
|
||||
// APIServerName is the default API server name
|
||||
APIServerName = "minikubeCA"
|
||||
|
|
|
@ -27,11 +27,9 @@ The Docker driver allows you to install Kubernetes into an existing Docker insta
|
|||
|
||||
`sudo mkdir /sys/fs/cgroup/systemd && sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd`.
|
||||
|
||||
- Addon 'registry' for mac and windows is not supported yet and it is [a work in progress](https://github.com/kubernetes/minikube/issues/7535).
|
||||
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- On macOS or Windows, you may need to restart Docker for Desktop if a command gets hung
|
||||
|
||||
- Run `--alsologtostderr -v=1` for extra debugging information
|
||||
|
|
|
@ -15,13 +15,13 @@ The best method to push your image to minikube depends on the container-runtime
|
|||
Here is a comparison table to help you choose:
|
||||
|
||||
|
||||
| Method | Supported Runtimes | Issues | Performance |
|
||||
| Method | Supported Runtimes | | Performance |
|
||||
|--- |--- |--- |--- |--- |
|
||||
| [docker-env command](/docs/handbook/pushing/#1pushing-directly-to-the-in-cluster-docker-daemon-docker-env) | only docker | | good |
|
||||
| [podman-env command](/docs/handbook/pushing/#3-pushing-directly-to-in-cluster-crio-podman-env) | only cri-o | | good |
|
||||
| [cache add command](/pushing/#2-push-images-using-cache-command) | all | | ok |
|
||||
| [registry addon](/docs/handbook/pushing/#4-pushing-to-an-in-cluster-using-registry-addon) | all | work in progress for [docker on mac](https://github.com/kubernetes/minikube/issues/7535) | ok |
|
||||
| [minikube ssh](/docs/handbook/pushing/#5-building-images-inside-of-minikube-using-ssh) | all | | best |
|
||||
| [docker-env command](/docs/handbook/pushing/#1pushing-directly-to-the-in-cluster-docker-daemon-docker-env) | only docker | good |
|
||||
| [podman-env command](/docs/handbook/pushing/#3-pushing-directly-to-in-cluster-crio-podman-env) | only cri-o | good |
|
||||
| [cache add command](/pushing/#2-push-images-using-cache-command) | all | ok |
|
||||
| [registry addon](/docs/handbook/pushing/#4-pushing-to-an-in-cluster-using-registry-addon) | all | ok |
|
||||
| [minikube ssh](/docs/handbook/pushing/#5-building-images-inside-of-minikube-using-ssh) | all | best |
|
||||
|
||||
|
||||
* note1 : the default container-runtime on minikube is 'docker'.
|
||||
|
|
Loading…
Reference in New Issue