devops:docker:kubernetes:tutorial-win-minikube
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devops:docker:kubernetes:tutorial-win-minikube [2024/06/19 19:58] – skipidar | devops:docker:kubernetes:tutorial-win-minikube [2024/07/24 20:22] (current) – skipidar | ||
---|---|---|---|
Line 9: | Line 9: | ||
- | == Use == | + | == After restart - make sure its running == |
+ | Make sure docker desktop is running after restart | ||
+ | |||
+ | {{https:// | ||
+ | |||
+ | == Use minikube | ||
<sxh> | <sxh> | ||
Line 25: | Line 30: | ||
kubectl get po -A | kubectl get po -A | ||
</ | </ | ||
+ | |||
+ | == Prefix " | ||
+ | |||
+ | To avoid " | ||
+ | |||
+ | it is important to use | ||
<sxh> | <sxh> | ||
- | minikube kubectl -- get po -A | + | minikube kubectl -- <YOU KUBECTL PARAMS> |
+ | minikube kubectl | ||
+ | minikube kubectl -- create deployment demo-consume-api --image=ghcr.io/ | ||
</ | </ | ||
+ | == " | ||
+ | |||
+ | Use the alias on Linux | ||
<sxh> | <sxh> | ||
alias kubectl=" | alias kubectl=" | ||
</ | </ | ||
+ | |||
+ | Use the functions on Windows powershell | ||
+ | <sxh> | ||
+ | function kubectl { | ||
+ | param( | ||
+ | [Parameter(Mandatory = $false)] | ||
+ | [string] $arguments | ||
+ | ) | ||
+ | minikube kubectl -- $arguments | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <sxh> | ||
+ | minikube kubectl -- get po -A | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
Line 42: | Line 76: | ||
{{https:// | {{https:// | ||
{{https:// | {{https:// | ||
+ | |||
+ | |||
+ | |||
+ | == On Minikube - open a port to listen on your Windows machine == | ||
+ | |||
+ | Assume you earlier created some **deployment** | ||
+ | |||
+ | <sxh shell> | ||
+ | minikube kubectl -- create deployment demo-consume-api --image=ghcr.io/ | ||
+ | </ | ||
+ | |||
+ | This application is running on port '' | ||
+ | |||
+ | Then to expose the deployment | ||
+ | |||
+ | <sxh shell> | ||
+ | minikube service list | ||
+ | |----------------------|---------------------------|--------------|-----| | ||
+ | | NAMESPACE | ||
+ | |----------------------|---------------------------|--------------|-----| | ||
+ | | default | ||
+ | | default | ||
+ | | kube-system | ||
+ | | kubernetes-dashboard | dashboard-metrics-scraper | No node port | | | ||
+ | | kubernetes-dashboard | kubernetes-dashboard | ||
+ | |----------------------|---------------------------|--------------|-----| | ||
+ | |||
+ | |||
+ | # pick the service deployment | ||
+ | # its on port 8080 | ||
+ | # now make a port exposed | ||
+ | |||
+ | minikube service --url demo-consume-api | ||
+ | http:// | ||
+ | ❗ Because you are using a Docker driver on windows, the terminal needs to be open to run it. | ||
+ | |||
+ | # other terminal you now can | ||
+ | curl http:// | ||
+ | |||
+ | </ | ||
+ | |||
devops/docker/kubernetes/tutorial-win-minikube.1718827083.txt.gz · Last modified: by skipidar