Chapter 3. Deploying a Kubernetes Cluster Flashcards

1
Q

how do you create a local cluster ?

A

minikube start

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

how do you stop the local cluster ?

A

minikube stop

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

how do you remove the cluster ?

A

minikube delete

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

how do we we check cluster status ?

A

kubeclt version

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

how do we get a simple diagnostic for the cluster ?

A

kubectl get componentstatuses

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

how do you list all the nodes in your cluster ?

A

kubectl get nodes

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

how do you get more information about a node ?

A

kubectl describe nodes node-1

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

What does Kubernetes proxy do ?

A

The Kubernetes proxy is responsible for routing network traffic to load-balanced services in the Kubernetes cluster. To do its job, the proxy must be present on every node in the cluster.

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

how can you list the proxies ?

A

kubectl get daemonSets –namespace=kube-system kube-proxy

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

what is a Kubernetes DNS ?

A

A Kubernetes DNS provides naming and discovery for the services that are defined in the cluster. This DNS server also runs as a replicated service on the cluster

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

How can you get information about the Kubernetes DNS Server ?

A

kubectl get deployments –namespace=kube-system core-dns

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

how can you start Kubernetes GUI ?

A

kubectl get deployments –namespace=kube-system kubernetes-dashboard
or
kubectl proxy

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

How can you change the default namespace more permanently ?

A
  1. First create a context
    kubectl config set-context my-context –namespace=mystuff
  2. Sedond, use the context
    kubectl config use-context my-context
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the most basic command to for viewing Kubernetes objects ?

A

kubectl get

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

How can you get more detailed information about an objetct

A
  1. Adding: -o
  2. Adding: -o json
  3. Adding: -o yaml
  4. kubectl describe
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you create objects in Kubernetes stored in yml file ?

A

kubectl apply -f obj.yaml

17
Q

How can you edit objects in Kubernetes stored in yml file ?

A

kubectl apply -f obj.yaml

18
Q

how can you use the apply command without making any changes ?

A

–dry-run

19
Q

How can you make interactive edits ?

A

kubectl edit

20
Q

How can you view the history of changes applied ?

A

kubectl apply -f myobj.yaml [ edit-last-applied | set-last-applied | view-last-applied }

21
Q

how can you delete an object using yaml files ?

A

kubectl delete -f obj.yaml

22
Q

how can you delete an object ?

A

kubectl delete

23
Q

What command do you use to create labels ?

A

kubectl label pods bar color=red

24
Q

What command do you use to create annotations ?

A

kubectl annotations pods bar color=red

25
How can you delete a label ?
kubectl label pods bar color-
26
How can you edit a label ?
Adding: -overwrite flag
27
How can you debug a container ?
kubectl logs
28
What flag do you need if you want continuously streams the logs ?
Adding: -f
29
How can you execute a command in a running container ?
kubectl exec -it -- bash
30
What command do you need if you don't have a bash or some other terminal ?
kubectl attach -it
31
how can you copy files to and from a container ?
kubectl cp :
32
how can you access your pod via the network ?
kubectl port-forward 8080:80
33
how can you check how your cluster is using resources ?
kubectl top nodes similar this command kubectl top pods