Здравствуйте. Подскажите пож-та. Развернул 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