0

安装 coreos(稳定版、beta 版或 alpha 版)后,我无法启动 flanneld.service,因为依赖 flannel-docker-opts.service 失败。它给出了一个错误

rm:无法从文件中解析 UUID:打开 /var/lib/coreos/flannel-wrapper2.uuid:没有这样的文件或目录

我是 coreos 的新手,正在尝试在其上安装 kubernetes;为此,我有一个单独的 etcd 集群为他们提供 SSL 证书。我在映像上有一个 etcd 代理并正在运行,但法兰绒不会启动 docker 来运行。

我不确定我是否应该在我的云配置中包含更多配置来解决这个问题。我似乎在 flannel-wrapper 或 flannel-docker-opts.service 上找不到任何东西

这是我的 cloud-config.yaml

#cloud-config

write_files:

  - path: /run/systemd/system/etcd2.service.d/30-certificates.conf
    permissions: 0644
    content: |
      [Service]
      Environment="ETCD_CERT_FILE=/etc/ssl/etcd/client.pem"
      Environment="ETCD_KEY_FILE=/etc/ssl/etcd/client-key.pem"
      Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/etcd/ca.pem"
      Environment="ETCD_PEER_CERT_FILE=/etc/ssl/etcd/client.pem"
      Environment="ETCD_PEER_KEY_FILE=/etc/ssl/etcd/client-key.pem"
      Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/etcd/ca.pem"
      # Listen only on loopback interface.
      Environment="ETCD_LISTEN_CLIENT_URLS=http://127.0.0.1:2379,http://127.0.0.1:4001"

hostname: "Kube-MST1"

ssh_authorized_keys:
  - "ssh-rsa AAAAB3N....

coreos:
  etcd2:
    proxy: on
    listen-client-urls: "http://127.0.0.1:2379"
    initial-cluster: "ETCD1=http://192.168.1.7:2380,ETCD2=http://192.168.1.8:2380,ETCD3=http://192.168.1.9:2380"

  fleet:
    public-ip: "192.168.1.10"
    metadata: "region=us-east"
    etcd_servers: "http://127.0.0.1:2379"
    etcd_cafile: /etc/ssl/etcd/ca.pem
    etcd_certfile: /etc/ssl/etcd/client.pem
    etcd_keyfile: /etc/ssl/etcd/client-key.pem

  flannel:
    etcd_prefix: "/coreos.com/network"
    etcd_endpoints: "http://127.0.0.1:2379"
    public-ip: "192.168.1.10"
    interface: "192.168.1.10"
    etcd_cafile: /etc/ssl/etcd/ca.pem
    etcd_certfile: /etc/ssl/etcd/client.pem
    etcd_keyfile: /etc/ssl/etcd/client-key.pem

  update:
    reboot-strategy: "etcd-lock"

  units:
    - name: 00-ens192.network
      runtime: true
      content: |
        [Match]
        Name=ens192

        [Network]
        DNS=192.168.1.100
        DNS=192.168.1.101
        Address=192.168.1.10/24
        Gateway=192.168.1.1

    - name: flanneld.service
      command: start
      drop-ins:
        - name: 50-network-config.conf
          content: |
            [Service]
            ExecStartPre=/usr/bin/etcdctl --endpoints http://127.0.0.1:2379 \ --ca-file /etc/ssl/etcd/ca.pem --cert-file /etc/ssl/etcd/client.pem --key-file /etc/ssl/etcd/client-key.pem \ set /coreos.com/network/config '{ "Network": "10.0.0.0/16" }'

    - name: etcd2.service
      command: start

    - name: fleet.service
      command: start

    - name: docker.service
      drop-ins:
        - name: "50-insecure-registry.conf"
          content: |
            [Service]
            Environment=DOCKER_OPTS='--insecure-registry="proxy.test.lab:8081"'

    - name: docker.service
      drop-ins:
       - name: 51-docker-mirror.conf
         content: |
           [Unit]
           Requires=flanneld.service
           After=flanneld.service
           Restart=always
         command: start

    - name: kubelet-unit.service
      command: start
      content: |
        [Unit]
        Requires=flanneld.service
        After=flanneld.service

        [Service]
        Environment=KUBELET_VERSION=v1.5.3_coreos.0
        Environment="RKT_OPTS=--uuid-file-save=/var/run/kubelet-pod.uuid \
          --volume var-log,kind=host,source=/var/log \
          --mount volume=var-log,target=/var/log \
          --volume dns,kind=host,source=/etc/resolv.conf \
          --mount volume=dns,target=/etc/resolv.conf"
        ExecStartPre=/usr/bin/mkdir -p /var/log/containers
        ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/run/kubelet-pod.uuid
        ExecStart=/usr/lib/coreos/kubelet-wrapper \
          --api-servers=http://127.0.0.1:8080 \
          --register-schedulable=false \
          --cni-conf-dir=/etc/kubernetes/cni/net.d \
          --container-runtime=docker \
          --allow-privileged=true \
          --pod-manifest-path=/etc/kubernetes/manifests \
          --hostname-override= 192.168.1.10 \
          --cluster_dns= 10.9.0.100 \
          --cluster_domain=cluster.local
        ExecStop=-/usr/bin/rkt stop --uuid-file=/var/run/kubelet-pod.uuid
        Restart=always
        RestartSec=10

        [Install]
        WantedBy=multi-user.target
4

0 回答 0