-
To run in local install minikube and kubectl
-
Copy .k8s/secret.yaml.txt to .k8s/secret.yaml and configure it
-
Start minikube
minikube start
- Enable ingress controller
minikube addons enable ingress
- Execute
sh .k8s/apply.sh
- Serve app:
minikube service languages-app-api-service --url
When we will need to push the image to docker hub we will need this commands:
docker login
docker build -t mapeveri/languages:latest .
docker tag mapeveri/languages:latest mapeveri/languages:latest
docker push mapeveri/languages:latest
- Copy .k8s/secret.yaml.txt to .k8s/secret.yaml and configure it
echo -n "my-secret" | base64
-
Nodes:
kubectl get nodes -o wide # Get internal IP
-
Pods:
kubectl get pods -n default # Get pods from default namespace
-
Deployments:
kubectl get deployment # Deployment status
-
Services:
kubectl get service # Service status
-
Pod:
kubectl describe pod app # Pod details
-
Service:
kubectl describe svc app # Service details
- Rollout Restart:
kubectl rollout restart deployment/languages # Restart pods
- Config Map:
kubectl get configmap app-config -o yaml # Config map details
-
Access Shell:
kubectl exec -it app -- /bin/bash # Enter the pod
-
List Environment Variables:
kubectl exec -it app -- env # List pod environment variables
-
Container Logs:
kubectl logs app # View container logs
-
Create secret:
kubectl create secret generic languages-app-secret --from-literal=GOOGLE_CLIENT_ID=password
-
Delete secret:
kubectl delete secret languages-app-secret
-
Display secret value:
kubectl get secret languages-secret -n default -o jsonpath="{.data.GOOGLE_CLIENT_ID}" | base64 --decode
-
Get ingress:
kubectl get ingress
-
Get pods ingress:
kubectl get pods -n ingress-nginx