Troubleshoot Migration Problems

If you encounter problems migrating your Oracle Application Container Cloud Service application to Oracle Cloud Infrastructure, then you can do troubleshooting during your migration.

Verify the Status of the Kubernetes Resources

If the deployment of your application fails, then you can fetch details of the deployment, pods, and service.

  1. Fetch the deployments in your Kubernetes cluster.
    kubectl get deployments
    Example:
    $ kubectl get deployments
    NAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
    webapp01-deployment      2         2         2            2           16h
    webapp02-deployment      1         1         1            1           2d
    javaeeapp01-deployment   1         1         1            1           1d
    javaeeapp02-deployment   1         1         1            0           1d

    The value under the DESIRED and AVAILABLE columns should be at least 1. If the values is 0, then you have a problem in your deployment.

  2. Fetch the services in your Kubernetes cluster.
    kubectl get services
    Example:
    $ kubectl get services
    NAME                  TYPE           CLUSTER-IP      EXTERNAL-IP       PORT(S)         AGE
    webapp01-service      LoadBalancer   10.x.x.x        132.x.x.x         80:43678/TCP    16h
    webapp02-service      LoadBalancer   10.x.x.x        132.x.x.x         443:32628/TCP   2d
    javaeeapp01-service   LoadBalancer   10.96.112.230   10.x.x.x          443:30824/TCP   1d
    javaeeapp02-service   LoadBalancer   10.96.142.94    10.x.x.x          443:30830/TCP   1d

    The value under the TYPE column should be ClusterIP or LoadBalancer according to you application. The value under the EXTERNAL-IP should be a valid IP address. If you have different values, then you have a problem in your service.

  3. Fetch the pods in your Kubernetes cluster.
    kubectl get pods
    Example:
    $ kubectl get pods
    NAME                                      READY   STATUS             RESTARTS   AGE
    javaeeapp01-deployment-67fb54b6c4-bdsfh   1/1     Running            0          1d
    javaeeapp02-deployment-79f8f9bff9-42dqk   1/1     Running            0          1d
    webapp01-deployment-7977d9f97b-4d4s9      0/1     Failed             0          16h
    webapp01-deployment-7977d9f97b-7bwqf      1/1     Running            0          16h

    The value under the STATUS column should be Running. If the value is FAILED, then you have a problem in your pod.

  4. To fetch more details about a failed resource, run the following command. Provide appropriate values for the <resource-type> and <resource-id-or-name> placeholders.
    kubectl describe <resource-type> <resource-id-or-name>
    Example:
    $ kubectl describe deployment webapp01-deployment
    Name:                   webapp01-deployment
    Namespace:              default
    CreationTimestamp:      Thu, 07 Feb 2019 17:20:03 +0530
    ...
    Pod Template:
      Labels:  app=webapp01-selector
      Containers:
       webapp01:
        Image:      fra.ocir.io/tenancy1/accs/oci_user1/webapp01:latest
        Port:       8080/TCP
        Host Port:  0/TCP
    ...
    Conditions:
      Type           Status  Reason
      ----           ------  ------
      Available      False   MinimumReplicasUnavailable
      Progressing    False   ProgressDeadlineExceeded
    OldReplicaSets:  <none>
    NewReplicaSet:   webapp01-deployment-7977d9f97b (2/2 replicas created)
    Events:          <none>

Delete Resources Created During Migration

Remove the resources created during the migration facilitates quick recovery in the event of migration failure.

  1. Delete the Kubernetes service. Provide an appropriate value for <app-name>.
    kubectl delete service <app-name>-service
    Example:
    $ kubectl delete service webapp01-service
    service "webapp01-service" deleted
  2. Delete Kubernetes deployment. Provide an appropriate value for <app-name>.
    kubectl delete deployment <app-name>-deployment

    Example:

    $ kubectl delete deployment webapp01-deployment
    service "webapp01-deployment" deleted
  3. Delete Kubernetes secret for TLS key and certificate. Provide an appropriate value for <app-name>.
    kubectl delete secret <app-name>-tls-certificate

    Example:

    $ kubectl delete secret webapp01-tls-certificate
    secret "webapp01-tls-certificate" deleted
  4. Delete Kubernetes docker secret. Provide an appropriate value for <app-name>.
    kubectl delete secret <app-name>-secret

    Example:

    $ kubectl delete secret webapp01-secret
    secret "webapp01-secret" deleted
  5. Delete Kubernetes configuration map for environment variables. Provide an appropriate value for <app-name>.
    kubectl delete configmap <app-name>-config-var-map

    Example:

    $ kubectl delete configmap webapp01-config-var-map
    configmap "webapp01-config-var-map" deleted
After you delete the Kubernetes resources, you can restart the migration process.