mirror of https://github.com/kubernetes/kops.git
Merge pull request #10957 from adrianmoisey/add_kubelet_arg_enable_cadvisor_json_endpoints
Add support for enable-cadvisor-json-endpoints with Kubelet
This commit is contained in:
commit
83e1424280
|
@ -2318,6 +2318,10 @@ spec:
|
|||
description: DockerDisableSharedPID uses a shared PID namespace
|
||||
for containers in a pod.
|
||||
type: boolean
|
||||
enableCadvisorJsonEndpoints:
|
||||
description: EnableCadvisorJsonEndpoints enables cAdvisor json
|
||||
`/spec` and `/stats/*` endpoints. Defaults to False.
|
||||
type: boolean
|
||||
enableCustomMetrics:
|
||||
description: Enable gathering custom metrics.
|
||||
type: boolean
|
||||
|
@ -2720,6 +2724,10 @@ spec:
|
|||
description: DockerDisableSharedPID uses a shared PID namespace
|
||||
for containers in a pod.
|
||||
type: boolean
|
||||
enableCadvisorJsonEndpoints:
|
||||
description: EnableCadvisorJsonEndpoints enables cAdvisor json
|
||||
`/spec` and `/stats/*` endpoints. Defaults to False.
|
||||
type: boolean
|
||||
enableCustomMetrics:
|
||||
description: Enable gathering custom metrics.
|
||||
type: boolean
|
||||
|
|
|
@ -346,6 +346,10 @@ spec:
|
|||
description: DockerDisableSharedPID uses a shared PID namespace
|
||||
for containers in a pod.
|
||||
type: boolean
|
||||
enableCadvisorJsonEndpoints:
|
||||
description: EnableCadvisorJsonEndpoints enables cAdvisor json
|
||||
`/spec` and `/stats/*` endpoints. Defaults to False.
|
||||
type: boolean
|
||||
enableCustomMetrics:
|
||||
description: Enable gathering custom metrics.
|
||||
type: boolean
|
||||
|
|
|
@ -215,6 +215,8 @@ type KubeletConfigSpec struct {
|
|||
ContainerLogMaxSize string `json:"containerLogMaxSize,omitempty" flag:"container-log-max-size"`
|
||||
// ContainerLogMaxFiles is the maximum number of container log files that can be present for a container. The number must be >= 2.
|
||||
ContainerLogMaxFiles *int32 `json:"containerLogMaxFiles,omitempty" flag:"container-log-max-files"`
|
||||
// EnableCadvisorJsonEndpoints enables cAdvisor json `/spec` and `/stats/*` endpoints. Defaults to False.
|
||||
EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"`
|
||||
}
|
||||
|
||||
// KubeProxyConfig defines the configuration for a proxy
|
||||
|
|
|
@ -215,6 +215,8 @@ type KubeletConfigSpec struct {
|
|||
ContainerLogMaxSize string `json:"containerLogMaxSize,omitempty" flag:"container-log-max-size"`
|
||||
// ContainerLogMaxFiles is the maximum number of container log files that can be present for a container. The number must be >= 2.
|
||||
ContainerLogMaxFiles *int32 `json:"containerLogMaxFiles,omitempty" flag:"container-log-max-files"`
|
||||
// EnableCadvisorJsonEndpoints enables cAdvisor json `/spec` and `/stats/*` endpoints. Defaults to False.
|
||||
EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"`
|
||||
}
|
||||
|
||||
// KubeProxyConfig defines the configuration for a proxy
|
||||
|
|
|
@ -4933,6 +4933,7 @@ func autoConvert_v1alpha2_KubeletConfigSpec_To_kops_KubeletConfigSpec(in *Kubele
|
|||
out.EventBurst = in.EventBurst
|
||||
out.ContainerLogMaxSize = in.ContainerLogMaxSize
|
||||
out.ContainerLogMaxFiles = in.ContainerLogMaxFiles
|
||||
out.EnableCadvisorJsonEndpoints = in.EnableCadvisorJsonEndpoints
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -5026,6 +5027,7 @@ func autoConvert_kops_KubeletConfigSpec_To_v1alpha2_KubeletConfigSpec(in *kops.K
|
|||
out.EventBurst = in.EventBurst
|
||||
out.ContainerLogMaxSize = in.ContainerLogMaxSize
|
||||
out.ContainerLogMaxFiles = in.ContainerLogMaxFiles
|
||||
out.EnableCadvisorJsonEndpoints = in.EnableCadvisorJsonEndpoints
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -3330,6 +3330,11 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) {
|
|||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.EnableCadvisorJsonEndpoints != nil {
|
||||
in, out := &in.EnableCadvisorJsonEndpoints, &out.EnableCadvisorJsonEndpoints
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -517,6 +517,12 @@ func validateKubelet(k *kops.KubeletConfigSpec, c *kops.Cluster, kubeletPath *fi
|
|||
}
|
||||
}
|
||||
|
||||
if k.EnableCadvisorJsonEndpoints != nil {
|
||||
if c.IsKubernetesLT("1.18") && c.IsKubernetesGTE("1.21") {
|
||||
allErrs = append(allErrs, field.Forbidden(kubeletPath.Child("enableCadvisorJsonEndpoints"), "enableCadvisorJsonEndpoints requires Kubernetes 1.18-1.20"))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
|
|
@ -3512,6 +3512,11 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) {
|
|||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.EnableCadvisorJsonEndpoints != nil {
|
||||
in, out := &in.EnableCadvisorJsonEndpoints, &out.EnableCadvisorJsonEndpoints
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue