Add the bootstrap config for the CA

This commit is contained in:
Kyle Havlovitz 2018-04-08 21:56:46 -07:00 committed by Mitchell Hashimoto
parent 4d0713d5bb
commit e26819ed9c
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import (
"time" "time"
"github.com/hashicorp/consul/agent/consul/autopilot" "github.com/hashicorp/consul/agent/consul/autopilot"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/lib"
"github.com/hashicorp/consul/tlsutil" "github.com/hashicorp/consul/tlsutil"
"github.com/hashicorp/consul/types" "github.com/hashicorp/consul/types"
@ -346,6 +347,10 @@ type Config struct {
// autopilot tasks, such as promoting eligible non-voters and removing // autopilot tasks, such as promoting eligible non-voters and removing
// dead servers. // dead servers.
AutopilotInterval time.Duration AutopilotInterval time.Duration
// CAConfig is used to apply the initial Connect CA configuration when
// bootstrapping.
CAConfig *structs.CAConfiguration
} }
// CheckProtocolVersion validates the protocol version. // CheckProtocolVersion validates the protocol version.
@ -427,6 +432,15 @@ func DefaultConfig() *Config {
ServerHealthInterval: 2 * time.Second, ServerHealthInterval: 2 * time.Second,
AutopilotInterval: 10 * time.Second, AutopilotInterval: 10 * time.Second,
CAConfig: &structs.CAConfiguration{
Provider: "consul",
Config: map[string]interface{}{
"PrivateKey": "",
"RootCert": "",
"RotationPeriod": 90 * 24 * time.Hour,
},
},
} }
// Increase our reap interval to 3 days instead of 24h. // Increase our reap interval to 3 days instead of 24h.