Using Minikube
Deployment handles Replica,
Replica handles Pods
Start Minikube
minikube start
Check IP Address
minikube ip
To run all yml files
kubectl apply -f .
To check status
kubectl get all
To Delete pods
kubectl delete po --all
** To delete every resources in a file **
kubectl delete -f file.yml
pod = po
kubectl describe po name
service = svc
kubectl describe svc name
replicaSet = rs
kubectl describe rs name
To check history
kubectl rollout history deploy webapp
To check status
kubectl rollout status deploy webapp
** Example **
Types:
- NodePort
For Exposing it externally (like browser)
apiVersion: v1
kind: Service
metadata:
name: fleetman-position-tracker
spec:
selector:
app: position-tracker
ports:
- name: http
port: 8080 # Container PORT
nodePort: 30020 # External PORT
type: NodePort
- ClusterIP
For internal Use only, and you cannot specify a
nodePort
apiVersion: v1
kind: Service
metadata:
name: fleetman-position-tracker
spec:
selector:
app: position-tracker
ports:
- name: http
port: 8080 # Container PORT
type: ClusterIP
Here are some of the troubles that I have experienced during development/deployment
If minikube is not starting
minikube delete
minikube start
If the problem persist, try uninstalling and re-installing
brew cask uninstall minikube
brew cask install minikube