Add Windows info to READMEs

This commit is contained in:
2024-10-23 22:16:34 +02:00
parent 654fa6e4b1
commit 9c08a281b9
2 changed files with 43 additions and 7 deletions

View File

@@ -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
```
```
## 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
```

View File

@@ -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