Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add registry addon feature for docker on mac/windows #7603

Merged
merged 36 commits into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e785012
add registery port constant
ruben-baez-seagull-com Apr 10, 2020
50c2ec4
add oci port mapping of registery
ruben-baez-seagull-com Apr 10, 2020
428d9ee
add new addon
ruben-baez-seagull-com Apr 10, 2020
c4ef1b3
add return port logic
ruben-baez-seagull-com Apr 10, 2020
79593cb
add addon struct
ruben-baez-seagull-com Apr 10, 2020
3bd1430
change output message
ruben-baez-seagull-com Apr 10, 2020
201a2bb
remove driver and use clusterConfig
ruben-baez-seagull-com Apr 10, 2020
f48d2ca
change constant name
ruben-baez-seagull-com Apr 10, 2020
6f34183
add KIC validation
ruben-baez-seagull-com Apr 10, 2020
01e0237
remove test code
ruben-baez-seagull-com Apr 10, 2020
e636272
Update docker.md
ruben-baez-seagull-com Apr 11, 2020
d372027
Merge pull request #4 from alonyb/patch-1
ruben-baez-seagull-com Apr 11, 2020
a9e87bd
Update docker.md
ruben-baez-seagull-com Apr 11, 2020
3d6b945
Merge pull request #5 from alonyb/change-documentation
ruben-baez-seagull-com Apr 11, 2020
4f86c3e
some adjustments
ruben-baez-seagull-com Apr 11, 2020
4417ac8
Merge branch 'w/add-registery-addon' of github.com:RubenBaez/minikube…
ruben-baez-seagull-com Apr 11, 2020
bd5fd81
Update docker.md
ruben-baez-seagull-com Apr 11, 2020
2452471
Create registry_addon_mac_windows.inc
ruben-baez-seagull-com Apr 11, 2020
a8e9044
Merge pull request #6 from alonyb/patch-2
ruben-baez-seagull-com Apr 11, 2020
a34ada8
add regisrtry_addon_mac_windows_usage.inc
ruben-baez-seagull-com Apr 11, 2020
338e61b
change output message icon
ruben-baez-seagull-com Apr 11, 2020
c075f49
Merge branch 'w/add-registery-addon' of github.com:RubenBaez/minikube…
ruben-baez-seagull-com Apr 11, 2020
62904e5
fix lint
ruben-baez-seagull-com Apr 15, 2020
db8af9d
Update registry_addon_mac_windows.inc
ruben-baez-seagull-com Apr 16, 2020
373616b
Update registry_addon_mac_windows.inc
ruben-baez-seagull-com Apr 16, 2020
8c00b17
Update registry.md
ruben-baez-seagull-com Apr 16, 2020
59e9c83
fix registry addon template
ruben-baez-seagull-com Apr 16, 2020
d573b6c
add docker inspect command
ruben-baez-seagull-com Apr 17, 2020
bfa45ef
delete unnecesary func
ruben-baez-seagull-com Apr 17, 2020
5ec1862
delete links
ruben-baez-seagull-com Apr 17, 2020
2f940d8
update registry_addon_mac_windows.inc
ruben-baez-seagull-com Apr 17, 2020
40e87af
fix docker commands
ruben-baez-seagull-com Apr 17, 2020
6bde0e0
change upper case & add new step
ruben-baez-seagull-com Apr 17, 2020
cef7a6f
fix documentation
ruben-baez-seagull-com Apr 17, 2020
c48b22b
change table of pushing doc
ruben-baez-seagull-com Apr 18, 2020
a96d8f0
delete windows and mac doc
ruben-baez-seagull-com Apr 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/addons/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions pkg/drivers/kic/kic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions site/content/en/docs/drivers/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions site/content/en/docs/handbook/pushing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down