Cluster Maintenance Flashcards

1
Q

When you are conducting maintenance, how do you gracefully terminate a pod and recreate it on another node?

A

Drain the nodes

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

What is the command to drain a node?

A

k drain <node></node>

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

What is the command to allow a node to schedule pods after maintenance?

A

k uncordon <node></node>

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

What is the command to mark a node as unschedulable?

A

k cordon <node></node>

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

Can K8 components other than the kubectl be at a version higher than the kube-apiserver?

A

No

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

What is the first step of upgrading a cluster?

A

Upgrade the master cluster first. Worker nodes will not go down.

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

What are the kubeadm upgrade commands on a Debian based Linux node?

A

apt-get upgrade -y kubeadm=<version>
kubeadm upgrade apply <version></version></version>

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

What are the commands to upgrade the kubelet on a Debian based Linux node?

A

apt-get upgrade -y <kubelet_version>
systemctl restart kubelet</kubelet_version>

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

What is the command to backup all resources?

A

k get all –all-namespaces -oyaml > <filename>.yaml</filename>

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

What is the etcdctl command to create a snapshot?

A

etcdctl snapshot save <snapshot_name>.db</snapshot_name>

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

What is the process of restoring an ETCD snapshot?

A

service kube-apiserver stop
etcdctl restore <snapshot_name>.db
systemctl daemon-reload
service etcd restart
service kube-apiserver start</snapshot_name>

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

What is the etcdctl command to see the status of a snapshot?

A

etcdctl status <snapshot_name>.db</snapshot_name>

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

What is the command to get the clusters?

A

k config get-clusters

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

What command would you run to switch context to a different cluster named cluster1?

A

k config use-context cluster1

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

What command will show you the process for the kube-apiserver?

A

ps -ef | grep etcd

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

What is the etcdctl command to list the members (nodes)?

A

ETCDCTL_API=3 etcdctl \
–endpoints=https://127.0.0.1:2379 \
–cacert=/etc/etcd/pki/ca.pem \
–cert=/etc/etcd/pki/etcd.pem \
–key=/etc/etcd/pki/etcd-key.pem \
member list