LINUX.ORG.RU

k8s ContainerCreating

 


0

1

Здравствуйте. Подскажите пож-та. Развернул k8s. 1 master и 2 worker nodы. При применении деплоимента (kubectl -n ktswebinar apply -f ./) состояние pods постоянно ContainerCreating.

root@k8s-master1:/home/dott/ktswebinar# kubectl -n ktswebinar get  pods                                             
NAME                          READY   STATUS              RESTARTS   AGE
ktswebinar-6b7c46b449-pxxww   0/1     ContainerCreating   0          38m
root@k8s-master1:/home/dott/ktswebinar# kubectl -n ktswebinar get  pods                                             
NAME                          READY   STATUS              RESTARTS   AGE
ktswebinar-6b7c46b449-pxxww   0/1     ContainerCreating   0          43m

Смотрю логи

ox "1d179b0ea4c8af5027f6dfa76d489366c02c72e662e6519d9dd3fd5f9b5444a6": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             28m         Warning   FailedCreatePodSandBox     pod/pg-56c9d89c69-6llf6                          Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "987bfcfe61cf5c67d1dc1e22e8e613e3fdfaf9c0f92ea1953ba3a84a789383dc": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             28m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-8rs2v                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "de8958e6bb85d6da774b99a45a3100ea30e316a76524613d312887acdd6b16ee": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             28m         Warning   FailedCreatePodSandBox     pod/pg-56c9d89c69-6llf6                          Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "e0e6b1e697252ba4ead91fc44585ba016cc5d80890e020909abc412eb291358e": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             20m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-8rs2v                  (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "144d7389753e7b02e691f4df8a51ec4e96d3e366725dac605eba270035e7e5b2": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             20m         Warning   FailedCreatePodSandBox     pod/pg-56c9d89c69-6llf6                          (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "0382f197b509e80a4e790c7e0c5d259685fb4d617fedfb3dca9714d8aff0c982": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
default                21m         Normal    NodeHasSufficientPID       node/k8s-master1.dmosk.local                     Node k8s-master1.dmosk.local status is now: NodeHasSufficientPID
default                21m         Normal    NodeHasNoDiskPressure      node/k8s-master1.dmosk.local                     Node k8s-master1.dmosk.local status is now: NodeHasNoDiskPressure
default                21m         Normal    NodeHasSufficientMemory    node/k8s-master1.dmosk.local                     Node k8s-master1.dmosk.local status is now: NodeHasSufficientMemory
default                21m         Normal    NodeAllocatableEnforced    node/k8s-master1.dmosk.local                     Updated Node Allocatable limit across pods
default                21m         Warning   InvalidDiskCapacity        node/k8s-master1.dmosk.local                     invalid capacity 0 on image filesystem
default                21m         Normal    Starting                   node/k8s-master1.dmosk.local                     Starting kubelet.
kube-system            21m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "69b4504be481227b6d577dd9701917369e1c818806696f995a853acfbcf8b2c2": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            6m3s        Normal    SandboxChanged             pod/coredns-5dd5756b68-7k2hs                     Pod sandbox changed, it will be killed and re-created.
kube-system            5m53s       Normal    SandboxChanged             pod/coredns-5dd5756b68-bf4nj                     Pod sandbox changed, it will be killed and re-created.
kube-system            21m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "54a6b573c8eb08504353b404695b36f5162a82788053a60ed66939f8ce15527b": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            21m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "49f2ec5af06f0a1bc32fdcfdb378884cd1fd58b83c0c7edca9b3df8d5495577f": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            21m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7f443de6447861ca7746b62961e49abb4953a3ede6e4040b7fa6402500236f3d": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "1e6474d0dc5c6f36033421ec1bc4e21607376063b782effe464c608db90b69c5": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c73d642a30fd2070467e4837936acc67c915914bb9d31c4df7b4c65e01ebcd30": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "52257cdad1fd86452829fdec52f39533405e9dc2c6112733c79c2f9810b70ef4": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "8ef4f88fde45ad5f3532e9555aef826df21f45b07d99ae4f5eb1daf06aad966e": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "f34141d5a6e853cf90ef1078a40da14b993ec437da93058e2ae06366a252a98a": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "4ecf7c4fb7081faed97fa214996a50125d0bc399aa9c79b8556b8cf680951e6e": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
  GNU nano 4.8                                                                                     /run/flannel/subnet.env                                                                                               
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "9b3ae675717bc8e4e70f6860e12cf20a3a074400bee9940a7a76af8a8d10ca4d": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "2bb0f32fc30231c2ec88b5769ae036ad33252c5cce57676b116385143fd0e289": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            20m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "d44bbd4cda3ce3a0fc039bad9c74185aabfdbbb225af50ea1c14f76d3f11186a": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            19m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "4bd056af6bbc00d68e5a2c0c3ca14bc78b94dc14254f4ed4e54d1cf710d2bce1": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            19m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "de7e3e1d194c350e69b9f2a64472608004faf48721d3668d38185e836c2c274b": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            19m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "b689e269135a134a39f9454bd3ec3af5fe8e510552987659a2d495786f656299": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            19m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "4abbbecf63131736b662c4d5f7b167f69e870dc0c659a4e34a705f30facf0d3e": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            19m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c429560b8726fb701e16c2d313055b7798255c03b3001641cbfcc63c97b8855c": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            19m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-bf4nj                     (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "90d6a10576936175419e622f4fd9d92c7152c502db8d01c187b1106c92d87495": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
kube-system            18m         Warning   FailedCreatePodSandBox     pod/coredns-5dd5756b68-7k2hs                     (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "b0333e6500db02db137af344752c8728ea1514c2bd948ee0639bff3dc1f6af05": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             17m         Normal    Scheduled                  pod/ktswebinar-6b7c46b449-pdjg9                  Successfully assigned ktswebinar/ktswebinar-6b7c46b449-pdjg9 to k8s-worker2.dmosk.local
ktswebinar             17m         Normal    ScalingReplicaSet          deployment/ktswebinar                            Scaled up replica set ktswebinar-6b7c46b449 to 1
ktswebinar             17m         Normal    SuccessfulCreate           replicaset/ktswebinar-6b7c46b449                 Created pod: ktswebinar-6b7c46b449-pdjg9
ktswebinar             17m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "9536fd9411ae3766736d66e011aa2f86ba8db5260c8814378637c0b49bab3095": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             16m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "8529fb55e13e79725c6060b3578bd9bb080a33ae336020b8cf4d27ebb7a1903f": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             16m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "8e8604432fb63e928ccc6c707552982a414196fa295a75d18de937e131125c47": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             16m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "3050589ac6de6186a071d47b6c7821b63d40896bc91f70cf9c8d30495284dc85": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             16m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "9bc8058d517b33e17ce44e106ec4db7dbf43c51dc9c931598844d9db79d570c9": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             15m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "6a2b9cf779e0c6ab0d7639c2bb2977cdf70bcf4bb527d0fe816258f02a79a4cc": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             15m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "acd7932f0207d7f5a0075ee5ab126540a5625fff0ec3e776eb72239f99add33b": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             15m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "425abaafce3db0b291edbead52c6ffa676ae469a891ede09f4531393254f6167": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             15m         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c41ceb4ad42d760ba37b9482170eab2c6f429bb8af5d1eba4e809b9a079fbcc5": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             2m1s        Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pdjg9                  (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "f4fdc73d4fab689a62a2bd861441f80095eb7a3037bb3a61fe74c3b43020e672": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             110s        Normal    SuccessfulCreate           replicaset/ktswebinar-6b7c46b449                 Created pod: ktswebinar-6b7c46b449-qfzjx
ktswebinar             110s        Normal    ScalingReplicaSet          deployment/ktswebinar                            Scaled up replica set ktswebinar-6b7c46b449 to 1
ktswebinar             110s        Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-qfzjx                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "652404fa312c3842349d027188e7ce7f9e0e8a27f1bb19e5e59b984410f9baf7": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             110s        Normal    Scheduled                  pod/ktswebinar-6b7c46b449-qfzjx                  Successfully assigned ktswebinar/ktswebinar-6b7c46b449-qfzjx to k8s-worker2.dmosk.local
ktswebinar             96s         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-qfzjx                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "9766886972dc8124cf52bc247cb37c13498c6cbf822b282146a685bafbf5ce43": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             81s         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-qfzjx                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "470b18e2cdfc8393abdbe7ed96093c528d4ee1618dc52eb1d7965bfbf965fd02": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             66s         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-qfzjx                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "15b7be7763d576e305cd9a9f7d0b519b09eaf49b0a0c808cce4085a14491d9bc": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             52s         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-qfzjx                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "42431ffecb6654a9910b1037d18753d9177e6b064f0918921cdce0e443b62313": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             38s         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-qfzjx                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "4bbda9159c52636f36132b72156264eb3ddd20c0ddea54d60240b6ac9d2d5130": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             26s         Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-qfzjx                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "38e074b5a3310f6b3aaecd99e29c47d18149a757a7f071b607a1f6750d2095c0": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             7s          Normal    SuccessfulCreate           replicaset/ktswebinar-6b7c46b449                 Created pod: ktswebinar-6b7c46b449-pxxww
ktswebinar             7s          Normal    Scheduled                  pod/ktswebinar-6b7c46b449-pxxww                  Successfully assigned ktswebinar/ktswebinar-6b7c46b449-pxxww to k8s-worker2.dmosk.local
ktswebinar             7s          Warning   FailedCreatePodSandBox     pod/ktswebinar-6b7c46b449-pxxww                  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "5b4d44bab22af30ddc9a8a7ab0c08faf7f2c4ddc18922110dc66b82f9c54a8f5": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
ktswebinar             7s          Normal    ScalingReplicaSet          deployment/ktswebinar                            Scaled up replica set ktswebinar-6b7c46b449 to 1
root@k8s-master1:/home/dott/ktswebinar# nano /run/flannel/subnet.env
root@k8s-master1:/home/dott/ktswebinar# kubectl -n ktswebinar get  pods                                             
NAME                          READY   STATUS              RESTARTS   AGE
ktswebinar-6b7c46b449-pxxww   0/1     ContainerCreating   0          38m
root@k8s-master1:/home/dott/ktswebinar# kubectl -n ktswebinar get  pods                                             
NAME                          READY   STATUS              RESTARTS   AGE
ktswebinar-6b7c46b449-pxxww   0/1     ContainerCreating   0          43m
root@k8s-master1:/home/dott/ktswebinar# 

На GitHub написали что надо создать файл /run/flannel/subnet.env и добавить в него запись FLANNEL_NETWORK=10.244.0.0/16 FLANNEL_SUBNET=10.244.0.1/24 FLANNEL_MTU=1450 FLANNEL_IPMASQ=true

Запись добавил. Безрезультатно.

Сам deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ktswebinar
  labels:
    app.kubernetes.io/name: ktswebinar
    app.kubernetes.io/component: web
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: ktswebinar
      app.kubernetes.io/component: web
  template:
    metadata:
      labels:
        app.kubernetes.io/name: ktswebinar
        app.kubernetes.io/component: web
    spec:
      containers:
        - name: ktswebinar
          image: igorcoding/ktswebinar:1.0.4
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8000
              name: http
          env:
            - name: DATABASE_URL
              value: postgresql://postgres:gYwOKJZaR0do8TUUgPS9@pg:5432/postgres

Ответ на: комментарий от kostik87

Спасибо. Я настраивал как здесь https://www.dmosk.ru/instruktions.php?object=kubernetes-ubuntu Изначально у меня всё работало. Под создавался и работал без проблем. Потом я пересоздал под два раза. Такое ощущение что где-то что-то забилось.

df- h

root@k8s-master1:/home/dott/ktswebinar# df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               1.9G     0  1.9G   0% /dev
tmpfs                              389M  2.5M  387M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   63G  9.1G   51G  16% /
tmpfs                              1.9G     0  1.9G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda2                          2.0G  209M  1.6G  12% /boot
/dev/loop1                          92M   92M     0 100% /snap/lxd/24061
/dev/loop2                          50M   50M     0 100% /snap/snapd/18357
/dev/loop0                          64M   64M     0 100% /snap/core20/2182
/dev/loop3                          40M   40M     0 100% /snap/snapd/21184
/dev/loop4                          64M   64M     0 100% /snap/core20/2264
shm                                 64M     0   64M   0% /run/containerd/io.containerd.grpc.v1.cri/sandboxes/4c564b2f3880a889304b79271726c2e49b79e6c541cff9a1dce406d5e979f3a0/shm
shm                                 64M     0   64M   0% /run/containerd/io.containerd.grpc.v1.cri/sandboxes/0a1d42643ef8d59e8e8038c8eb89f3ff8c4cc481d0b5840195e86d8da29d6229/shm
shm                                 64M     0   64M   0% /run/containerd/io.containerd.grpc.v1.cri/sandboxes/18288bddb7ec452f7f65ab91a26a153d7baecd2643572e4a40696f9d0e989ec8/shm
shm                                 64M     0   64M   0% /run/containerd/io.containerd.grpc.v1.cri/sandboxes/96cfd56802f814c12fa55395ff6bc9f1e2e727eb44501f412facd7b5437c2c1c/shm
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/4c564b2f3880a889304b79271726c2e49b79e6c541cff9a1dce406d5e979f3a0/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/18288bddb7ec452f7f65ab91a26a153d7baecd2643572e4a40696f9d0e989ec8/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/96cfd56802f814c12fa55395ff6bc9f1e2e727eb44501f412facd7b5437c2c1c/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/0a1d42643ef8d59e8e8038c8eb89f3ff8c4cc481d0b5840195e86d8da29d6229/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/1d044945f648401f9627c1dc52ec772dc758b91a73ac7e625dc58346f217e39f/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/ceac43a54040e9e4af96a4a6b9bc3496509a38e122762a75149a1d87663786fb/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/55d1f859f7a03350f4fdb0d4d577929fa532620969f422a1edd3680b96c0f5d9/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/64e401a25db6d6992588eda08cef011a881bf68e2671def268275f4d8bdccc89/rootfs
tmpfs                              170M   12K  170M   1% /var/lib/kubelet/pods/a3666551-7b21-4b81-8036-4d2347c27e3e/volumes/kubernetes.io~projected/kube-api-access-226wn
tmpfs                              3.7G   12K  3.7G   1% /var/lib/kubelet/pods/0d580972-04fe-45ee-8d29-18092962f9a0/volumes/kubernetes.io~projected/kube-api-access-nskcg
tmpfs                              170M   12K  170M   1% /var/lib/kubelet/pods/c8f1cdd1-2b14-4691-8c31-032c3a81e37f/volumes/kubernetes.io~projected/kube-api-access-rls28
shm                                 64M     0   64M   0% /run/containerd/io.containerd.grpc.v1.cri/sandboxes/c6f608094331db0d254db177043c16a765d3f1b4d3f381e63d8cbcc721ebab1c/shm
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/c6f608094331db0d254db177043c16a765d3f1b4d3f381e63d8cbcc721ebab1c/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/4ad7cf569102e8109d3424b3ad6ee0ec8e53d72dd1bde04a0f1738dde6e363c5/rootfs
tmpfs                              389M     0  389M   0% /run/user/1000
shm                                 64M     0   64M   0% /run/containerd/io.containerd.grpc.v1.cri/sandboxes/6430659407a0f2ca02c0fdaf25b78afb9514331b684c989d1a7a0ebdb9188cb1/shm
shm                                 64M     0   64M   0% /run/containerd/io.containerd.grpc.v1.cri/sandboxes/13680b476cd2596afcf8e182e5be80937d81e874bf533bb8c2d9f0546092f767/shm
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/6430659407a0f2ca02c0fdaf25b78afb9514331b684c989d1a7a0ebdb9188cb1/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/13680b476cd2596afcf8e182e5be80937d81e874bf533bb8c2d9f0546092f767/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/76ad1aeaa1950862416a9ddbc0138aa8773c44ebbfe4e71b5f6a764a1af06ae6/rootfs
overlay                             63G  9.1G   51G  16% /run/containerd/io.containerd.runtime.v2.task/k8s.io/a837f9bb93aca1ad87d2996443d9ed9502dcc39911450d3f4c3302696f1d6320/rootfs
root@k8s-master1:/home/dott/ktswebinar# 

dottram
() автор топика

kubectl -n ktswebinar describe ktswebinar-6b7c46b449-pxxww

Никаких файлов для фланнеля создавать не надо, он работает из коробки без всяких файлов, если устанавливал по официальной инструкции. Если не работает - разбирайся с ним. Если не получается - давай полный список команд, которыми ты устанавливал куб и фланнель.

vbr ★★★★
()
Последнее исправление: vbr (всего исправлений: 3)
Ответ на: комментарий от dottram

Это неправильная инструкция.

Тут правильная: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/

Для flannel тут: https://github.com/flannel-io/flannel

Что describe-то выдаёт?

vbr ★★★★
()
Последнее исправление: vbr (всего исправлений: 1)

У меня такое бывало когда волюмы очень долго перемонтировались при обновлении стейтфулсета, или когда квот на новый волюм не хватало. Но это готовый кубер в облаке.

neumond
()
Ответ на: комментарий от anonymous
  1. Docker для установки не нужен уже много лет.

  2. Неправильный репозиторий для пакетов, URL репозитория изменился.

  3. Какие-то непонятные манипуляции с /etc/hosts

  4. Какие-то непонятные манипуляции с iptables

  5. Неправильная команда для установки flannel, он давно переехал в другой репозиторий.

Если это всё и заработает, то по чистой случайности.

vbr ★★★★
()
Последнее исправление: vbr (всего исправлений: 2)
Ответ на: комментарий от Myau
root@k8s-master1:/home/dott# kubectl describe pod -n ktswebinar ktswebinar-6b7c46b449-pxxww
Name:             ktswebinar-6b7c46b449-pxxww
Namespace:        ktswebinar
Priority:         0
Service Account:  default
Node:             k8s-worker2.dmosk.local/192.168.213.164
Start Time:       Sat, 20 Apr 2024 19:24:35 +0000
Labels:           app.kubernetes.io/component=web
                  app.kubernetes.io/name=ktswebinar
                  pod-template-hash=6b7c46b449
Annotations:      <none>
Status:           Pending
IP:               
IPs:              <none>
Controlled By:    ReplicaSet/ktswebinar-6b7c46b449
Containers:
  ktswebinar:
    Container ID:   
    Image:          igorcoding/ktswebinar:1.0.4
    Image ID:       
    Port:           8000/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:
      DATABASE_URL:  postgresql://postgres:gYwOKJZaR0do8TUUgPS9@pg:5432/postgres
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-f9wm7 (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  kube-api-access-f9wm7:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason                  Age                  From     Message
  ----     ------                  ----                 ----     -------
  Warning  FailedCreatePodSandBox  67s (x685 over 21h)  kubelet  (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "2b965b8bfe5028adee6d52fc441cf40117616626848b155dd545704c165f91ff": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory
root@k8s-master1:/home/dott# 
dottram
() автор топика
Ответ на: комментарий от dottram

Запись добавил. Безрезультатно

Сделай для начала kubectl edit deploy -n ktswebinar ktswebinar и добавь в контейнер ktswebinar что-то типа

command:
  - tail
  - -f
  - /dev/null

Смысл в том, чтобы вместо entrypoint у тебя выполнялась команда, которая ничего не проверяет. Если других проблем с подом нет, он запустится. Дальше можно, например, сделать

kubectl exec -n ktswebinar имя_пода -- ls /run/flannel
и посмотреть что там с файлом

Myau ★★★★
()