Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk11 min

How to Set Up and Secure an etcd Cluster With Ansible on Ubuntu

Deploy a version-pinned etcd cluster with Ansible on Ubuntu, then secure client and peer traffic with separate certificates, verify authenticated health, and enable least-privilege RBAC.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build the cluster in two deliberate phases: first deploy a version-pinned etcd quorum with Ansible, then turn on mutual TLS and RBAC before allowing production clients to use it. etcd security is disabled by default, so an otherwise healthy cluster can expose its data to any reachable client. The safe sequence is to create a private CA, issue separate server, peer, and client certificates, template the same trust model onto every member, verify the cluster with an authenticated client, and only then enable RBAC.

This guide gives you an Ansible layout that you can adapt to your Ubuntu image and target etcd release. The etcd project publishes security documentation for v3.6 and v3.7, but exact flags and bootstrap behavior must be checked against the release you select. No current Ubuntu LTS was confirmed by the available documentation; record the exact Ubuntu image you test. Ubuntu 18.04, sometimes cited by older walkthroughs, is end-of-life and should not be treated as current guidance.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Define the versions, topology, and trust boundaries first

Write down the etcd version, Ubuntu image, architecture, and Ansible version before creating playbooks. Pin the etcd artifact rather than downloading an unversioned “latest” file. A three-member cluster is the usual minimum for fault tolerance because it can lose one member and retain quorum; use an odd number of members and place them on separate failure domains. The exact number of members, hostnames, addresses, and data directories belong in inventory variables so that the systemd unit and bootstrap arguments are generated from one source of truth.

Decide which traffic needs protection

  • Client traffic: applications and etcdctl connect to the client endpoint. Require a server certificate and client-certificate authentication.
  • Peer traffic: members exchange raft and replication messages. Protect it with separate peer certificates and peer TLS settings.
  • Administrative access: keep certificate keys readable only by the etcd service account and administrators who must rotate them.

Do not treat encryption of one path as protection for the other. Kubernetes guidance recommends separate key pairs for peer and client traffic, which also makes rotation and access review easier.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Choose an Ansible implementation

You can write a small role yourself or adopt a community role. Evaluate a role against the release and operating system you actually test; a role that worked for an older etcd or Ubuntu image can silently apply obsolete flags.

Option Certificate behavior What it manages Important qualification
githubixx/ansible-role-etcd Expects certificates to be created already in a directory on the controller; its companion CA role requires CFSSL binaries. Installs and configures a cluster. Confirm current etcd and Ubuntu support before use.
sergelogvinov/ansible-role-etcd Can create the CA and node certificates itself. Installs the cluster and certificate material. Inspect generated permissions and release defaults in a staging run.
ant31/etcd-ansible Includes a certificates role that generates and synchronizes peer, client, and server certificates. Deploys binaries and manages etcd with systemd. Check its variable names and supported versions against your target.
Custom role You control CA policy, certificate subjects, SANs, and rotation. Only what you implement and test. Requires the most testing, but avoids inheriting assumptions from an unmaintained role.

The decisive questions are whether certificates are generated or merely copied, whether the role targets your etcd release, whether it supports your Ubuntu image, and whether it configures RBAC or stops after TLS. A role that installs a daemon but leaves authentication disabled is not a secure deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Design the PKI before writing tasks

Create one private CA for the cluster, then issue distinct certificates for each function. Keep the CA key offline or in a tightly restricted Ansible vault; distribute only the CA certificate and the leaf keys required by each host.

Certificates to issue

  • Server certificate per member: used by the member when serving client HTTPS connections.
  • Peer certificate per member: used for member-to-member HTTPS connections. Do not reuse the client or server key pair.
  • Client certificate per administrative or application identity: used by etcdctl and by services that must connect.

Certificate subject names and Subject Alternative Names must cover the DNS names or addresses clients use. The exact SAN, key-usage, and extended-key-usage requirements vary with the etcd release and certificate tool; verify them in that release’s security documentation rather than copying an old example. A certificate that is signed by the right CA but does not match the endpoint name will still fail TLS verification.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Suggested controller layout

pki/ca/ca.crt
pki/ca/ca.key
pki/node1/server.crt
pki/node1/server.key
pki/node1/peer.crt
pki/node1/peer.key
pki/node2/server.crt
pki/node2/server.key
pki/node2/peer.crt
pki/node2/peer.key
pki/admin/client.crt
pki/admin/client.key

Never commit private keys to a public repository. Use Ansible Vault, an external secret store, or a protected controller path, and set restrictive modes when copying keys.

Create inventory and variables that describe the cluster

Keep topology in inventory and security material in group variables. The following is illustrative; replace names and addresses with values from your environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[etcd]
node1 ansible_host=10.0.0.11 etcd_name=node1
node2 ansible_host=10.0.0.12 etcd_name=node2
node3 ansible_host=10.0.0.13 etcd_name=node3

