Skip to content

Commit

Permalink
Set Docker custom metric label for cAdvisor if custom metric volume i…
Browse files Browse the repository at this point in the history
…s mounted
  • Loading branch information
mwielgus committed Feb 5, 2016
1 parent ce6fd46 commit bf0c881
Show file tree
Hide file tree
Showing 13 changed files with 986 additions and 818 deletions.
2 changes: 2 additions & 0 deletions cmd/kubelet/app/options/options.go
Expand Up @@ -77,6 +77,7 @@ func NewKubeletServer() *KubeletServer {
DockerExecHandlerName: "native",
EventBurst: 10,
EventRecordQPS: 5.0,
EnableCustomMetrics: false,
EnableDebuggingHandlers: true,
EnableServer: true,
FileCheckFrequency: unversioned.Duration{20 * time.Second},
Expand Down Expand Up @@ -214,4 +215,5 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
fs.BoolVar(&s.ExperimentalFlannelOverlay, "experimental-flannel-overlay", s.ExperimentalFlannelOverlay, "Experimental support for starting the kubelet with the default overlay network (flannel). Assumes flanneld is already running in client mode. [default=false]")
fs.DurationVar(&s.OutOfDiskTransitionFrequency.Duration, "outofdisk-transition-frequency", s.OutOfDiskTransitionFrequency.Duration, "Duration for which the kubelet has to wait before transitioning out of out-of-disk node condition status. Default: 5m0s")
fs.StringVar(&s.NodeIP, "node-ip", s.NodeIP, "IP address of the node. If set, kubelet will use this IP address for the node")
fs.BoolVar(&s.EnableCustomMetrics, "enable-custom-metrics", s.EnableCustomMetrics, "Support for gathering custom metrics.")
}
4 changes: 4 additions & 0 deletions cmd/kubelet/app/server.go
Expand Up @@ -193,6 +193,7 @@ func UnsecuredKubeletConfig(s *options.KubeletServer) (*KubeletConfig, error) {
DockerClient: dockertools.ConnectToDockerOrDie(s.DockerEndpoint),
DockerDaemonContainer: s.DockerDaemonContainer,
DockerExecHandler: dockerExecHandler,
EnableCustomMetrics: s.EnableCustomMetrics,
EnableDebuggingHandlers: s.EnableDebuggingHandlers,
EnableServer: s.EnableServer,
EventBurst: s.EventBurst,
Expand Down Expand Up @@ -491,6 +492,7 @@ func SimpleKubelet(client *clientset.Clientset,
DockerClient: dockerClient,
DockerDaemonContainer: "/docker-daemon",
DockerExecHandler: &dockertools.NativeExecHandler{},
EnableCustomMetrics: false,
EnableDebuggingHandlers: true,
EnableServer: true,
FileCheckFrequency: fileCheckFrequency,
Expand Down Expand Up @@ -665,6 +667,7 @@ type KubeletConfig struct {
DockerClient dockertools.DockerInterface
DockerDaemonContainer string
DockerExecHandler dockertools.ExecHandler
EnableCustomMetrics bool
EnableDebuggingHandlers bool
EnableServer bool
EventClient *clientset.Clientset
Expand Down Expand Up @@ -811,6 +814,7 @@ func CreateAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.Pod
kc.ExperimentalFlannelOverlay,
kc.NodeIP,
kc.Reservation,
kc.EnableCustomMetrics,
)

if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion docs/admin/kubelet.md
Expand Up @@ -82,6 +82,7 @@ kubelet
--cpu-cfs-quota[=true]: Enable CPU CFS quota enforcement for containers that specify CPU limits
--docker-endpoint="": If non-empty, use this for the docker endpoint to communicate with
--docker-exec-handler="native": Handler to use when executing a command in a container. Valid values are 'native' and 'nsenter'. Defaults to 'native'.
--enable-custom-metrics[=false]: Support for gathering custom metrics.
--enable-debugging-handlers[=true]: Enables server endpoints for log collection and local running of containers and commands
--enable-server[=true]: Enable the Kubelet's server
--event-burst=10: Maximum size of a bursty event records, temporarily allows event records to burst to this number, while still not exceeding event-qps. Only used if --event-qps > 0
Expand Down Expand Up @@ -146,7 +147,7 @@ kubelet
--volume-plugin-dir="/usr/libexec/kubernetes/kubelet-plugins/volume/exec/": <Warning: Alpha feature> The full path of the directory in which to search for additional third party volume plugins
```

###### Auto generated by spf13/cobra on 29-Jan-2016
###### Auto generated by spf13/cobra on 3-Feb-2016


<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
Expand Down
1 change: 1 addition & 0 deletions hack/verify-flags/known-flags.txt
Expand Up @@ -84,6 +84,7 @@ dry-run
duration-sec
e2e-output-dir
e2e-verify-service-account
enable-custom-metrics
enable-debugging-handlers
enable-hostpath-provisioner
enable-server
Expand Down

1 comment on commit bf0c881

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 14512 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 222 Build time: 00:03:53

Please sign in to comment.