CKA Networking Flashcards

1
Q

How can you connect two hosts?

A

First you need a switch and, physical or virtual interfaces on the host, depending on the host

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

ip link

A

The command to see the network interfaces on a host

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

What do
ip addr add 192.168.1.10/24 dev eth0
ip addr add 192.168.1.11/24 dev eth0
do?

A

The command to assign IP addresses to hosts in a network with IP
192.168.1.0

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

How do two small networks with a switch in each of them talk to each other?

A

You need a router for that.
The router gets 1 IP from each network.

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

How do the devices on the network know which one is the router and they have to use it for communication with the other network?

A

Type “route” command
You will see the Kernel IP Routing Table
If there is no gateway there, your host does not know where the door is.

To configure gateway, you type

ip route add 192.168.2.0/24 via 192.168.1.1
This means for every host in the 192.168.2.0/24 network, use 192.168.1.1 as gateway (Which is my router’s IP in my network in this scenario)

You have to do this for all the hosts in the network.

Also, to direct every request outside of my network, we can simply say: use this router for every request outside of my network, internet, etc.

ip route add default via 192.168.2.1

If you see 0.0.0.0 in the gateway column, it means that destination is within our network and I don’t need a router.

These changes will not persist, so we need to set them in /etc/network/interfaces file.

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

What does these commands do?
ip link
ip addr
ip addr add
ip route or route
ip route add

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

How do you tell host A that a host named “hebele” is at IP 192.168.1.1?

A

You add it to /etc/hosts file
This is called name resolution

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

Where does the DNS server address stored in hosts?

A

In /etc/resolv.conf file
It first checks /etc/hosts file, if the name to resolve is not there, it checks the DNS server.

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

How do I query my DNS server for a specific domain?

A

nslookup www.google.com
This never checks the /etc/hosts file, always goes to DNS server

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

What other command is handy to test DNS name resolution?

A

dig www.google.com

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

Which command to create network namespace?

A

ip netns add red
ip netns add blue

Then check them with ip netns

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

How to check network interfaces in my network namespace?

A

For this, we need to run “ip link”, the command to list network interfaces within the network interface

ip netns exec red ip link

Same applies with arp tables and routing tables

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

How do you see arp tables?

A

arp

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

How do you see routing tables?

A

route

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

How do you list network interfaces?

A

ip link

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

What does IPAM stand for?

A

IP Address Management

16
Q

How can you inspect kubelet service?

A

ps -aux | grep -i kubelet
(it is a process)

17
Q

For kubernetes control plane, what is the path configured with all binaries of CNI supported plugins?

A

/etc/cni/bin

18
Q

How can you check which CNI plugin is configured on a kubernetes cluster?

A

ls /etc/cni/net.d/
This is going to tell us which CNI plugin is configured
And if you cat that file, you will see more details

19
Q

What is kubelet responsible for?

A

Creating pods. It is a process on each node and it watches kube-apiserver for the cluster.

20
Q

What is kube-proxy responsible for?

A

Creating services. kube-proxy also watches kube-apiserver for clusterwide changes.
Whenever a new service is created, kube-proxy assigns an IP address from a predefined range. kube-proxy creates forwarding rules (like IP address of service 10.99.13.178:80 is forwarded to this pod 10.244.1.2) in each node.
kube-proxy uses 3 different modes for that:
- userspace
- iptables
- ipvs
If not configured, it defaults to iptables.

21
Q

How is DNS resolution handled with the cluster, between pods and services?

A

By default, kubernetes providers its DNS solution (kube-dns / coredns)
But if you are setting up kubernetes manually, you need to install this.

22
Q

How does Kubernetes implement DNS?

A

Before k8s 1.12 versions, kubernetes deployed kube-dns but with 1.13, the recommended DNS solution is CoreDNS.
CoreDNS deploys 2 pods, and these pods run coredns executable. It also deploys one service called kube-dns that makes the DNS server reachable across the cluster, by all the pods.

cat /etc/coredns/Corefile

In this file, you can see different plugins (errors, health etc) for handling errors etc.
The same file is passed to the pod in a configmap object. So if you need to modify it, you can use this configmap: kubectl get configmap -n kubesystem —-> coredns

23
Q

How to check kubelet configuration?

A

cat /var/lib/kubelet/config.yaml