Linux

kubernetes

newlibra 2024. 8. 18. 22:50

 

New-Item -Path 'c:\' -Name 'minikube' -ItemType Directory -Force
Invoke-WebRequest -OutFile 'c:\minikube\minikube.exe' -Uri 'https://github.com/kubernetes/minikube/releases/latest/download/minikube-windows-amd64.exe' -UseBasicParsing


$oldPath = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)
if ($oldPath.Split(';') -inotcontains 'C:\minikube'){
  [Environment]::SetEnvironmentVariable('Path', $('{0};C:\minikube' -f $oldPath), [EnvironmentVariableTarget]::Machine)
}



curl.exe -LO "https://dl.k8s.io/release/v1.31.0/bin/windows/amd64/kubectl.exe"


kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=8080

kubectl get deployments

kubectl get pods
NAME                          READY   STATUS    RESTARTS   AGE
hello-node-55fdcd95bf-brz7c   1/1     Running   0          26s

kubectl get events

kubectl config view

kubectl logs hello-node-55fdcd95bf-brz7c

kubectl expose deployment hello-node --type=LoadBalancer --port=8080

kubectl get services

minikube service hello-node