apiVersion: v1
kind: Secret
metadata:
  name: example-encrypted-service-group-ring-key
type: Opaque
data:
  # base64-encoded ring key
  ring-key: U1lNLVNFQy0xCnJpbmcta2V5LTIwMTcwODE2MTAyMDQ5CgpyTmtKbkJxZHppVWdmdnYweEVhaWpzMWxHUGZUdHBLdFg0L0xaMmpQcWdJPQ==
---
apiVersion: habitat.sh/v1
kind: ServiceGroup
metadata:
  name: example-encrypted-service-group
spec:
  # the core/nginx habitat service packaged as a Docker image
  image: kinvolk/nginx-hab
  count: 1
  habitat:
    topology: standalone
    # the name of the secret containing the ring key
    ringKey: example-encrypted-service-group-ring-key

apiVersion: v1
kind: Secret
metadata:
  name: example-encrypted-service-group-ring-key
type: Opaque
data:
  # base64-encoded ring key
  ring-key: U1lNLVNFQy0xCnJpbmcta2V5LTIwMTcwODE2MTAyMDQ5CgpyTmtKbkJxZHppVWdmdnYweEVhaWpzMWxHUGZUdHBLdFg0L0xaMmpQcWdJPQ==
---
apiVersion: habitat.sh/v1
kind: ServiceGroup
metadata:
  name: example-encrypted-service-group
spec:
  # the core/nginx habitat service packaged as a Docker image
  image: kinvolk/consul-hab
  count: 3
  habitat:
    topology: leader-follower
    # the name of the secret containing the ring key
    ringKey: example-encrypted-service-group-ring-key

Use leader topology in example
Use leader topology in example

This allows users to see whether ring communication actually works.

And since we are in a leader topology, it makes sense to use an
application that itself elects a leader.
