Skip to main content

Pregunta 14 - Información del Cluster

Question 14 | Find out Cluster Information

Use context: kubectl config use-context k8s-c1-H

You're ask to find out following information about the cluster k8s-c1-H: How many controlplane nodes are available? How many worker nodes are available? What is the Service CIDR? Which Networking (or CNI Plugin) is configured and where is its config file? Which suffix will static pods have that run on cluster1-node1? Write your answers into file /opt/course/14/cluster-info, structured like this:

/opt/course/14/cluster-info

1: [ANSWER] 2: [ANSWER] 3: [ANSWER] 4: [ANSWER] 5: [ANSWER]


kubectl config use-context k8s-c1-H
# Podemos obtener los nodos y verificar lo que tenemos para responder las dos primeras preguntas
k get node
NAME STATUS ROLES AGE VERSION
cluster1-controlplane1 Ready control-plane 27h v1.29.0
cluster1-node1 Ready <none> 27h v1.29.0
cluster1-node2 Ready <none> 27h v1.29.0
# 1 control plane y 2 workers

# Para verificar el Service CIDR. Estos valores son los mismos configurados en el pod static dentro del manifiesto /etc/kubernetes/manifest/kube-api-server. Solo estamos evitando la conexión ssh.
kubectl get pod -n kube-system kube-apiserver-cluster1-controlplane1 -o yaml | grep range
- --service-cluster-ip-range=10.96.0.0/12

ssh cluster1-controlplane1
# Para ver cuál es el plugin cni podemos hacer un ssh hacia adentro y verificar en /etc/cni/net.d o
root@cluster1-controlplane1:~# ls -lha /etc/cni/net.d/
10-weave.conflist

# Haciendo un cat en ese archivo podemos ver algo parecido a
root@cluster1-controlplane1:~# cat /etc/cni/net.d/10-weave.conflist | grep name
"name": "weave",

# El sufijo de un pod estático es siempre el nombre del propio nodo con un - delante.

Dentro del archivo /opt/course/14/cluster-info tenemos que colocar lo siguiente:

1: 1
2: 3
3: 10.96.0.0/12
4: weave, /etc/cni/net.d/10-weave.conflist
5: -cluster1-controlplane1