3.3 Troubleshoot Containers and Pods Flashcards

1
Q

Que hace cada uno de los comandos de kubernetes

kubectl describe
kubectl edit
kubectl patch
kubectl replace
kubectl cp
kubectl exec
kubectl explain
kubectl port-forward
kubectl logs

A

The kubectl CLI provides the following commands:

kubectl describe: Display the details of a resource.

kubectl edit: Edit a resource configuration by using the system editor.

kubectl patch: Update a specific attribute or field for a resource.

kubectl replace: Deploy a new instance of the resource.

kubectl cp: Copy files and directories to and from containers.

kubectl exec: Execute a command within a specified container.

kubectl explain: Display documentation for a specified resource.

kubectl port-forward: Configure a port forwarder for a specified container.

kubectl logs: Retrieve the logs for a specified container

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

Que hacen los comandos de oc para
oc status
oc rsync
oc rsh

A

oc status: Display the status of the containers in the selected namespace.

oc rsync: Synchronize files and directories to and from containers.

oc rsh: Start a remote shell within a specified container

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

Como se puede establecer el editor que quieres utilizar

A

KUBE_EDITOR or the EDITOR environment variable

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

Como se modifica un recurso de openshift que tiene contenedores en linea

A

oc patch pod valid-pod –type=’json’ \
-p=’[{“op”: “replace”, “path”: “/spec/containers/0/image”, \
“value”:”http://registry.access.redhat.com/ubi8/httpd-24”}]’

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

Como se copia el archivo /var/www/html/index.html del contenedor apache-app-kc82c a la ruta /tmp/index.bak

A

oc cp apache-app-kc82c:/var/www/html/index.html /tmp/index.bak

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

Como se hace port forward con puerto 8080 de host contra el 80 del contenedor nginx-app-cc78k en openshift

A

oc port-forward nginx-app-cc78k 8080:80

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

Como se puede conectar al container tomcat-app-jw53r por rsh

A

oc rsh tomcat-app-jw53r

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

De que modo aparte de rsh pueden ejecutarse comandos en un contenedor contenedor con comando ls /

A

oc exec -it mariadb-lc78h – ls /

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