Tuesday, 9 June 2020

Kubelet http server gave http response to https client (ImagePullBackOff status on a Kubernetes pod)


[root@unicamaster docker]# kubectl get pods
NAME                                                   READY   STATUS                  RESTARTS   AGE
listener-0                                             0/1     Init:0/1                0          46m
nginx-nginx-ingress-controller-7fc9499f7b-96h99        1/1     Running                 0          90m
nginx-nginx-ingress-default-backend-679f548db6-tq2vz   1/1     Running                 0          90m
unica-campaign-79b746c5b-jb8rz                         0/1     Init:0/1                0          46m
unica-interact-fd5d44b49-xbw52                         0/1     Init:0/1                0          46m
unica-platform-b5688dcb5-4bzz4                         0/1     Init:ImagePullBackOff   0          46m
[root@unicamaster docker]# helm ls --all unica
NAME     REVISION    UPDATED                     STATUS      CHART          APP VERSION    NAMESPACE
unica    1           Tue Jun  9 15:05:08 2020    DEPLOYED    unica-0.5.0    1.0            default 




[root@unicamaster software]# kubectl describe pod unica-platform-b5688dcb5-4bzz4
Name:         unica-platform-b5688dcb5-4bzz4
Namespace:    default
Priority:     0
Node:         unicanode1/10.0.2.5
Start Time:   Tue, 09 Jun 2020 15:05:09 +0530
Labels:       app.kubernetes.io/instance=unica
              app.kubernetes.io/name=unica-platform
              pod-template-hash=b5688dcb5
Annotations:  <none>
Status:       Pending
IP:           10.44.0.5
IPs:
  IP:           10.44.0.5
Controlled By:  ReplicaSet/unica-platform-b5688dcb5
Init Containers:
  install:
    Container ID: 
    Image:         10.0.2.6:5000/unica-install:68
    Image ID:     
    Port:          <none>
    Host Port:     <none>
    Command:
      /bin/sh
      -c
    Args:
      chmod 755 /docker/unica && ./entrypoint.sh
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment Variables from:
      unica-common-env    ConfigMap  Optional: false
      unica-platform-env  ConfigMap  Optional: false
      unica-campaign-env  ConfigMap  Optional: false
      unica-interact-env  ConfigMap  Optional: false
    Environment:          <none>
    Mounts:
      /docker/unica from volume-mount (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-t7d5k (ro)
Containers:
  unica-platform:
    Container ID:  
    Image:          10.0.2.6:5000/tomcat-unica-platform:12
    Image ID:      
    Port:           9123/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       PodInitializing
    Ready:          False
    Restart Count:  0
    Limits:
      cpu:     2
      memory:  1600Mi
    Requests:
      cpu:      1500m
      memory:   1300Mi
    Readiness:  exec [/bin/bash -ce ] delay=20s timeout=30s period=40s #success=1 #failure=3
    Environment Variables from:
      unica-common-env    ConfigMap  Optional: false
      unica-platform-env  ConfigMap  Optional: false
      unica-campaign-env  ConfigMap  Optional: false
      unica-interact-env  ConfigMap  Optional: false
    Environment:
      CONTAINER_NAME:  unica-platform
      WLP_HTTP_PORT:   9123
      WLP_HTTPS_PORT:  9445
    Mounts:
      /docker/unica from volume-mount (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-t7d5k (ro)
Conditions:
  Type              Status
  Initialized       False
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  volume-mount:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  unica
    ReadOnly:   false
  default-token-t7d5k:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-t7d5k
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason     Age                    From                 Message
  ----     ------     ----                   ----                 -------
  Normal   Scheduled  <unknown>              default-scheduler    Successfully assigned default/unica-platform-b5688dcb5-4bzz4 to unicanode1
  Normal   Pulling    38m (x4 over 39m)      kubelet, unicanode1  Pulling image "10.0.2.6:5000/unica-install:68"
  Warning  Failed     38m (x4 over 39m)      kubelet, unicanode1  Failed to pull image "10.0.2.6:5000/unica-install:68": rpc error: code = Unknown desc = Error response from daemon: Get https://10.0.2.6:5000/v2/: http: server gave HTTP response to HTTPS client
  Warning  Failed     38m (x4 over 39m)      kubelet, unicanode1  Error: ErrImagePull
  Normal   BackOff    14m (x107 over 39m)    kubelet, unicanode1  Back-off pulling image "10.0.2.6:5000/unica-install:68"
  Warning  Failed     4m34s (x151 over 39m)  kubelet, unicanode1  Error: ImagePullBackOff

Means you need to set daemon.json:

If you didn't set the daemon.json correctly:
[root@unicamaster docker]# systemctl restart docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
[root@unicamaster docker]# vi daemon.json
[root@unicamaster docker]# systemctl restart docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
[root@unicamaster docker]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2020-06-09 15:48:38 IST; 58s ago
     Docs: https://docs.docker.com
  Process: 5452 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 5452 (code=exited, status=1/FAILURE)

Correct syntax:
{
        "insecure-registries" : ["10.0.2.6:5000"]
}

NOTE: Need to restart on node1 as well

No comments:

Post a Comment

PVC in terminating state

Referencee:https://veducate.co.uk/kubernetes-pvc-terminating/  I still had errors performing deployment, till I released that although I pre...