Skip to content

Conversation

prezha
Copy link
Contributor

@prezha prezha commented May 31, 2025

fixes: #18825
fixes: #19878

before: as described in the issues listed above

after

$ minikube start -p kic --driver docker
$ minikube start -p kvm --driver kvm2
$ minikube profile list
|---------|-----------|---------|----------------|------|---------|--------|-------|----------------|--------------------|
| Profile | VM Driver | Runtime |       IP       | Port | Version | Status | Nodes | Active Profile | Active Kubecontext |
|---------|-----------|---------|----------------|------|---------|--------|-------|----------------|--------------------|
| kic     | docker    | docker  | 192.168.58.2   | 8443 | v1.33.1 | OK     |     1 |                | *                  |
| kvm     | kvm2      | docker  | 192.168.50.204 | 8443 | v1.33.1 | OK     |     1 |                |                    |
|---------|-----------|---------|----------------|------|---------|--------|-------|----------------|--------------------|

docker driver

$ minikube service list -p kic
|-------------|------------|--------------|-----|
|  NAMESPACE  |    NAME    | TARGET PORT  | URL |
|-------------|------------|--------------|-----|
| default     | kubernetes | No node port |     |
| kube-system | kube-dns   | No node port |     |
|-------------|------------|--------------|-----|
$ minikube service --all -p kic
|-----------|------------|-------------|--------------|
| NAMESPACE |    NAME    | TARGET PORT |     URL      |
|-----------|------------|-------------|--------------|
| default   | kubernetes |             | No node port |
|-----------|------------|-------------|--------------|
😿  service default/kubernetes has no node port
$ minikube service --all --url -p kic
😿  service default/kubernetes has no node port
$ kubectl --context=kic create deployment hello-minikube1 --image=kicbase/echo-server:1.0
deployment.apps/hello-minikube1 created
$ kubectl --context=kic expose deployment hello-minikube1 --type=NodePort --port=8080
service/hello-minikube1 exposed 
$ minikube service list -p kic
|-------------|-----------------|--------------|---------------------------|
|  NAMESPACE  |      NAME       | TARGET PORT  |            URL            |
|-------------|-----------------|--------------|---------------------------|
| default     | hello-minikube1 |         8080 | http://192.168.58.2:31243 |
| default     | kubernetes      | No node port |                           |
| kube-system | kube-dns        | No node port |                           |
|-------------|-----------------|--------------|---------------------------|
minikube service --all -p kic
|-----------|-----------------|-------------|---------------------------|
| NAMESPACE |      NAME       | TARGET PORT |            URL            |
|-----------|-----------------|-------------|---------------------------|
| default   | hello-minikube1 |        8080 | http://192.168.58.2:31243 |
|-----------|-----------------|-------------|---------------------------|
|-----------|------------|-------------|--------------|
| NAMESPACE |    NAME    | TARGET PORT |     URL      |
|-----------|------------|-------------|--------------|
| default   | kubernetes |             | No node port |
|-----------|------------|-------------|--------------|
😿  service default/kubernetes has no node port
🎉  Opening service default/hello-minikube1 in default browser...
$ minikube service --all --url -p kic
http://192.168.58.2:31243
😿  service default/kubernetes has no node port
$ minikube service hello-minikube1 --url -p kic
http://192.168.58.2:31243
$ minikube service hello-minikube1 -p kic
|-----------|-----------------|-------------|---------------------------|
| NAMESPACE |      NAME       | TARGET PORT |            URL            |
|-----------|-----------------|-------------|---------------------------|
| default   | hello-minikube1 |        8080 | http://192.168.58.2:31243 |
|-----------|-----------------|-------------|---------------------------|
🎉  Opening service default/hello-minikube1 in default browser...

kvm driver

