yuran3391·2023년 2월 1일


목록 보기
  • Get the list of nodes in JSON format and store it in a file at /opt/outputs/nodes-z3444kd9.json.
  • info_outlineSolution Run the command: kubectl get nodes -o json > /opt/outputs/nodes-z3444kd9.json
    • nfo_outlineQuestion Create a service messaging-service to expose the messaging application within the cluster on port 6379. Use imperative commands.
    • info_outlineSolution Run the command: kubectl expose pod messaging --port=6379 --name messaging-service
      • info_outlineQuestion Create a POD in the finance namespace named temp-bus with the image redis:alpine.
      • info_outlineSolution Run the command: kubectl run temp-bus --image=redis:alpine --namespace=finance --restart=Never
        • info_outlineQuestion A new application orange is deployed. There is something wrong with it. Identify and fix the issue.
        • info_outlineSolution To know more details of orange pod:
          $ kubectl describe po orange
          and look under the initContainers section. There is an issue with the given command. To update the pod with an easiest way by running command:
          $ kubectl edit po orange
          It's not possible to update the changes in the running pod so after saving the changes. It will create a temporary file in the default location /tmp/. Use that manifest file and replace with the existing pod:
          $ kubectl replace -f /tmp/kubectl-edit-xxxx.yaml --force
          Above command will delete the existing pod and will recreate the new pod with latest changes.

  • Expose the hr-web-app as service hr-web-app-service application on port 30082 on the nodes on the cluster. The web application listens on port 8080.
  • info_outlineSolution Run the command: kubectl expose deployment hr-web-app --type=NodePort --port=8080 --name=hr-web-app-service --dry-run=client -o yaml > hr-web-app-service.yaml to generate a service definition file.Now, in generated service definition file add the nodePort field with the given port number under the ports section and create a service.
    • Question Use JSON PATH query to retrieve the osImages of all the nodes and store it in a file /opt/outputs/nodes_os_x43kj56.txt. The osImages are under the nodeInfo section under status of each node.
    • info_outlineSolution Run the command: kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.osImage}' > /opt/outputs/nodes_os_x43kj56.txt

0개의 댓글