mirror of https://github.com/kubernetes/kops.git
Merge pull request #10194 from elblivion/etcdmanager-logverbosity
Make etcd-manager log verbosity configurable
This commit is contained in:
commit
db473a11cd
|
|
@ -626,6 +626,10 @@ 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
|
||||||
|
logLevel:
|
||||||
|
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
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
memoryRequest:
|
memoryRequest:
|
||||||
anyOf:
|
anyOf:
|
||||||
|
|
|
||||||
|
|
@ -512,6 +512,9 @@ type EtcdManagerSpec struct {
|
||||||
// This allows etcd setting to be overwriten. No config validation is done.
|
// This allows etcd setting to be overwriten. No config validation is done.
|
||||||
// A list of etcd config ENV vars can be found at https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/configuration.md
|
// A list of etcd config ENV vars can be found at https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/configuration.md
|
||||||
Env []EnvVar `json:"env,omitempty"`
|
Env []EnvVar `json:"env,omitempty"`
|
||||||
|
// 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
|
||||||
|
LogLevel *int32 `json:"logLevel,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EtcdMemberSpec is a specification for a etcd member
|
// EtcdMemberSpec is a specification for a etcd member
|
||||||
|
|
|
||||||
|
|
@ -509,6 +509,9 @@ type EtcdManagerSpec struct {
|
||||||
// This allows etcd setting to be configured/overwriten. No config validation is done.
|
// This allows etcd setting to be configured/overwriten. No config validation is done.
|
||||||
// A list of etcd config ENV vars can be found at https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/configuration.md
|
// A list of etcd config ENV vars can be found at https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/configuration.md
|
||||||
Env []EnvVar `json:"env,omitempty"`
|
Env []EnvVar `json:"env,omitempty"`
|
||||||
|
// 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
|
||||||
|
LogLevel *int32 `json:"logLevel,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EtcdMemberSpec is a specification for a etcd member
|
// EtcdMemberSpec is a specification for a etcd member
|
||||||
|
|
|
||||||
|
|
@ -2957,6 +2957,7 @@ func autoConvert_v1alpha2_EtcdManagerSpec_To_kops_EtcdManagerSpec(in *EtcdManage
|
||||||
} else {
|
} else {
|
||||||
out.Env = nil
|
out.Env = nil
|
||||||
}
|
}
|
||||||
|
out.LogLevel = in.LogLevel
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2978,6 +2979,7 @@ func autoConvert_kops_EtcdManagerSpec_To_v1alpha2_EtcdManagerSpec(in *kops.EtcdM
|
||||||
} else {
|
} else {
|
||||||
out.Env = nil
|
out.Env = nil
|
||||||
}
|
}
|
||||||
|
out.LogLevel = in.LogLevel
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1323,6 +1323,11 @@ func (in *EtcdManagerSpec) DeepCopyInto(out *EtcdManagerSpec) {
|
||||||
*out = make([]EnvVar, len(*in))
|
*out = make([]EnvVar, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
|
if in.LogLevel != nil {
|
||||||
|
in, out := &in.LogLevel, &out.LogLevel
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1473,6 +1473,11 @@ func (in *EtcdManagerSpec) DeepCopyInto(out *EtcdManagerSpec) {
|
||||||
*out = make([]EnvVar, len(*in))
|
*out = make([]EnvVar, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
|
if in.LogLevel != nil {
|
||||||
|
in, out := &in.LogLevel, &out.LogLevel
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,12 @@ func (b *EtcdManagerBuilder) buildPod(etcdCluster kops.EtcdClusterSpec) (*v1.Pod
|
||||||
EtcdInsecure: etcdInsecure,
|
EtcdInsecure: etcdInsecure,
|
||||||
}
|
}
|
||||||
|
|
||||||
config.LogVerbosity = 6
|
config.LogLevel = 6
|
||||||
|
|
||||||
|
if etcdCluster.Manager != nil && etcdCluster.Manager.LogLevel != nil {
|
||||||
|
klog.Warningf("overriding log level in manifest %s, new level is %d", bundle, int(*etcdCluster.Manager.LogLevel))
|
||||||
|
config.LogLevel = int(*etcdCluster.Manager.LogLevel)
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
scheme := "https"
|
scheme := "https"
|
||||||
|
|
@ -512,8 +517,8 @@ func (b *EtcdManagerBuilder) buildPod(etcdCluster kops.EtcdClusterSpec) (*v1.Pod
|
||||||
|
|
||||||
// config defines the flags for etcd-manager
|
// config defines the flags for etcd-manager
|
||||||
type config struct {
|
type config struct {
|
||||||
// LogVerbosity sets the log verbosity level
|
// LogLevel sets the log verbosity level
|
||||||
LogVerbosity int `flag:"v"`
|
LogLevel int `flag:"v"`
|
||||||
|
|
||||||
// Containerized is set if etcd-manager is running in a container
|
// Containerized is set if etcd-manager is running in a container
|
||||||
Containerized bool `flag:"containerized"`
|
Containerized bool `flag:"containerized"`
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ spec:
|
||||||
- instanceGroup: master-us-test-1a
|
- instanceGroup: master-us-test-1a
|
||||||
name: us-test-1a
|
name: us-test-1a
|
||||||
manager:
|
manager:
|
||||||
|
logLevel: 3
|
||||||
env:
|
env:
|
||||||
- name: ETCD_QUOTA_BACKEND_BYTES
|
- name: ETCD_QUOTA_BACKEND_BYTES
|
||||||
value: "10737418240"
|
value: "10737418240"
|
||||||
|
|
@ -28,6 +29,7 @@ spec:
|
||||||
- instanceGroup: master-us-test-1a
|
- instanceGroup: master-us-test-1a
|
||||||
name: us-test-1a
|
name: us-test-1a
|
||||||
manager:
|
manager:
|
||||||
|
logLevel: 3
|
||||||
env:
|
env:
|
||||||
- name: ETCD_QUOTA_BACKEND_BYTES
|
- name: ETCD_QUOTA_BACKEND_BYTES
|
||||||
value: "10737418240"
|
value: "10737418240"
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ Contents:
|
||||||
- command:
|
- command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- mkfifo /tmp/pipe; (tee -a /var/log/etcd.log < /tmp/pipe & ) ; exec /etcd-manager --backup-store=memfs://clusters.example.com/minimal.example.com/backups/etcd-events --client-urls=https://__name__:4002 --cluster-name=etcd-events --containerized=true --dns-suffix=.internal.minimal.example.com --etcd-insecure=true --grpc-port=3997 --insecure=false --peer-urls=https://__name__:2381 --quarantine-client-urls=https://__name__:3995 --v=6 --volume-name-tag=k8s.io/etcd/events --volume-provider=aws --volume-tag=k8s.io/etcd/events --volume-tag=k8s.io/role/master=1 --volume-tag=kubernetes.io/cluster/minimal.example.com=owned > /tmp/pipe 2>&1
|
- mkfifo /tmp/pipe; (tee -a /var/log/etcd.log < /tmp/pipe & ) ; exec /etcd-manager --backup-store=memfs://clusters.example.com/minimal.example.com/backups/etcd-events --client-urls=https://__name__:4002 --cluster-name=etcd-events --containerized=true --dns-suffix=.internal.minimal.example.com --etcd-insecure=true --grpc-port=3997 --insecure=false --peer-urls=https://__name__:2381 --quarantine-client-urls=https://__name__:3995 --v=3 --volume-name-tag=k8s.io/etcd/events --volume-provider=aws --volume-tag=k8s.io/etcd/events --volume-tag=k8s.io/role/master=1 --volume-tag=kubernetes.io/cluster/minimal.example.com=owned > /tmp/pipe 2>&1
|
||||||
env:
|
env:
|
||||||
- name: ETCD_QUOTA_BACKEND_BYTES
|
- name: ETCD_QUOTA_BACKEND_BYTES
|
||||||
value: "10737418240"
|
value: "10737418240"
|
||||||
|
|
@ -141,7 +141,7 @@ Contents:
|
||||||
- command:
|
- command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- mkfifo /tmp/pipe; (tee -a /var/log/etcd.log < /tmp/pipe & ) ; exec /etcd-manager --backup-store=memfs://clusters.example.com/minimal.example.com/backups/etcd-main --client-urls=https://__name__:4001 --cluster-name=etcd --containerized=true --dns-suffix=.internal.minimal.example.com --etcd-insecure=true --grpc-port=3996 --insecure=false --peer-urls=https://__name__:2380 --quarantine-client-urls=https://__name__:3994 --v=6 --volume-name-tag=k8s.io/etcd/main --volume-provider=aws --volume-tag=k8s.io/etcd/main --volume-tag=k8s.io/role/master=1 --volume-tag=kubernetes.io/cluster/minimal.example.com=owned > /tmp/pipe 2>&1
|
- mkfifo /tmp/pipe; (tee -a /var/log/etcd.log < /tmp/pipe & ) ; exec /etcd-manager --backup-store=memfs://clusters.example.com/minimal.example.com/backups/etcd-main --client-urls=https://__name__:4001 --cluster-name=etcd --containerized=true --dns-suffix=.internal.minimal.example.com --etcd-insecure=true --grpc-port=3996 --insecure=false --peer-urls=https://__name__:2380 --quarantine-client-urls=https://__name__:3994 --v=3 --volume-name-tag=k8s.io/etcd/main --volume-provider=aws --volume-tag=k8s.io/etcd/main --volume-tag=k8s.io/role/master=1 --volume-tag=kubernetes.io/cluster/minimal.example.com=owned > /tmp/pipe 2>&1
|
||||||
env:
|
env:
|
||||||
- name: ETCD_QUOTA_BACKEND_BYTES
|
- name: ETCD_QUOTA_BACKEND_BYTES
|
||||||
value: "10737418240"
|
value: "10737418240"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue