LINUX.ORG.RU

Сообщения dottram

 

k8s ContainerCreating

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

 

dottram
()

GitLab Runner: failed to verify certificate: x509

"Приветствую! Поднял локальный GitLab. Пытаюсь зарегистрировать runner на котором установлен GitLab.

При попытке ввести команды выводится следующая ошибка;"

gitlab-runner register --tls-ca-file="$CERTIFICATE"
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://gitlab.example.com
Enter the registration token:
GR1348941ddPQUuJmdMm8n2qyBK7y
Enter a description for the runner:
[dott]: 
Enter tags for the runner (comma-separated):

Enter optional maintenance note for the runner:

WARNING: Support for registration tokens and runner parameters in the 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://docs.gitlab.com/ee/ci/runners/new_creation_workflow 
ERROR: Registering runner... failed                 runner=GR1348941ddPQUuJm status=couldn't execute POST against https://gitlab.example.com/api/v4/runners: Post "https://gitlab.example.com/api/v4/runners": tls: failed to verify certificate: x509: certificate relies on legacy Common Name field, use SANs instead
PANIC: Failed to register the runner. 

«Далее попробовал ввести команды с токеном. теперь на токен не ругается. Но проблема также с сертификатом.»

root@dott:/home/dott# gitlab-runner register --tls-ca-file="$CERTIFICATE" --token glrt-fRrf4ACvaPp1RnxVBn3X
Runtime platform                                    arch=amd64 os=linux pid=2827 revision=4e724e03 version=16.4.0
Running in system-mode.                            
                                                   
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://gitlab.example.com
ERROR: Verifying runner... failed                   runner=fRrf4ACva status=couldn't execute POST against https://gitlab.example.com/api/v4/runners/verify: Post "https://gitlab.example.com/api/v4/runners/verify": tls: failed to verify certificate: x509: certificate relies on legacy Common Name field, use SANs instead
PANIC: Failed to verify the runner.                
root@dott:/home/dott# 

«На всяких форумах GitLab пытался вылечить путём пересоздания сертификата;»

cd certs
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -subj '/CN=gitlab.example.com' -days 365
cd /etc/gitlab/ssl
Удалил старые сертификаты
сp  /root/certs/cert.pem gitlab.example.com.crt
cp  /root/certs/key.pem gitlab.example.com.key
Переконфигурировал GitLab

«Дальше настраиваю переменные»

SERVER=gitlab.example.com
PORT=443
CERTIFICATE=/etc/gitlab-runner/certs/${SERVER}.crt
# Create the certificates hierarchy expected by gitlab
mkdir -p $(dirname "$CERTIFICATE")
# Get the certificate in PEM format and store it
openssl s_client -connect ${SERVER}:${PORT} -showcerts </dev/null 2>/dev/null | sed -e '/-----BEGIN/,/-----END/!d' | sudo tee "$CERTIFICATE" >/dev/null
# Register your runner
gitlab-runner register --tls-ca-file="$CERTIFICATE"

«Всё безуспешно. Подскажите плиз у кого есть рабочий мануал? Или как это всё вылечить? Ставил всё на Ubuntu22.04.»

 ,

dottram
()

не запускается OpenVPN.

Здравствуйте. Помогите разобраться. Тестовый стенд. Есть локальная сеть 192.168.1.0/24 и Сервер OpenVPN 192.168.1.254/24 и его типа внешний 10.8.125.243/24 Ubuntu22 При вводе команду. systemctl status openvpn-server@server.service Выводит вот это.

root@ubuntu22-server:/etc/openvpn/server# systemctl status openvpn-server@server.service
● openvpn-server@server.service - OpenVPN service for server
     Loaded: loaded (/lib/systemd/system/openvpn-server@.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2023-01-18 07:18:50 UTC; 3s ago
       Docs: man:openvpn(8)
   
в логах выдаёт следующее
cat /var/log/openvpn/openvpn.log


OpenVPN 2.5.5 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 14 2022
library versions: OpenSSL 3.0.2 15 Mar 2022, LZO 2.10
net_route_v4_best_gw query: dst 0.0.0.0
net_route_v4_best_gw result: via 10.8.125.254 dev ens3
Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
TUN/TAP device tun0 opened
net_iface_mtu_set: mtu 1500 for tun0
net_iface_up: set tun0 up
net_addr_v4_add: 10.8.0.1/24 dev tun0
failed to find GID for group nobody
Exiting due to fatal error
Closing TUN/TAP interface
net_addr_v4_del: 10.8.0.1 dev tun0

конфиг server.conf

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# TCP or UDP server?
;proto tcp
proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh2048.pem 2048
;dh dh2048.pem
dh none

# Network topology
# Should be subnet (addressing via IP)
# unless Windows clients v2.0.9 and lower have to
# be supported (then net30, i.e. a /30 per client)
# Defaults to net30 (not recommended)
topology subnet

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist /var/log/openvpn/ipp.txt

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
push "route 192.168.1.0  255.255.255.0"
# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey tls-auth ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
tls-auth ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
# Note that v2.4 client/server will automatically
# negotiate AES-256-GCM in TLS mode.
# See also the ncp-cipher option in the manpage
cipher AES-256-GCM
auth sha256

# Enable compression on the VPN link and push the
# option to the client (v2.4+ only, for earlier
# versions see below)
;compress lz4-v2
;push "compress lz4-v2"

# For compression compatible with older clients use comp-lzo
# If you enable it here, you must also
# enable it in the client config file.
;comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
user nobody
group nobody

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status /var/log/openvpn/openvpn-status.log

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it.  Use one
# or the other (but not both).
log         /var/log/openvpn/openvpn.log
;log-append  /var/log/openvpn/openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20

# Notify the client that when the server restarts so it
# can automatically reconnect.
explicit-exit-notify 1

 

dottram
()

Задача по монтированию образа и последующей установке продукта Efros ACS.

Добрый день. Не особо знаю линукс. Так что сильно не ругайте. Необходимо установить продукт Efros-ACS. Образ у меня есть. Прикол в том что этот образ надо смонтировать. И потом прописать его в репозиториях. Чтобы потом нормально запустилась установка через

sudo apt-get install efros-acs

У меня это пока не особо получается. Делаю я всё это в AstraLinux17.1 Везде появляются ошибки. Начал я с монтирования образа.

sudo mount /home/user/Desktops/Desktop1/efros-acs.iso  /home/iso
mount: /home/iso: WARNING: device write-protected, mounted read-only

Потом добавил права

chmod a=rwx /home/user/Desktops/Desktop1/efros-acs.iso

Зашёл в репозитории nano /etc/apt/sources.list Добавил строку

deb file:/home/user/Desktops/Desktop1/efros-acs.iso  efros-acs main contrib non-free

Потом sudo apt update

root@astra:/etc/apt# sudo update
sudo: update: command not found
root@astra:/etc/apt# apt update
Пол:1 file:/home/userDesktops/Desktop1/efros-acs.iso efros-acs InRelease
Игн:1 file:/home/userDesktops/Desktop1/efros-acs.iso efros-acs InRelease
Пол:2 file:/home/userDesktops/Desktop1/efros-acs.iso efros-acs Release
Ошб:2 file:/home/userDesktops/Desktop1/efros-acs.iso efros-acs Release
 Файл не найден - /home/userDesktops/Desktop1/efros-acs.iso/dists/efros-acs/Release (2: Нет такого файла или каталога)
Игн:3 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-main 1.7_x86-64 InRelease
Пол:4 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-update 1.7_x86-64 InRelease [5283 B]
Пол:5 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-base 1.7_x86-64 InRelease [5303 B]
Пол:6 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended 1.7_x86-64 InRelease [9719 B]
Сущ:7 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-main 1.7_x86-64 Release
Пол:8 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-update 1.7_x86-64/main amd64 Packages [417 kB]
Пол:9 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-update 1.7_x86-64/contrib amd64 Packages [1211 B]
Пол:10 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-update 1.7_x86-64/non-free amd64 Packages [40,4 kB]
Пол:11 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-base 1.7_x86-64/main amd64 Packages [3934 kB]
Пол:12 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-base 1.7_x86-64/contrib amd64 Packages [2022 B]
Пол:13 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-base 1.7_x86-64/non-free amd64 Packages [51,2 kB]
Пол:14 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended 1.7_x86-64/main amd64 Packages [1728 kB]
Пол:15 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended 1.7_x86-64/contrib amd64 Packages [6168 B]
Пол:16 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended 1.7_x86-64/non-free amd64 Packages [39,9 kB]
Пол:17 https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended 1.7_x86-64/astra-ce amd64 Packages [9033 B]
Чтение списков пакетов… Готово                            
E: Репозиторий «file:/home/userDesktops/Desktop1/efros-acs.iso efros-acs Release» не содержит файла Release.
N: Обновление из этого репозитория нельзя выполнить безопасным способом, поэтому по умолчанию он отключён.
N: Информацию о создании репозитория и настройках пользователя смотрите в справочной странице apt-secure(8).
N: Репозиторий «https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-update 1.7_x86-64 InRelease» изменил значение поля «Version» с «1.7.1» на «1.7.2»
N: Репозиторий «https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-base 1.7_x86-64 InRelease» изменил значение поля «Version» с «1.7.1-base» на «1.7.2-base»
N: Репозиторий «https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended 1.7_x86-64 InRelease» изменил значение поля «Version» с «1.7.1.ext2.3» на «1.7.2.ext1.3»
root@astra:/etc/apt# 

Ну и последним этапом

sudo apt-get install efros-acs
root@astra:/etc/apt# apt-get install efros-acs
Чтение списков пакетов… Готово
Построение дерева зависимостей        
Чтение информации о состоянии… Готово
E: Невозможно найти пакет efros-acs
root@astra:/etc/apt#

Как это всё починить?

 , ,

dottram
()

Не работает bash скрипт

Добрый день. Хотел автоматизировать установку заббикс в bash скрипте. Но столкнулся с проблемой. На этапе скачивания wget (через bash) не скачивается файл. Точнее выдаёт ошибку Http request sent, awaiting response… 404 Not Found ERROR 404: Not Found. Не знаю как это победить. Если же просто запускать без bash то файл нормально скачивается. С ключами команды wget также поигрался. Безрезультатно. Есть следующий сценарий

#!/usr/bin/bash

#Download

wget "https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1%2Bfocal_all.deb"
dpkg -i zabbix-release_5.0-1+focal_all.deb
apt update
apt upgrade

#Install Zabbix server, frontend, agent, database, httpd

apt install zabbix-server-mysql
apt install zabbix-frontend-php
apt install zabbix-apache-conf
apt install zabbix-agent
apt install mysql-server

#Create DB (example1)

mysql -uroot -p <<EOF
create database zabbix character set utf8 collate utf8_bin;
create user 'zabbix'@'localhost' identified by 'password';
grant all privileges on zabbix.* to 'zabbix'@'localhost';
EOF

#Import initial schema and data

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

#Configure the database for Zabbix server

echo DBPassword=password >> /etc/zabbix/zabbix_server.conf

#Configure frontend

sed -i 's:# php_value date.timezone.*:php_value date.timezone Europe\/Riga:g' /etc/zabbix/apache.conf;

#Start zabbix server processes start at system boot

systemctl restart zabbix-server zabbix-agent apache2
systemctl enable zabbix-server zabbix-agent apache2

 

dottram
()

RSS подписка на новые темы