-
list namespaces
kubectl get namespace
-
switch to demo namespace
kubectl config set-context devenv --namespace=demo
-
list pods
kubectl get pods
-
list deployment configuration files (yaml)
cd ~/eventbrite/docker-dev/kubernetes/ && ls -l | grep yaml
-
deploy containers (bay up equivalent)
kubectl apply -f .
Note: Each container is being started in a seperate pod. These are being run in certified K8s cloud infra - Amazon EKS
-
list pods and their statuses
kubectl get pods
Note: These commands are kubectl tool's low-level commands. A lighter tool on top of kubectl will be provided that has similar or better abstraction level than bay.
-
shell into a container (bay shell equivalent)
kubectl exec -ti core-web-76745bc545-brxtf bash
-
tail logs (bay tail ... equivalent)
kubectl logs -f core-web-76745bc545-brxtf
-
setup dashboard for monitoring
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml kubectl proxy
Note: To switch to dashboard of a diff namespace, edit namespace value in url http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=demo
-
open dashboard
-
forward remote port to your local
kubectl port-forward deployment/core-web 4443:443
-
proxy local traffic from 443 to 4443
sudo socat tcp-l:443,fork,reuseaddr tcp:127.0.0.1:4443
-
Open https://www.evbdev.com in browser
- rsync (bay mount equivalent)
oc rsync -w --exclude=js,django/media/django,.git ~/eventbrite/core core-web-76745bc545-brxtf:/srv/core