Github CrashCourse Flashcards

1
Q

How to run an actual shell on a pod container?

A

kubectl exec mypod -it – /bin/sh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to get IP Address of pod?

A

kubectl describe mypod

OR

kubectl get pods -o wide

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to run temporary pod interactively?

A

kubectl run busybox –image=busybox –rm -it –restart=Never -n ckad-prep – /bin/sh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

kubectl interactive flag?

A

-it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

kubectl temporary flag?

A

–rm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

2 types of secret?

A

data, stringData

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

location of service account token?

A

/var/run/secrets/kubernetes.io/serviceaccount

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how to set namespace of pod?

A

either within manifest file of pod OR via -n flag of kubectl apply

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to make a pod named ‘backend’ with serviceaccount called ‘backend-team’?

A

kubectl run backend –image=nginx –restart=Never –serviceaccount=backend-team

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how to make a serviceaccount named ‘backend-team’?

A

kubectl create serviceaccount backend-team

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

flag to not restart when using ‘run’ command?

A

–restart=Never

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how to ssh into a single container of multi-container pod?

A

–container=containerName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how to show labels AND specify more than one label?

A

kubectl get pods -l ‘team in (shiny, legacy)’,env=prod –show-labels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly