From 9c08a281b9c662f28b68229c31cc65d4607ed95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Wed, 23 Oct 2024 22:16:34 +0200 Subject: [PATCH] Add Windows info to READMEs --- README.md | 33 +++++++++++++++++++++++++++------ deploy_sample/README.md | 17 ++++++++++++++++- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6a4c65f..2038419 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,45 @@ # kubernetes-samples -Kubernetes use case samples +Kubernetes use case samples using [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download) -All the samples are done using [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download) +## Install minikube Linux -## Install minikube ```bash curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm sudo rpm -Uvh minikube-latest.x86_64.rpm ``` -## Install kubernetes client tools +### Install kubernetes client tools ```bash sudo dnf install kubernetes-client ``` -### In Fedora is needed the dockerx plugin +#### In Fedora is needed the dockerx plugin ```bash sudo dnf install docker-buildx-plugin -``` \ No newline at end of file +``` + +## Install minikube Windows + +```powershell +Invoke-WebRequest -OutFile 'c:\minikube\minikube.exe' -Uri 'https://github.com/kubernetes/minikube/releases/latest/download/minikube-windows-amd64.exe' -UseBasicParsing +``` + +and as Administrator + +```powershell +$oldPath = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine) +if ($oldPath.Split(';') -inotcontains 'C:\minikube'){ +> [Environment]::SetEnvironmentVariable('Path', $('{0};C:\minikube' -f $oldPath), [EnvironmentVariableTarget]::Machine) +``` + +### Install kubernetes client tools + +```powershell +Invoke-WebRequest -OutFile 'c:\minikube\kubectl.exe' -Uri 'https://dl.k8s.io/release/v1.31.0/bin/windows/amd64/kubectl.exe' -UseBasicParsing +``` + + diff --git a/deploy_sample/README.md b/deploy_sample/README.md index ae77341..6527ae8 100644 --- a/deploy_sample/README.md +++ b/deploy_sample/README.md @@ -23,15 +23,30 @@ kubectl apply -f 01-my-app-deployment.yaml kubectl get all # This should show the 3 pods with status Running ``` -## Start service and connect +## Start service ```bash kubectl apply -f 02-my-app-service-node-port.yaml kubectl get all # There should be a service called my-app-service as LoadBalancer +``` + +## Connect to the service + +Do one of the following: + +```bash minikube service my-app-service # This should open a browser window with Hello World message # If end the url with /ip the message should show the ip of the server that answered the petition ``` +or + +```bash +minikube tunnel # This should create a network route on the host to the service +# Just open a browser and navigate to http://127.0.0.1 +``` + + ## Stop everything ```bash