I found the below aliases to be easy to remember and save quite a lot of time.
alias ka="k apply"
alias kc="k create"
alias kd="k describe"
alias ke="k edit"
alias kg="k get"
alias kn="k config set-context --current --namespace"
alias kr="k run"
alias kt="kr tmp --image=nginx --rm -it --restart=Never -- curl"
Remember you have to memorize and define the aliases you want to use at the exam, so it has to be balanced.
Most probably you don't want too many and too advanced aliases since that will take time to type in during the exam.
Only the ones that are used a lot and will save time are good candidates.
Strictly speaking not an alias. I also exported an environment variable 'do' so I could type $do instead of '--dry-run=client -o yaml':
export do="--dry-run=client -oyaml"
So for instance to create yaml for an nginx deployment called webapp with 2 replicas using the above aliases would be
kc deploy webapp --image=nginx --replicas=2 $do>d.yml
which would create this d.yml:
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: webapp
name: webapp
spec:
replicas: 2
selector:
matchLabels:
app: webapp
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: webapp
spec:
containers:
- image: nginx
name: nginx
resources: {}
status: {}
You can see defined aliases using the 'alias' command.
Whenever you do labs setup the aliases you want to use so you get used to setting them up quickly.