CrashLoopBackOff Container Cube Container

I am creating a replication controller with one init container. however, the init container does not start, and the module state:

NAME                       READY     STATUS             RESTARTS   AGE
testcontainer   0/1       CrashLoopBackOff   12         37m

I'm not sure which part fails for sure, and the magazines don't help. My kubectl server version is 1.4 (different from the client version), so I use:

annotations:
        pod.beta.kubernetes.io/init-containers:

Here is the replication controller yaml file that I am using. I use the "hello-world" image (instead of nginx to make it faster)

apiVersion: v1
kind: ReplicationController
metadata:
  name: testcontainer
spec:
  replicas: 1
  selector:
    app: nginx
  template:
    metadata:
      labels:
        app: nginx
      annotations:
        pod.beta.kubernetes.io/init-containers: '[
            {
                "name": "install",
                "image": "hello-world"
            }
        ]'
    spec:
      containers:
      - name: nginx
        image: hello-world
      dnsPolicy: Default
      nodeName: x.x.x.x

logs from kubectl describe the module:

Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "nginx" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=nginx pod=testcontainer()"

  32m   16s     145     {kubelet x.x.x.x}  spec.containers{nginx}  Warning BackOff Back-off restarting failed docker container

(nginx testcontainer), hello-world, , . , ( , , https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/#creating-a- pod-that-has-an-init-container, )

+5
1

, init. hello-world . .spec.restartPolicy Always, .

, , , 0.

, API- .


init, :

apiVersion: v1
kind: ReplicationController
metadata:
  name: testcontainer
spec:
  replicas: 1
  selector:
    app: nginx
  template:
    metadata:
      labels:
        app: nginx
      annotations:
        pod.beta.kubernetes.io/init-containers: '[
            {
                "name": "install",
                "image": "hello-world"
            }
        ]'
    spec:
      containers:
      - name: nginx
        image: nginx # <--- this image shouldn't be a single shot application
      dnsPolicy: Default
      nodeName: x.x.x.x
+1

Source: https://habr.com/ru/post/1669494/


All Articles