IBM Cloud Docs
Debugging app deployments

Debugging app deployments

Virtual Private Cloud Classic infrastructure

Review the options that you have to debug your app deployments and find the root causes for failures.

Before you begin, ensure you have the Writer or Manager IBM Cloud IAM service access role for the namespace where your app is deployed.

  1. Look for abnormalities in the service or deployment resources by running the describe command.

    kubectl describe service <service_name>
    
  2. Check whether the containers are stuck in the ContainerCreating state.

  3. Check whether the cluster is in the Critical state. If the cluster is in a Critical state, check the firewall rules and verify that the master can communicate with the worker nodes.

  4. Verify that the service is listening on the correct port.

    1. Get the name of a pod.
      kubectl get pods
      
    2. Log in to a container.
      kubectl exec -it <pod_name> -- /bin/bash
      
    3. Curl the app from within the container. If the port is not accessible, the service might not be listening on the correct port or the app might have issues. Update the configuration file for the service with the correct port and redeploy or investigate potential issues with the app.
      curl localhost: <port>
      
  5. Verify that the service is linked correctly to the pods.

    1. Get the name of a pod.
      kubectl get pods
      
    2. Log in to a container.
      kubectl exec -it <pod_name> -- /bin/bash
      
    3. Curl the cluster IP address and port of the service.
      curl <cluster_IP>:<port>
      
    4. If the IP address and port are not accessible, look at the endpoints for the service.
      • If no endpoints are listed, then the selector for the service does not match the pods. For example, your app deployment might have the label app=foo, but the service might have the selector run=foo.
      • If endpoints are listed, then look at the target port field on the service and make sure that the target port is the same as what is being used for the pods. For example, your app might listen on port 9080, but the service might listen on port 80.
  6. For Ingress services, verify that the service is accessible from within the cluster.

    1. Get the name of a pod.
      kubectl get pods
      
    2. Log in to a container.
      kubectl exec -it <pod_name> -- /bin/bash
      
    3. Curl the URL specified for the Ingress service. If the URL is not accessible, check for a firewall issue between the cluster and the external endpoint.
      curl <host_name>.<domain>