Tips Flashcards
Set an alias for ‘kubectl’
alias k=kubectl
Generate a declarative configuration file for a pod using an imperative command
kubectl run p1 –image=nginx –restart=Never –dry-run=client -o yaml > p1.yaml
Generate a declarative configuration file for a deployment using an imperative command
k run d1 –image=nginx –dry-run -o yaml > d1.yaml
Generate a declarative configuration file for a job using an imperative command
kubectl run j1 –image=nginx –restart=OnFailure –dry-run=client -o yaml > j1.yaml
Generate a declarative configuration file for a cronjob using an imperative command
kubectl run cj1 –image=nginx –restart=OnFailure –schedule=”*/1 * * * *” –dry-run=client -o yaml > cj1.yaml
Shortcut (alias) for configmaps?
cm
Shortcut (alias) for namespaces?
ns
Shortcut (alias) for nodes?
nodes
(trick question, there is no shortcut)
Shortcut (alias) for persistent volume claims?
pvc
Shortcut (alias) for persistent volumes?
pv
Shortcut (alias) for pods?
po
Shortcut (alias) for statefulsets?
sts
Shortcut (alias) for resource quotas?
quota
Shortcut (alias) for service accounts?
sa
Shortcut (alias) for services?
svc