3.3 Troubleshoot Containers and Pods Flashcards
(8 cards)
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
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
Que hacen los comandos de oc para
oc status
oc rsync
oc rsh
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
Como se puede establecer el editor que quieres utilizar
KUBE_EDITOR or the EDITOR environment variable
Como se modifica un recurso de openshift que tiene contenedores en linea
oc patch pod valid-pod –type=’json’ \
-p=’[{“op”: “replace”, “path”: “/spec/containers/0/image”, \
“value”:”http://registry.access.redhat.com/ubi8/httpd-24”}]’
Como se copia el archivo /var/www/html/index.html del contenedor apache-app-kc82c a la ruta /tmp/index.bak
oc cp apache-app-kc82c:/var/www/html/index.html /tmp/index.bak
Como se hace port forward con puerto 8080 de host contra el 80 del contenedor nginx-app-cc78k en openshift
oc port-forward nginx-app-cc78k 8080:80
Como se puede conectar al container tomcat-app-jw53r por rsh
oc rsh tomcat-app-jw53r
De que modo aparte de rsh pueden ejecutarse comandos en un contenedor contenedor con comando ls /
oc exec -it mariadb-lc78h – ls /