Kubernetes Terminology
- Nodes
- Hosts that run Kubernetes applications
- Containers
- Units of packaging
- Pods
- Units of deployment
- Replication Controller
- Ensures availability and scalability
- Labels
- Key-Value pairs for identification
- Services
- Collection of pods exposed as an endpoint
Simple Deployment
Deployment->Service
kubectl run my-web –image=nginx –port=80
kubectl get deployments
devpc:~ apocoder$ kubectl run my-web –image=nginx –port=80
deployment.apps “my-web” created
devpc:~ apocoder$ kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
my-web 1 1 1 1 1m
devpc:~ apocoder$
devpc:~ apocoder$ kubectl get pods
NAME READY STATUS RESTARTS AGE
my-web-857d97b7cd-k754z 1/1 Running 0 2m
kubectl get svc
PORT=$(kubectl get svc my-web -o go-template='{{(index .spec.ports 0).nodePort}}’)
echo $PORT
30890
minikube ip
192.168.99.101
then visit the -> http://192.168.99.101:30890
minikube dashboard
Perfect! You successfully deployed your nginx!
Advertisements