mirror of
https://github.com/docker/docs.git
synced 2026-03-28 06:49:00 +07:00
This adds TLS support into the KV store for swarm. The manage, join,
and list commands all have a new CLI argument, matching the docker engine
discovery backend. This required adding the tlsconfig utility
package from docker engine.
Here's an example showing re-use of the cluster certs for the KV store:
swarm manage --tlsverify \
--tlscacert /etc/docker/ssl/ca.pem
--tlscert /etc/docker/ssl/cert.pem
--tlskey /etc/docker/ssl/key.pem
--discovery-opt kv.cacertfile=/etc/docker/ssl/ca.pem
--discovery-opt kv.certfile=/etc/docker/ssl/cert.pem
--discovery-opt kv.keyfile=/etc/docker/ssl/key.pem
--advertise 192.168.122.47:3376
etcd://192.168.122.47:2379
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
23 lines
434 B
Go
23 lines
434 B
Go
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
"github.com/codegangsta/cli"
|
|
"github.com/docker/swarm/discovery/token"
|
|
)
|
|
|
|
func create(c *cli.Context) {
|
|
if len(c.Args()) != 0 {
|
|
log.Fatalf("the `create` command takes no arguments. See '%s create --help'.", c.App.Name)
|
|
}
|
|
discovery := &token.Discovery{}
|
|
discovery.Initialize("", 0, 0, nil)
|
|
token, err := discovery.CreateCluster()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
fmt.Println(token)
|
|
}
|