Add the bootstrap config for the CA
This commit is contained in:
parent
4d0713d5bb
commit
e26819ed9c
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue