Setup kuberntes local environment with minikube
Setup kuberntes local environment with minikube:
- Pre-requisite
- Minikube – Install on
your local (instructions below)
- Docker – Install on
your local
- Azure Subscription
Access – “playground” as a contributor.
- Azure VM Access:
i.
Access is with your Azure
Cloud Shell.
- Use storage account
cloudpsocap in resource group " playground-rg”.
ii.
Upload attached PEM file to
your cloud bash. https://devcoops.com/how-to-upload-files-to-azure-cloud-shell/
iii.
Execute to Ssh to the
VM - ssh -I <file.pem> azureuser@linuxtrainingvm.centralus.cloudapp.azure.com
- Instructions on how to
install Minikube.
- Open PowerShell with
administrator privilege
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
- Open CMD with
Administrator privilege and execute below
set
HTTP_PROXY=http://genproxy.org.com:8080
set
HTTPS_PROXY=http://genproxy.org.com:8080
set
NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.59.0/24,192.168.39.0/24
{/path/to/Minikube}/Minikube.exe
start or copy Minikube.exe to C:\Windows\System32 folder.
- Also download kubectl https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/
and copy it in C:\Windows\System32 dir.
kubectl version --client
kubectl version --client --output=yaml
kubectl cluster-info # To verify kubectl configuration
pod.yaml file
apiVersion: v1 kind: Pod metadata: name: pod-demo spec: containers: - name: nginx image: nginx ports: - containerPort: 80 resources: limits: cpu: 50m memory: 100Mi requests: cpu: 50m memory: 100Mi
podp.yaml file:
apiVersion: apps/v1 kind: Deployment metadata: name: premium-pod-demo labels: app: premium spec: replicas: 2 selector: matchLabels: app: premium template: metadata: labels: app: premium spec: containers: - name: demo image: nginx:1.14.2 ports: - containerPort: 80 resources: limits: cpu: 50m memory: 100Mi requests: cpu: 50m memory: 100Mi
kubectl apply -f pod.yaml
kubectl describe pod
kubectl apply -f
podp.yaml
kubectl apply -f podp.yaml && kubectl get pods -w
kubectl get deploy
kubectl scale
deployment/premium-pod-demo --replicas=5
kubbectl get pods
kubectl scale deployment/premium-pod-demo --replicas=2
kubectl get deploy
Comments
Post a Comment