Kubernates 3 Flashcards

1
Q

What does kubectl expose deployment k8s-web-hello --port=3000 do?

A

kubectl expose deployment k8s-web-hello tells kubernates to create a service that exposes the deployment named k8s-web-hello

--port=3000 is a flag that specifies the port on the service that will be exposed to the outside world.

kubectl expose deployment <name-of-deployment> --port=<port_number>
This command will create a service that routs trafic to the pods managed by the deployment

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

How would you list all the services currently running?

A

kubectl get svc

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

How would you scale a deployment to have more pods?

A

kubectl scale deployment <deployment_name> --replicas=<number_of_replica>
EXAMPLE: kubectl scale deployment k8s-app --replicas=4

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

What is load balancing?

A

Distributes incoming network Traffic across multiplebackend servers, in the case of kubernates it will be pods

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

How would you update a deployment image?

A

kubectl set image deployment <deployment_name> <new_deployment>
Kubernates conducts a rolling update.

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

What is a rolling update/how it works/why is it beneficial?

A

Rolling updates work by replacing instances of old versions with new ones.
If something goes wrong during deployment, kubernates can automaticly roll back all instances to the old version

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

What does kubctl rollout status deploy k8s-app do?

A

checks the rollout status of the deployment k8s-app

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

What happens if a pod is deleted in kubernates?

A

Kubernates will automaticly replace it

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

How to open the kubernates dashboard?

A

minikube dashboard

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

How would you delete all resources in the current namespace?

A

kuberctl delete all --all

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

Simple Kubernetese resources can be created with kubectl, however what could we use to create more complex ones?

A

Manifest files.
This is a YAML or JSON files that define resources such as pods, deployments and services.
These are used to create, update and delete resources

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