Anybody successfully gotten CoreOS to bootstrap?

dreamcompute

#1

I’m wondering if anybody would be willing to share their cloud-config that they’ve used to get CoreOS bootstrapped?

I can ssh into all my instances, I’ve opened my ports, but etcd2 fails to recognize anything other than the machine it’s currently running on.

I’ve got an updated image file I’m loading since I think the one available in the panel is like v644 or something and doesn’t start with etcd2.

Anybody got a known good config?


#2

We know there are some issues DreamCompute because $private_ipv4 is not properly set and cloudconfig can’t figure that out. Can you share your cloudconfig?


#3

Oh hello, that’s basically all I was hoping to confirm.

It seems I can’t find the git post that had this on it anymore :confused: Sorry about that, I’m not bent out of shape at all, great service, good value.

[code]#cloud-config

write_files:

  • path: /run/cloud-config.yml
    permissions: '0644’
    content: |
    #cloud-config

    coreos:
    update:
    reboot-strategy: etcd-lock
    etcd2:
    discovery: "https://discovery.etcd.io/$etcd2key"
    advertise-client-urls: "http://:2379$publicip"
    initial-advertise-peer-urls: “http://:2380$privateip
    # listen on both the official ports and the legacy ports
    # legacy ports can be omitted if your application doesn’t depend on them
    listen-client-urls: "http://0.0.0.0:2379,http://0.0.0.0:4001"
    listen-peer-urls: "http://:2380$publicip,http://:7001$publicip"
    fleet:
    # used for fleetctl ssh command
    public-ip: $_private_ipv4
    units:
    - name: etcd2.service
    command: start
    - name: fleet.service
    command: start
    ssh_authorized_keys:
    - ssh-rsa A…

  • path: /run/setup-environment.sh
    permissions: '0755’
    content: |
    #!/bin/bash

    ENV="/etc/environment"

    Test for RW access to $1

    touch $ENV
    if [ $? -ne 0 ]; then
    echo exiting, unable to modify: $ENV
    exit 1
    fi

    Setup environment target

    sed -i -e ‘/^COREOS_PUBLIC_IPV4=/d’
    -e ‘/^COREOS_PRIVATE_IPV4=/d’
    “${ENV}”

    We spin loop until the nova-agent sets up the IP addresses

    function get_ip () {
    IF=$1
    IP=
    while [ 1 ]; do
    IP=$(ifconfig $IF | awk ‘/inet / {print $2}’)
    if [ “$IP” != “” ]; then
    break
    fi
    sleep .1
    done
    echo $IP
    }

    Echo results of IP queries to environment file as soon as network interfaces

    get assigned IPs

    echo COREOS_PUBLIC_IPV4=$(get_ip ens3) >> $ENV # Also assigned to same IP
    echo COREOS_PRIVATE_IPV4=$(get_ip ens3) >> $ENV
    coreos:
    units:

    • name: setup-environment.service
      command: start
      runtime: true
      content: |
      [Unit]
      Description=Setup environment with private (and public) IP addresses

      [Service]
      Type=oneshot
      RemainAfterExit=yes
      ExecStart=/run/setup-environment.sh

    • name: second-stage-cloudinit.service
      runtime: true
      command: start
      content: |
      [Unit]
      Description=Run coreos-cloudinit with actual cloud-config after environment has been set up
      Requires=setup-environment.service
      After=setup-environment.service
      Requires=user-cloudinit-proc-cmdline.service
      After=user-cloudinit-proc-cmdline.service

      [Service]
      Type=oneshot
      RemainAfterExit=yes
      EnvironmentFile=/etc/environment
      ExecStartPre=/usr/bin/sed -i ‘s/$_private/$private/g’ /run/cloud-config.yml
      ExecStart=/usr/bin/coreos-cloudinit --from-file=/run/cloud-config.yml
      ssh_authorized_keys:

  • ssh-rsa A…[/code]