[etcd:vars]
etcd_version=3.6.x
etcd_data_dir=/var/lib/etcd
etcd_config_dir=/etc/etcd
etcd_pki_dir=/etc/etcd/pki
etcd_client_scheme=https
etcd_peer_scheme=https

Generate the initial-cluster string from inventory rather than hand-editing it in three host variables. Keep a separate variable for the advertised client URL and peer URL for every member. A typo in one member’s name or URL can create a split cluster even though every systemd service appears to be running.

Generate and distribute certificates with Ansible

There are two safe patterns. A certificate role can generate the CA and leaves on the controller, or you can create them in a controlled PKI process and have Ansible distribute only the resulting files. In either case, ensure every member trusts the same CA and receives only its own private keys.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
  1. Create the CA. Store the CA private key outside the target hosts. Record its algorithm, validity period, owner, and rotation procedure.
  2. Issue leaf certificates. Create a server and a peer certificate for each member, plus client certificates for administrators and applications. Include every endpoint name that the certificate will serve.
  3. Copy the CA certificate. Install it on every member and on every client that will verify etcd.
  4. Copy member keys. Use Ansible’s copy or template module with a mode such as 0600 for private keys and ownership restricted to the etcd service account.
  5. Check before restarting. Validate that the certificate dates, issuer, subject, and endpoint names match the host’s advertised URLs. A failed validation should stop the play before systemd is restarted.

Do not put a single shared private key on all members. Separate keys limit the impact of a compromised host and make per-node replacement possible.

Install the pinned etcd release and create a systemd unit

Use Ansible to install the exact binary archive or package selected during planning, create a dedicated service account, create the data and configuration directories, and deploy a systemd unit. Keep the unit in a template so each host receives its own name, URLs, and certificate paths.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[Unit]
Description=etcd key-value store
After=network-online.target
Wants=network-online.target

[Service]
User=etcd
Group=etcd
Type=notify
ExecStart=/usr/local/bin/etcd 
  --name={{ etcd_name }} 
  --data-dir={{ etcd_data_dir }} 
  --listen-client-urls={{ etcd_client_listen_urls }} 
  --advertise-client-urls={{ etcd_client_advertise_urls }} 
  --listen-peer-urls={{ etcd_peer_listen_urls }} 
  --initial-advertise-peer-urls={{ etcd_peer_advertise_urls }} 
  --initial-cluster={{ etcd_initial_cluster }} 
  --initial-cluster-state={{ etcd_initial_cluster_state }} 
  --initial-cluster-token={{ etcd_initial_cluster_token }} 
  --cert-file={{ etcd_pki_dir }}/server.crt 
  --key-file={{ etcd_pki_dir }}/server.key 
  --trusted-ca-file={{ etcd_pki_dir }}/ca.crt 
  --client-cert-auth=true 
  --peer-cert-file={{ etcd_pki_dir }}/peer.crt 
  --peer-key-file={{ etcd_pki_dir }}/peer.key 
  --peer-trusted-ca-file={{ etcd_pki_dir }}/ca.crt 
  --peer-client-cert-auth=true
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

The unit shows the security flags that matter, but flag names and defaults must be checked against your chosen release. Keep the unit free of private key contents; it should contain paths, not secrets. Set directory ownership before starting the service and run systemctl daemon-reload whenever the template changes.

Configure client and peer TLS correctly

The etcd security documentation describes the client-side flags --cert-file, --key-file, --trusted-ca-file, and --client-cert-auth. The peer equivalents are --peer-cert-file, --peer-key-file, --peer-trusted-ca-file, and --peer-client-cert-auth. The CA file must contain the CA that signed the corresponding certificates.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Connection Member presents Member verifies Required outcome
Client to server Server certificate Client certificate when client-cert-auth is enabled Unauthenticated HTTPS requests are rejected.
Peer to peer Peer certificate Peer certificate signed by the trusted peer CA Only trusted members join the raft network.

With client-certificate authentication enabled, etcd rejects HTTPS requests that lack a certificate signed by the trusted CA. Once authentication is enabled, the certificate’s Common Name supplies the etcd user name, so choose subject names that map cleanly to administrators and services.

Bootstrap the cluster with Ansible

  1. Prepare all hosts. Install the binary, create the service account and directories, distribute certificates, and render the unit without starting it.
  2. Set the initial state. For a new cluster, configure the same initial-cluster token and complete member list on every host. For an existing cluster, do not reuse new-cluster bootstrap settings; follow the release’s membership procedure.
  3. Start in a controlled order. Start all intended members close together so that quorum can form. Use Ansible handlers or an explicit start task, then wait for each service to report active.
  4. Check logs immediately. Look for certificate errors, name mismatches, rejected peer connections, data-directory conflicts, and disagreement over the initial cluster list.
  5. Persist the result. Once the cluster is healthy, keep the rendered variables and certificate inventory under change control, but never store private keys in an unprotected repository.

