rights reserved. Open source container management platform Helps you run containers at scale Gives you primitives for building modern applications What is Kubernetes?
rights reserved. Hands-on! – Lab 1 AWS Workshop for Kubernetes 1. Create an EKS cluster 1. Follow the instructions at https://eksworkshop.com (beginner) 2. Use eksctl https://eksctl.io (advanced) 3. Follow the EKS docs https://docs.aws.amazon.com/eks/latest/userguide/getting- started.html (the “hard“ way)
rights reserved. Understanding deployments # Columnar output ❯ kubectl get services # List all services in the namespace ❯ kubectl get pods --all-namespaces # List all pods in all namespaces ❯ kubectl get pods -o wide # List all pods in the namespace, with details ❯ kubectl get rc <rc-name> # Get a replication controller # Verbose output ❯ kubectl describe nodes <node-name> ❯ kubectl describe pods <pod-name> ❯ kubectl describe pods/<pod-name> # Equivalent to previous ❯ kubectl describe pods <rc-name> # Lists pods created by<rc-name>using common prefix # List Services Sorted by Name ❯ kubectl get services --sort-by=.metadata.name # Get ExternalIPs of all nodes ❯ kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
rights reserved. Interacting with Pods ❯ kubectl logs <pod-name> # dump pod logs (stdout) ❯ kubectl logs –f <pod-name> # stream pod logs (stdout) ❯ kubectl run –i --tty busybox—image=busybox -- sh # Run pod as interactive shell ❯ kubectl attach <podname> -i # Attach to Running Container ❯ kubectl port-forward <podname> <local>:<remote> # Forward port of Pod to localhost ❯ kubectl port-forward <servicename><port> # Forward port to service ❯ kubectl exec <pod-name> -- ls / # Run command in existing pod (1 container case) ❯ kubectl exec <pod-name> -c <container-name> -- ls /
rights reserved. Kubernetes Dashboard • General purpose web-based UI for Kubernetes clusters • Manage applications running in the cluster • Manage the cluster
rights reserved. Prometheus, Node exporter, and Grafana • Prometheus: • Open-source systems monitoring and alerting toolkit • Collects metrics from monitored targets by scraping metrics from HTTP endpoints • Dynamically scrape new targets by adding a ServiceMonitor • Grafana: • Open source, feature rich metrics dashboard and graph editor • Node exporter:
rights reserved. X-Ray for Kubernetes AWS X-Ray X-Ray DaemonSet X-Ray trace k8s nodes running pods Service A Service B Client HTTP Requests AWS Console