Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey! I’ve tried this multiple times, but somehow it never works. Fleet does not hang, it just can’t talk to etcd. I’ve used both alpha and stable CoreOS, none of them work.
It seems that the error is somewhere in the config, because whenever I try to use etcdctl it gives me the following errors (maybe it’s some certificate-thing?):
Error: client: etcd cluster is unavailable or misconfigured
error #0: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
error #1: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
Help is much appreciated!
EDIT: I’ve also changed a bit in my cloud-config, since I anticipate that I will be running a multi-region cluster. I am not sure if this is where the fault lies.
EDIT 2: Manually passing in the endpoint to etcdctl (along with cert etc.) works somewhat, it’s just empty.
etcdctl --endpoint=https://127.0.0.1:4001 --ca-file=ca.pem --cert-file=coreos.pem --key-file=coreos-key.pem --no-sync ls
EDIT 3: I solved it! If you want to do it with $public_ipv4, remember to add the public IP to your certificate as well. Don’t know why I forgot that.
Based on the comments I was able to get etcdctr to query the information I was looking for.
My question using the defined parameters in this tut how do we go about not passing the keys into the etcdctrl or is that just part of using https. I can’t seem to find any docs that suggest it’s normal.
For the purpose of figuring this out I have no intention of using public ips, and I’m running alpha 935 on all 3 clusters.
Works.
core@coreos-01 ~ $ etcdctl --endpoint="https://127.0.0.1:2379/" --cert-file=/home/core/coreos.pem --key-file=/home/core/coreos-key.pem --ca-file=/home/core/ca.pem cluster-health
member bb4f3ffa3ba3810 is healthy: got healthy result from https://10.128.7.140:2379
member 41fde4594c7a5544 is healthy: got healthy result from https://10.128.5.5:2379
member 4aeeab5914279dd5 is healthy: got healthy result from https://10.128.7.70:2379
cluster is healthy
core@coreos-01 ~ $ fleetctl list-machines
MACHINE IP METADATA
55bcd9db... 10.128.7.140 -
795000ef... 10.128.7.70 -
c24c2e8b... 10.128.5.5 -
Does not work.
core@coreos-01 ~ $ etcdctl cluster-health
cluster may be unhealthy: failed to list members
Error: client: etcd cluster is unavailable or misconfigured
error #0: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
error #1: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
Clound Config
scott@scott-u:~/coreos$ cat cloud-config-coreos-01.yml
#cloud-config
hostname: 'coreos-01'
coreos:
etcd2:
name: 'coreos-01'
# generate a new token for each unique cluster from https://discovery.etcd.io/new:
discovery: https://discovery.etcd.io/2bef17b39c1453d3d8467ef8399110e7
# multi-region deployments, multi-cloud deployments, and Droplets without
# private networking need to use $public_ipv4:
advertise-client-urls: https://$private_ipv4:2379,https://$private_ipv4:4001
initial-advertise-peer-urls: https://$private_ipv4:2380
# listen on the official ports 2379, 2380 and one legacy port 4001:
listen-client-urls: https://0.0.0.0:2379,https://0.0.0.0:4001
listen-peer-urls: https://$private_ipv4:2380
fleet:
# fleet defaults to plain HTTP - explicitly tell it to use HTTPS on port 4001:
etcd_servers: https://$private_ipv4:4001
public-ip: $private_ipv4 # used for fleetctl ssh command
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
# enable and start iptables-restore
- name: iptables-restore.service
enable: true
command: start
write_files:
# tell etcd2 and fleet where our certificates are going to live:
- path: /etc/systemd/system/etcd2.service.d/30-certificates.conf
permissions: 0644
content: |
[Service]
# client environment variables
Environment=ETCD_CA_FILE=/home/core/ca.pem
Environment=ETCD_CERT_FILE=/home/core/coreos.pem
Environment=ETCD_KEY_FILE=/home/core/coreos-key.pem
# peer environment variables
Environment=ETCD_PEER_CA_FILE=/home/core/ca.pem
Environment=ETCD_PEER_CERT_FILE=/home/core/coreos.pem
Environment=ETCD_PEER_KEY_FILE=/home/core/coreos-key.pem
- path: /run/systemd/system/fleet.service.d/30-certificates.conf
permissions: 0644
content: |
[Service]
# client auth certs
Environment=FLEET_ETCD_CAFILE=/home/core/ca.pem
Environment=FLEET_ETCD_CERTFILE=/home/core/coreos.pem
Environment=FLEET_ETCD_KEYFILE=/home/core/coreos-key.pem
30-certs
core@coreos-01 ~ $ cat /run/systemd/system/etcd2.service.d/30-certificates.conf
[Service]
# client environment variables
Environment=ETCD_CA_FILE=/home/core/ca.pem
Environment=ETCD_CERT_FILE=/home/core/coreos.pem
Environment=ETCD_KEY_FILE=/home/core/coreos-key.pem
# peer environment variables
Environment=ETCD_PEER_CA_FILE=/home/core/ca.pem
Environment=ETCD_PEER_CERT_FILE=/home/core/coreos.pem
Environment=ETCD_PEER_KEY_FILE=/home/core/coreos-key.pem
core@coreos-01 ~ $ cat /run/systemd/system/fleet.service.d/30-certificates.conf
[Service]
# client auth certs
Environment=FLEET_ETCD_CAFILE=/home/core/ca.pem
Environment=FLEET_ETCD_CERTFILE=/home/core/coreos.pem
Environment=FLEET_ETCD_KEYFILE=/home/core/coreos-key.pem
Holy moly. Be very careful of spaces and syntax in the ssl certificate json files. I had a space after one of the IPs (my private IP of course), and it wouldn’t match in etcd.
As the other commenter mentioned, checking cluster health using this is a great way to check if etcd is working.
etcdctl --endpoint="https://127.0.0.1:2379/" --cert-file=/home/core/coreos.pem --key-file=/home/core/coreos-key.pem --ca-file=/home/core/ca.pem cluster-health
This comment has been deleted
Thanks for an excellent article!
Instead of setting the SSL configuration for Fleet and etcd in the write_files section, you can do this directly in each units’ own section. For example,
Environment=ETCD_CERT_FILE=/home/core/coreos.pem
Can be written as:
etcd2:
...
cert_file: /home/core/coreos.pem
great article but I think that DO should have scripts that do some part of this for those users who want to knock it out. Sure there is nothing wrong with understanding the tools or the environment but a little help would be appreciated.
It would be great if you could provide the OpenSSL configuration as well. Its good and all that the CoreOS team has chosen to use CFSSL as their preferred tool for creating certificates, but OpenSSL is a lot more prevalent, available on *nix platforms by default, and is the industry standard for creating keys. You show two different methods for creating Digital Ocean droplets, why not enhance your tutorial for those of us who don’t want to have to install a new compiler to create new tool that does the exact same job of a standard tool that comes bundled with the system.
This is a good tutorial. In case folks trying to use it today have problems, there are guides over at coreos.com that are more up to date, and this article will help to customize those instructions for the DigitalOcean environment.
https://coreos.com/os/docs/latest/generate-self-signed-certificates.html https://coreos.com/etcd/docs/latest/etcd-live-http-to-https-migration.html https://coreos.com/etcd/docs/latest/tls-etcd-clients.html
Thank you for the excellent article. I had no trouble following the steps and all the commands worked on the first try.