on macOS - minikube | kubectl | docker
saml2aws login #
saml2aws # Opt: configure. To configure user details.
export AWS_PROFILE=<my_profile> # Set default profile
minikube dashboard # Kubernetes GUI
kubectl config set-context $(kubectl config current-context) --namespace=<my_namesapace> # To set your default namespace:
klf <my_pod> | kubectl logs -f <my_pod>
# Tail ALL PODs label name for a given app. Also changes color when pod name changes / restarts
stern -l app=<my_app_name>
# Tail logs of PODs on a different name space
stern -l app=<my_app_name> -n <my_namespace_1>
stern -l app=<my_app_name> -n <my_namespace_2>
kubectl get namespaces | kubens
kubectl get nodes
kubectl get all # Show all pods and services:
kubens <my_namesapace> # Activate namespace to "my_namesapace"
kubectl describe pod <my_namesapace>
kubectl get pods | kgp
kubectl get pod <my_pod_id> #Get Pod details
kgp --show-labels # Get pod names and labels
kgp --show-labels -n <my_namesapace>
kubectl create deployment hello-node --image=<my_image>
kubectl get deployment # View the Deployment
brew update && \
brew install kubectl && \
brew cask install docker minikube virtualbox
# add the Minikube executable to your path if not already sorted by brew
sudo mv minikube /usr/local/bin
# Confirm version
docker --version #Docker version 18.09.2, build 6247962
docker-compose --version #docker-compose version 1.23.2, build 1110ad01
docker-machine --version # docker-machine version 0.16.1, build cce350d7
minikube version # minikube version: v1.0.0
kubectl version --client # Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-26T00:04:52Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"darwin/amd64"}
minikube stop; - delete this cluster
minikube delete; - delete this cluster
sudo rm -rf ~/.minikube ~/.kube ~/.kub;
brew uninstall kubectl;
brew cask uninstall docker virtualbox minikube;
minikube start - minikube start
#Change into kube system for secrets
kubens kube-system
# List all secrets in ns
kubectl get secrets
# output secret to yaml
kubectl get secrets <secret_name> -o yaml
# What k8s cluster am I using
kubectl config current-context
# View the kubectl configuration:
kubectl config view
# View cluster events:
kubectl get events
# List all of the releases.
helm list
# Test conn
aws s3 ls
# Test AWS CLI version
ecs-cli --version
# Test Kubectl version
kubectl version
- Overview of kubectl
- Official kubectl Cheat Sheet
- Official kubectl Commands
- Official Standardized Glossary
- See zshrc kubectl.plugin for aliases being set:
/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh
- AWS ECS CLI setup