$ minikube service list -p kvm
|-------------|------------|--------------|-----|
|  NAMESPACE  |    NAME    | TARGET PORT  | URL |
|-------------|------------|--------------|-----|
| default     | kubernetes | No node port |     |
| kube-system | kube-dns   | No node port |     |
|-------------|------------|--------------|-----|
$ minikube service --all -p kvm
|-----------|------------|-------------|--------------|
| NAMESPACE |    NAME    | TARGET PORT |     URL      |
|-----------|------------|-------------|--------------|
| default   | kubernetes |             | No node port |
|-----------|------------|-------------|--------------|
😿  service default/kubernetes has no node port
$ minikube service --all --url -p kvm
😿  service default/kubernetes has no node port
$ kubectl --context=kvm create deployment hello-minikube1 --image=kicbase/echo-server:1.0
deployment.apps/hello-minikube1 created
$ kubectl --context=kvm expose deployment hello-minikube1 --type=NodePort --port=8080
service/hello-minikube1 exposed
$ minikube service list -p kvm
|-------------|-----------------|--------------|-----------------------------|
|  NAMESPACE  |      NAME       | TARGET PORT  |             URL             |
|-------------|-----------------|--------------|-----------------------------|
| default     | hello-minikube1 |         8080 | http://192.168.50.204:31145 |
| default     | kubernetes      | No node port |                             |
| kube-system | kube-dns        | No node port |                             |
|-------------|-----------------|--------------|-----------------------------|
minikube service --all -p kvm
|-----------|-----------------|-------------|-----------------------------|
| NAMESPACE |      NAME       | TARGET PORT |             URL             |
|-----------|-----------------|-------------|-----------------------------|
| default   | hello-minikube1 |        8080 | http://192.168.50.204:31145 |
|-----------|-----------------|-------------|-----------------------------|
|-----------|------------|-------------|--------------|
| NAMESPACE |    NAME    | TARGET PORT |     URL      |
|-----------|------------|-------------|--------------|
| default   | kubernetes |             | No node port |
|-----------|------------|-------------|--------------|
😿  service default/kubernetes has no node port
🎉  Opening service default/hello-minikube1 in default browser...
$ minikube service --all --url -p kvm
http://192.168.50.204:31145
😿  service default/kubernetes has no node port
$ minikube service hello-minikube1 --url -p kvm
http://192.168.50.204:31145
$ minikube service hello-minikube1 -p kvm
|-----------|-----------------|-------------|-----------------------------|
| NAMESPACE |      NAME       | TARGET PORT |             URL             |
|-----------|-----------------|-------------|-----------------------------|
| default   | hello-minikube1 |        8080 | http://192.168.50.204:31145 |
|-----------|-----------------|-------------|-----------------------------|
🎉  Opening service default/hello-minikube1 in default browser...

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 31, 2025
@k8s-ci-robot k8s-ci-robot requested review from medyagh and spowelljr May 31, 2025 23:50
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 31, 2025
@medyagh
Copy link
Member

medyagh commented Jun 3, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 3, 2025
for _, svc := range noNodePortServices {
noNodePortSvcNames = append(noNodePortSvcNames, fmt.Sprintf("%s/%s", svc.Namespace, svc.Name))
}
out.WarningT("Services {{.svc_names}} have type \"ClusterIP\" not meant to be exposed, however for local development minikube allows you to access this !", out.V{"svc_names": noNodePortSvcNames})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this PR, I think @prezha this warning should be printed for all drivers, no ?
the idea was educatiing the users that clusterIP services are not meant to be exposed, and this is an exception for learning DONT get used to it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes, good catch, thanks @medyagh !
i've put the warning back outside of driver check, so it should print for all of them

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20863) |
+----------------+----------+---------------------+
| minikube start | 53.0s    | 53.1s               |
| enable ingress | 16.1s    | 15.6s               |
+----------------+----------+---------------------+

Times for minikube (PR 20863) start: 55.7s 51.9s 54.3s 51.2s 52.2s
Times for minikube start: 52.7s 53.8s 49.6s 55.9s 52.8s

Times for minikube ingress: 16.1s 16.6s 16.1s 15.6s 16.1s
Times for minikube (PR 20863) ingress: 16.1s 15.7s 15.0s 16.2s 15.1s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20863) |
+----------------+----------+---------------------+
| minikube start | 24.8s    | 24.6s               |
| enable ingress | 12.9s    | 12.0s               |
+----------------+----------+---------------------+

Times for minikube start: 25.3s 24.2s 23.9s 26.3s 24.2s
Times for minikube (PR 20863) start: 25.0s 26.0s 24.6s 23.9s 23.7s

Times for minikube ingress: 13.4s 12.3s 12.3s 13.3s 13.4s
Times for minikube (PR 20863) ingress: 12.4s 12.3s 12.8s 12.3s 10.3s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 20863) |
+-------------------+----------+---------------------+
| minikube start    | 24.2s    | 22.5s               |
| ⚠️  enable ingress | 26.0s    | 34.4s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube start: 27.1s 25.5s 23.6s 22.4s 22.6s
Times for minikube (PR 20863) start: 22.7s 22.4s 21.9s 23.0s 22.3s

Times for minikube ingress: 38.8s 22.8s 22.8s 22.8s 22.8s
Times for minikube (PR 20863) ingress: 31.3s 40.3s 38.9s 38.8s 22.8s

@medyagh medyagh self-requested a review June 3, 2025 22:46
@medyagh
Copy link
Member

medyagh commented Jun 4, 2025

/lgtm

@medyagh medyagh merged commit 945b436 into kubernetes:master Jun 4, 2025
20 of 34 checks passed
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, prezha

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

service command executes wrong helper service command errors with kvm2 driver on Debian Testing
4 participants