mirror of https://github.com/kubernetes/kops.git
Add option for specifying the list of etcd metrics urls
This commit is contained in:
parent
cad5b69446
commit
e8980bc21a
|
|
@ -1265,6 +1265,13 @@ spec:
|
||||||
image:
|
image:
|
||||||
description: Image is the etcd manager image to use.
|
description: Image is the etcd manager image to use.
|
||||||
type: string
|
type: string
|
||||||
|
listenMetricsURLs:
|
||||||
|
description: ListenMetricsURLs is the list of URLs to listen
|
||||||
|
on that will respond to both the /metrics and /health
|
||||||
|
endpoints
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
logLevel:
|
logLevel:
|
||||||
description: LogLevel allows the klog library verbose log
|
description: LogLevel allows the klog library verbose log
|
||||||
level to be set for etcd-manager. The default is 6. https://github.com/google/glog#verbose-logging
|
level to be set for etcd-manager. The default is 6. https://github.com/google/glog#verbose-logging
|
||||||
|
|
|
||||||
|
|
@ -680,6 +680,8 @@ type EtcdManagerSpec struct {
|
||||||
BackupRetentionDays *uint32 `json:"backupRetentionDays,omitempty"`
|
BackupRetentionDays *uint32 `json:"backupRetentionDays,omitempty"`
|
||||||
// DiscoveryPollInterval which is used for discovering other cluster members. The default is 60 seconds.
|
// DiscoveryPollInterval which is used for discovering other cluster members. The default is 60 seconds.
|
||||||
DiscoveryPollInterval *metav1.Duration `json:"discoveryPollInterval,omitempty"`
|
DiscoveryPollInterval *metav1.Duration `json:"discoveryPollInterval,omitempty"`
|
||||||
|
// ListenMetricsURLs is the list of URLs to listen on that will respond to both the /metrics and /health endpoints
|
||||||
|
ListenMetricsURLs []string `json:"listenMetricsURLs,omitempty"`
|
||||||
// LogLevel allows the klog library verbose log level to be set for etcd-manager. The default is 6.
|
// LogLevel allows the klog library verbose log level to be set for etcd-manager. The default is 6.
|
||||||
// https://github.com/google/glog#verbose-logging
|
// https://github.com/google/glog#verbose-logging
|
||||||
LogLevel *int32 `json:"logLevel,omitempty"`
|
LogLevel *int32 `json:"logLevel,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -676,6 +676,8 @@ type EtcdManagerSpec struct {
|
||||||
BackupRetentionDays *uint32 `json:"backupRetentionDays,omitempty"`
|
BackupRetentionDays *uint32 `json:"backupRetentionDays,omitempty"`
|
||||||
// DiscoveryPollInterval which is used for discovering other cluster members. The default is 60 seconds.
|
// DiscoveryPollInterval which is used for discovering other cluster members. The default is 60 seconds.
|
||||||
DiscoveryPollInterval *metav1.Duration `json:"discoveryPollInterval,omitempty"`
|
DiscoveryPollInterval *metav1.Duration `json:"discoveryPollInterval,omitempty"`
|
||||||
|
// ListenMetricsURLs is the list of URLs to listen on that will respond to both the /metrics and /health endpoints
|
||||||
|
ListenMetricsURLs []string `json:"listenMetricsURLs,omitempty"`
|
||||||
// LogLevel allows the klog library verbose log level to be set for etcd-manager. The default is 6.
|
// LogLevel allows the klog library verbose log level to be set for etcd-manager. The default is 6.
|
||||||
// https://github.com/google/glog#verbose-logging
|
// https://github.com/google/glog#verbose-logging
|
||||||
LogLevel *int32 `json:"logLevel,omitempty"`
|
LogLevel *int32 `json:"logLevel,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -3586,6 +3586,7 @@ func autoConvert_v1alpha2_EtcdManagerSpec_To_kops_EtcdManagerSpec(in *EtcdManage
|
||||||
out.BackupInterval = in.BackupInterval
|
out.BackupInterval = in.BackupInterval
|
||||||
out.BackupRetentionDays = in.BackupRetentionDays
|
out.BackupRetentionDays = in.BackupRetentionDays
|
||||||
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
||||||
|
out.ListenMetricsURLs = in.ListenMetricsURLs
|
||||||
out.LogLevel = in.LogLevel
|
out.LogLevel = in.LogLevel
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -3611,6 +3612,7 @@ func autoConvert_kops_EtcdManagerSpec_To_v1alpha2_EtcdManagerSpec(in *kops.EtcdM
|
||||||
out.BackupInterval = in.BackupInterval
|
out.BackupInterval = in.BackupInterval
|
||||||
out.BackupRetentionDays = in.BackupRetentionDays
|
out.BackupRetentionDays = in.BackupRetentionDays
|
||||||
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
||||||
|
out.ListenMetricsURLs = in.ListenMetricsURLs
|
||||||
out.LogLevel = in.LogLevel
|
out.LogLevel = in.LogLevel
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1912,6 +1912,11 @@ func (in *EtcdManagerSpec) DeepCopyInto(out *EtcdManagerSpec) {
|
||||||
*out = new(v1.Duration)
|
*out = new(v1.Duration)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.ListenMetricsURLs != nil {
|
||||||
|
in, out := &in.ListenMetricsURLs, &out.ListenMetricsURLs
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
if in.LogLevel != nil {
|
if in.LogLevel != nil {
|
||||||
in, out := &in.LogLevel, &out.LogLevel
|
in, out := &in.LogLevel, &out.LogLevel
|
||||||
*out = new(int32)
|
*out = new(int32)
|
||||||
|
|
|
||||||
|
|
@ -637,6 +637,8 @@ type EtcdManagerSpec struct {
|
||||||
BackupRetentionDays *uint32 `json:"backupRetentionDays,omitempty"`
|
BackupRetentionDays *uint32 `json:"backupRetentionDays,omitempty"`
|
||||||
// DiscoveryPollInterval which is used for discovering other cluster members. The default is 60 seconds.
|
// DiscoveryPollInterval which is used for discovering other cluster members. The default is 60 seconds.
|
||||||
DiscoveryPollInterval *metav1.Duration `json:"discoveryPollInterval,omitempty"`
|
DiscoveryPollInterval *metav1.Duration `json:"discoveryPollInterval,omitempty"`
|
||||||
|
// ListenMetricsURLs is the list of URLs to listen on that will respond to both the /metrics and /health endpoints
|
||||||
|
ListenMetricsURLs []string `json:"listenMetricsURLs,omitempty"`
|
||||||
// LogLevel allows the klog library verbose log level to be set for etcd-manager. The default is 6.
|
// LogLevel allows the klog library verbose log level to be set for etcd-manager. The default is 6.
|
||||||
// https://github.com/google/glog#verbose-logging
|
// https://github.com/google/glog#verbose-logging
|
||||||
LogLevel *int32 `json:"logLevel,omitempty"`
|
LogLevel *int32 `json:"logLevel,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -3813,6 +3813,7 @@ func autoConvert_v1alpha3_EtcdManagerSpec_To_kops_EtcdManagerSpec(in *EtcdManage
|
||||||
out.BackupInterval = in.BackupInterval
|
out.BackupInterval = in.BackupInterval
|
||||||
out.BackupRetentionDays = in.BackupRetentionDays
|
out.BackupRetentionDays = in.BackupRetentionDays
|
||||||
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
||||||
|
out.ListenMetricsURLs = in.ListenMetricsURLs
|
||||||
out.LogLevel = in.LogLevel
|
out.LogLevel = in.LogLevel
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -3838,6 +3839,7 @@ func autoConvert_kops_EtcdManagerSpec_To_v1alpha3_EtcdManagerSpec(in *kops.EtcdM
|
||||||
out.BackupInterval = in.BackupInterval
|
out.BackupInterval = in.BackupInterval
|
||||||
out.BackupRetentionDays = in.BackupRetentionDays
|
out.BackupRetentionDays = in.BackupRetentionDays
|
||||||
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
out.DiscoveryPollInterval = in.DiscoveryPollInterval
|
||||||
|
out.ListenMetricsURLs = in.ListenMetricsURLs
|
||||||
out.LogLevel = in.LogLevel
|
out.LogLevel = in.LogLevel
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1802,6 +1802,11 @@ func (in *EtcdManagerSpec) DeepCopyInto(out *EtcdManagerSpec) {
|
||||||
*out = new(v1.Duration)
|
*out = new(v1.Duration)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.ListenMetricsURLs != nil {
|
||||||
|
in, out := &in.ListenMetricsURLs, &out.ListenMetricsURLs
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
if in.LogLevel != nil {
|
if in.LogLevel != nil {
|
||||||
in, out := &in.LogLevel, &out.LogLevel
|
in, out := &in.LogLevel, &out.LogLevel
|
||||||
*out = new(int32)
|
*out = new(int32)
|
||||||
|
|
|
||||||
|
|
@ -1949,6 +1949,11 @@ func (in *EtcdManagerSpec) DeepCopyInto(out *EtcdManagerSpec) {
|
||||||
*out = new(v1.Duration)
|
*out = new(v1.Duration)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.ListenMetricsURLs != nil {
|
||||||
|
in, out := &in.ListenMetricsURLs, &out.ListenMetricsURLs
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
if in.LogLevel != nil {
|
if in.LogLevel != nil {
|
||||||
in, out := &in.LogLevel, &out.LogLevel
|
in, out := &in.LogLevel, &out.LogLevel
|
||||||
*out = new(int32)
|
*out = new(int32)
|
||||||
|
|
|
||||||
|
|
@ -541,6 +541,15 @@ func (b *EtcdManagerBuilder) buildPod(etcdCluster kops.EtcdClusterSpec, instance
|
||||||
container.Env = append(container.Env, envVar)
|
container.Env = append(container.Env, envVar)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(etcdCluster.Manager.ListenMetricsURLs) > 0 {
|
||||||
|
envVar := v1.EnvVar{
|
||||||
|
Name: "ETCD_LISTEN_METRICS_URLS",
|
||||||
|
Value: strings.Join(etcdCluster.Manager.ListenMetricsURLs, ","),
|
||||||
|
}
|
||||||
|
|
||||||
|
container.Env = append(container.Env, envVar)
|
||||||
|
}
|
||||||
|
|
||||||
for _, envVar := range etcdCluster.Manager.Env {
|
for _, envVar := range etcdCluster.Manager.Env {
|
||||||
klog.V(2).Infof("overloading ENV var in manifest %s with %s=%s", bundle, envVar.Name, envVar.Value)
|
klog.V(2).Infof("overloading ENV var in manifest %s with %s=%s", bundle, envVar.Name, envVar.Value)
|
||||||
configOverwrite := v1.EnvVar{
|
configOverwrite := v1.EnvVar{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue