Pods stuck in pending state

186
January 18, 2018, at 01:44 AM

I am using the Kubernetes-client java client to create Deployments on a Kubernetes cluster. THis is the code

Deployment deployment = new DeploymentBuilder()
        .withNewMetadata()
        .withName("first-deployment")
        .endMetadata()
        .withNewSpec()
        .withReplicas(3)
        .withNewTemplate()
        .withNewMetadata()
        .addToLabels(namespaceID, "hello-world-example")
        .endMetadata()
        .withNewSpec()
        .addNewContainer()      
        .withName("nginx-one")
        .withImage("nginx")
        .addNewPort()
        .withContainerPort(80)
        .endPort()
        .withResources(resourceRequirements)
        .endContainer()
        .endSpec()
        .endTemplate()
        .endSpec()
        .build();
    deployment = client.extensions().deployments().inNamespace(namespace).create(deployment);

I add a3 min wait time and then test the status of the pod

PodList podList = client.pods().withLabel(namespaceID, "hello-world-example").list();
    System.out.println("Number of pods " + podList.getItems().size());
    for (Pod pod : podList.getItems()) {
        System.out.println("Name " + pod.getMetadata().getName() 
            + " Status " + pod.getStatus().getPhase() 
            + " Reason " + pod.getStatus().getReason()
        + " Containers " + pod.getSpec().getContainers().get(0).getResources().getLimits());
    }

This returns the following sttaus

Name first-deployment-2418943216-9915m Status Pending Reason null Containers null
Name first-deployment-2418943216-fnk21 Status Pending Reason null Containers null
Name first-deployment-2418943216-zb5hr Status Pending Reason null Containers null

However from the commandline if I get kubectl get pods --all-namespaces. It returns the pod state as running . Am I using the right API? what did I miss?

READ ALSO
JAXB, XJC: Generating field to Class Outline

JAXB, XJC: Generating field to Class Outline

My question concerns writing JAXB plugins, in particular ClassOutline internals

225
org.eclipse.m2e.core.prefs changed immediately after project creation in Eclipse

org.eclipse.m2e.core.prefs changed immediately after project creation in Eclipse

I included a standard set of properties orgeclipse

162
update method using @Query

update method using @Query

I am trying to write an update method for my Cutomer EntityI would like to update the whole Object if possible

203