03 - KUBERNETES Flashcards

1
Q

What is kubernetes ?

A

kubernetes is s tool for running a bunch of different containers

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

how des kubernetes manage the containers

A

it gets s configuration to describe how we want our containers to run and interect with each other

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

enable kubernetes from UI for mac

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

how to install k8s in linux

A

minikube

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

what is a k8s cluster

A

a collection of nodes + a master to manage them

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

Node on k8s

A

a virtual machine that will run our containers

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

Pod in k8s

A

more or less a running container

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

Deployment

A

monitors a set of pods, make sure they are running and restarts them if they crash

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

service

A

provides an easy-to-remember URL to access a running container

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

function of the k8s config file

A

tells k8s about the different deployments, pods, and services, referred to as objects

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

sample k8s config file to create a Pod

A

build docker image
filename: posts.yaml

apiVersion: v1
kind: Pod
metadata:
name: posts
spec:
containers:
- name: posts
image: tagName/posts:0.0.1

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

command to execute k8s config

A

kubectl apply -f posts.yaml

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

display all pods

A

kubectl get pods

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

how k8s handle latest tag on image name

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

run command in pod

A

kubectl exec -it [pod-name] [cmd]

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

show k8s logs

A

kubectl logs [pod_name]

17
Q

delete pod

A

kubectl delete pod [pod_name]

18
Q

describe pod

A

kubectl describe pod [pod_name]

19
Q

config file, creating a deployment

A

apiVersion: v1
kind: Deployment
metadata:
name: posts-depl
spec:
replicas: 1
selector:
matchlabels:
app: posts
template:
metadata:
labels :
app: posts
spec:
containers:
- name: posts
image: [tagename/posts:0.0.1]

20
Q

list all deployments

A

kubectl get deployments

21
Q

print out details about a specific deployment

A

kubect; describe deployment [depl name]

22
Q

create a deployment out of a config file

A

kubectl apply -f [config file name]

23
Q

delete a deployment

A

kubectl delete deployment [depl-name]

24
Q

updating the image used by a deployment

A

kubectl rollout restart deployment posts-depl

25
Q

types of k8s services

A

cluster IP
node port
load balancer
external name

26
Q

cluster IP

A

sets up an easy-to-remember URL to access a pod, only exposes pod to cluster

27
Q

node port

A

makes a pod accessible from outside the cluster, usually only for dev’t

28
Q

load balancer

A

makes a pod accessible from outside the cluster

29
Q

external name

A

redirects an in-cluster request to a CNAME url

30
Q

sample k8s config to create a service

A

apiVersion: v1
kind: Service
metadata:
name: posts-srv
spec:
type: NodePort
selector:
app: posts
ports:
- name: posts
protocol: TCP
port: 4000
targetPort: 4000

31
Q

steps to create a deployment for the event-bus

A
  • build an image for the event bus
  • push image to docker hub
  • create a deployment for event-bus
  • create a cluster IP service for event bus and posts
32
Q

ingress-nginx config file

A

apiVersion: networking.k8s.io/vqbeta1
kind: Ingress
metadata:
name: ingress-srv
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: posts.com
http:
paths:
- path: /posts
backend:
serviceName: posts-clusterip-srv
servicePost: 4000

32
Q

ingress-nginx install guide

A
33
Q

what is the use of skaffold

A

automates many tasks in a k8s dev environment
makes it easy to update code in a running pod
makes it easy to create/delete all objects tied to a project at once

34
Q
A