Skip to content

Instantly share code, notes, and snippets.

@rbdiang
Last active October 9, 2018 04:52
Show Gist options
  • Save rbdiang/9a94e42dee8e96ad2bbfb9fc54e24283 to your computer and use it in GitHub Desktop.
Save rbdiang/9a94e42dee8e96ad2bbfb9fc54e24283 to your computer and use it in GitHub Desktop.

docker add label pki.dns to all nodes

This command sets the pki.dns label = to uc-<IP ADDRESS>.vcloud.w.com, where <IP ADDRESS> is the ip address with octets seperated by dashes - instead of period .

docker node ls --format '{{.ID}}' | \
xargs docker node inspect $1  \
   --format 'docker node update --label-add pki.dns=uc-{{join (split .Status.Addr ".") "-" }}.vcloud.w.com {{.ID}}' | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment