container_manager.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. Copyright 2015 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package cm
  14. import (
  15. "k8s.io/kubernetes/pkg/api"
  16. )
  17. // Manages the containers running on a machine.
  18. type ContainerManager interface {
  19. // Runs the container manager's housekeeping.
  20. // - Ensures that the Docker daemon is in a container.
  21. // - Creates the system container where all non-containerized processes run.
  22. Start(*api.Node) error
  23. // Returns resources allocated to system cgroups in the machine.
  24. // These cgroups include the system and Kubernetes services.
  25. SystemCgroupsLimit() api.ResourceList
  26. // Returns a NodeConfig that is being used by the container manager.
  27. GetNodeConfig() NodeConfig
  28. // Returns internal Status.
  29. Status() Status
  30. // NewPodContainerManager is a factory method which returns a podContainerManager object
  31. // Returns a noop implementation if qos cgroup hierarchy is not enabled
  32. NewPodContainerManager() PodContainerManager
  33. // GetMountedSubsystems returns the mounted cgroup subsytems on the node
  34. GetMountedSubsystems() *CgroupSubsystems
  35. // GetQOSContainersInfo returns the names of top level QoS containers
  36. GetQOSContainersInfo() QOSContainersInfo
  37. }
  38. type NodeConfig struct {
  39. RuntimeCgroupsName string
  40. SystemCgroupsName string
  41. KubeletCgroupsName string
  42. ContainerRuntime string
  43. CgroupsPerQOS bool
  44. CgroupRoot string
  45. ProtectKernelDefaults bool
  46. }
  47. type Status struct {
  48. // Any soft requirements that were unsatisfied.
  49. SoftRequirements error
  50. }