Skip to content

Instantly share code, notes, and snippets.

@babubalagani
babubalagani / kubernetes-rstypes-shortnames.md
Created September 24, 2019 02:55 — forked from harsha-y/kubernetes-rstypes-shortnames.md
Kubernetes Resourcetypes and their Shortnames
Resource type Abbreviated alias
clusters (valid only for federation apiservers)
componentstatuses cs
configmaps cm
daemonsets ds
deployments deploy
endpoints ep
events ev
horizontalpodautoscalers hpa
@babubalagani
babubalagani / kubectl-shortcuts.sh
Created September 24, 2019 06:05 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
Questions are not from any actual exam!!!
Q: Create a secret that has the following username password data:
username=missawesome
password=123kube321
Create a pod running nginx that has access to those data items in a volume mount path at /tmp/secret-volume
log into the nginx pod you created and list the items and cat the output of the data items to a file "credentials.txt"
@babubalagani
babubalagani / k8s-user-data.sh
Created January 29, 2020 07:13 — forked from initcron/k8s-user-data.sh
kubernetes user data script
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install \
apt-transport-https \
ca-certificates \
curl \