Do not add a fourth member to compensate for a misconfigured three-member cluster. Correct the configuration or replace the failed member using the documented membership workflow for your release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify health with an authenticated client

Do not use an unauthenticated health check as proof that the secured deployment works. Configure etcdctl with the API version required by your release and provide the CA, client certificate, client key, and HTTPS endpoint.

export ETCDCTL_API=3
etcdctl 
  --endpoints=https://node1.example.internal:2379 
  --cacert=/path/to/ca.crt 
  --cert=/path/to/admin-client.crt 
  --key=/path/to/admin-client.key 
  endpoint health

Run the check against each advertised endpoint, not only one node. A successful response proves that TLS negotiation, certificate validation, client authentication, and endpoint reachability work together. Also test a read and write using a non-production key prefix, then confirm that a request without the client certificate is rejected. Replace the illustrative endpoint and port with the values in your configuration.

Enable RBAC only after TLS is working

Transport authentication answers “who may establish a connection?” RBAC answers “what may that identity do?” Keep these changes separate so a certificate problem is not confused with an authorization problem.

  1. Create roles first. Define the smallest read, write, or administrative permissions your services need.
  2. Create users or service identities. Use the names represented by client-certificate Common Names, or the identity mechanism supported by your release.
  3. Bind identities to roles. Grant each user only the role required for its key prefix and operations.
  4. Test with the same certificate. Verify allowed reads and writes, then verify that an out-of-scope key is denied.
  5. Enable authentication. Run the release-appropriate etcdctl authentication command only after an administrative identity and role are ready.

A commonly documented command sequence uses etcdctl role add, etcdctl user add, etcdctl user grant-role, and finally etcdctl auth enable. Confirm exact syntax and bootstrap requirements in the official documentation for your etcd version before executing it. Keep the administrative client certificate offline when it is not needed and rotate it like any other credential.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operate the cluster securely after deployment

Protect files and processes

  • Set private-key permissions to the minimum required by the etcd service and administrators.
  • Restrict network access to client and peer listeners with host or network firewalls.
  • Do not expose a client listener directly to the public internet.
  • Back up the data directory or snapshots according to your recovery objective, and protect backups with the same confidentiality as live data.
  • Monitor systemd status, raft health, disk space, certificate expiry, and repeated TLS failures.

Plan certificate rotation

Track expiry dates before issuing certificates. A rotation plan should specify whether you replace a server certificate, a peer certificate, a client certificate, or the CA, and in what order. Stage new files with restrictive ownership, reload or restart only the affected member as required by the release, then run authenticated endpoint checks. CA replacement is a separate migration with broader trust implications; do not treat it as a routine leaf-certificate swap.

Upgrade deliberately

Read the upgrade notes for the exact etcd release and test the Ansible role in a non-production cluster. Preserve the data directory, certificate paths, and membership configuration. Upgrade one member at a time only when the cluster remains healthy and quorum is maintained. Recheck every security flag after an upgrade rather than assuming an old systemd template remains valid.

Troubleshooting decision tree

The service exits before joining

  • Check journalctl -u etcd for an unknown flag; this usually indicates a release mismatch.
  • Confirm the data directory is writable by the service account.
  • Compare the member name and every initial-cluster URL with inventory.

TLS handshake fails

  • Verify the client or peer certificate is signed by the CA configured in the corresponding trusted-ca file.
  • Check that the endpoint name used by the client appears in the certificate’s SANs.
  • Ensure the private key matches the certificate and that file permissions do not prevent etcd from reading it.
  • Confirm that the peer and client certificates were not accidentally swapped.

Health works without authentication but fails with certificates

  • Use the HTTPS endpoint and provide all three client files: CA, certificate, and key.
  • Check the certificate’s Common Name and expiry.
  • Verify that the client is using the API mode expected by the installed etcdctl.

Authentication succeeds but operations are denied

TLS proves identity; RBAC still may deny the operation. Inspect the user’s role bindings and key-prefix permissions with an administrative certificate, then grant only the missing permission.

Pre-production checklist

  • Etcd and Ubuntu versions are recorded and tested.
  • All members use the same CA, but each has unique server and peer keys.
  • Client and peer TLS flags are present and reviewed against the target release.
  • Unauthenticated client requests fail.
  • Authenticated endpoint health succeeds on every member.
  • RBAC roles and bindings are least-privilege and tested with real service certificates.
  • Systemd restarts, certificate rotation, backups, and member replacement have been rehearsed.
  • Private keys and CA material are absent from public source control and ordinary logs.

The reliable Ansible pattern is therefore repeatable rather than clever: pin the release, model the topology in inventory, generate a properly scoped PKI, template systemd and TLS settings, verify with client certificates, and enable RBAC only after transport security is demonstrably working.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.