container is in waiting state, kubernetes, docker container

2/24/2016

this is my .yaml content

apiVersion: v1
kind: Pod
metadata:
  name: mysql
  labels: 
    name: mysql
spec: 
  containers:
    - resources:
        limits :
          cpu: 0.5 
      image: imagelingga
      name: imagelingga
      ports:
        - containerPort: 80 
          name: imagelingga
    - resources:
        limits :
          cpu: 0.5
      image: mysql
      name: mysql
      env:
        - name: MYSQL_ROOT_PASSWORD
          # change this
          value: pass
      ports: 
        - containerPort: 3306
          name: mysql
      volumeMounts:
        - name: mysqlkuber
          mountPath: /var/lib/mysql
          readOnly: false
  volumes:
    - name: mysqlkuber
      hostPath:
        path: /home/mysqlkuber

i have two image

-mysql

-imagelingga = microservice server for java

the mysql logs shows that already run but the imagelingga logs show Pod "mysql" in namespace "default": container "imagelingga" is in waiting state.trial

the connection between these two images is, imagelinnga need connection to mysql as DB.

i already run both images in docker container without kubernetes and run normally. but when i run inside kubernetes then the problem appear like that.

how to trigger imagelingga container to start the service

thx before!!

-- BIlly Sutomo
containers
docker
kubernetes
mysql

1 Answer

3/2/2016

The container is in waiting state because when runnning the images it's crash or fail.

Then the container will be restart by the kubernetes, that make the container is in waiting state because on restarting progress.

For pod status

kubectl get pods

if the status "CrashLoopBackOff", then its restarting the container

For check container inside pod logs

kubectl logs [pod] [container]
-- BIlly Sutomo
Source: StackOverflow