kubelet.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 main
  14. import (
  15. "k8s.io/kubernetes/cmd/kubelet/app"
  16. "k8s.io/kubernetes/cmd/kubelet/app/options"
  17. )
  18. // NewKubelet creates a new hyperkube Server object that includes the
  19. // description and flags.
  20. func NewKubelet() *Server {
  21. s := options.NewKubeletServer()
  22. hks := Server{
  23. SimpleUsage: "kubelet",
  24. Long: `The kubelet binary is responsible for maintaining a set of containers on a
  25. particular node. It syncs data from a variety of sources including a
  26. Kubernetes API server, an etcd cluster, HTTP endpoint or local file. It then
  27. queries Docker to see what is currently running. It synchronizes the
  28. configuration data, with the running set of containers by starting or stopping
  29. Docker containers.`,
  30. Run: func(_ *Server, _ []string) error {
  31. return app.Run(s, nil)
  32. },
  33. }
  34. s.AddFlags(hks.Flags())
  35. return &hks
  36. }