diff --git a/.generated_docs b/.generated_docs index d9a1fa33bbd2a..e65b62c37f249 100644 --- a/.generated_docs +++ b/.generated_docs @@ -1,5 +1,10 @@ .generated_docs contrib/completions/bash/kubectl +docs/admin/kube-apiserver.md +docs/admin/kube-controller-manager.md +docs/admin/kube-proxy.md +docs/admin/kube-scheduler.md +docs/admin/kubelet.md docs/man/man1/kubectl-annotate.1 docs/man/man1/kubectl-api-versions.1 docs/man/man1/kubectl-apply.1 diff --git a/cmd/genkubedocs/gen_kube_docs.go b/cmd/genkubedocs/gen_kube_docs.go new file mode 100644 index 0000000000000..97a7b4b353a7b --- /dev/null +++ b/cmd/genkubedocs/gen_kube_docs.go @@ -0,0 +1,75 @@ +/* +Copyright 2014 The Kubernetes Authors All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" + "k8s.io/kubernetes/cmd/genutils" + apiservapp "k8s.io/kubernetes/cmd/kube-apiserver/app" + cmapp "k8s.io/kubernetes/cmd/kube-controller-manager/app" + proxyapp "k8s.io/kubernetes/cmd/kube-proxy/app" + klapp "k8s.io/kubernetes/cmd/kubelet/app" + schapp "k8s.io/kubernetes/plugin/cmd/kube-scheduler/app" +) + +func main() { + // use os.Args instead of "flags" because "flags" will mess up the man pages! + path := "" + module := "" + if len(os.Args) == 3 { + path = os.Args[1] + module = os.Args[2] + } else { + fmt.Fprintf(os.Stderr, "usage: %s [output directory] [module] \n", os.Args[0]) + os.Exit(1) + } + + outDir, err := genutils.OutDir(path) + if err != nil { + fmt.Fprintf(os.Stderr, "failed to get output directory: %v\n", err) + os.Exit(1) + } + + switch module { + case "kube-apiserver": + // generate docs for kube-apiserver + apiserver := apiservapp.NewAPIServerCommand() + cobra.GenMarkdownTree(apiserver, outDir) + case "kube-controller-manager": + // generate docs for kube-controller-manager + controllermanager := cmapp.NewControllerManagerCommand() + cobra.GenMarkdownTree(controllermanager, outDir) + case "kube-proxy": + // generate docs for kube-proxy + proxy := proxyapp.NewProxyCommand() + cobra.GenMarkdownTree(proxy, outDir) + case "kube-scheduler": + // generate docs for kube-scheduler + scheduler := schapp.NewSchedulerCommand() + cobra.GenMarkdownTree(scheduler, outDir) + case "kubelet": + // generate docs for kubelet + kubelet := klapp.NewKubeletCommand() + cobra.GenMarkdownTree(kubelet, outDir) + default: + fmt.Fprintf(os.Stderr, "Module %s is not supported", module) + os.Exit(1) + } +} diff --git a/cmd/kube-apiserver/app/server.go b/cmd/kube-apiserver/app/server.go index 21b866d243469..a1c0f88e7f9bc 100644 --- a/cmd/kube-apiserver/app/server.go +++ b/cmd/kube-apiserver/app/server.go @@ -51,6 +51,7 @@ import ( "github.com/coreos/go-etcd/etcd" "github.com/golang/glog" + "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -148,6 +149,23 @@ func NewAPIServer() *APIServer { return &s } +// NewAPIServerCommand creates a *cobra.Command object with default parameters +func NewAPIServerCommand() *cobra.Command { + s := NewAPIServer() + s.AddFlags(pflag.CommandLine) + cmd := &cobra.Command{ + Use: "kube-apiserver", + Long: `The Kubernetes API server validates and configures data +for the api objects which include pods, services, replicationcontrollers, and +others. The API Server services REST operations and provides the frontend to the +cluster's shared state through which all other components interact.`, + Run: func(cmd *cobra.Command, args []string) { + }, + } + + return cmd +} + // AddFlags adds flags for a specific APIServer to the specified FlagSet func (s *APIServer) AddFlags(fs *pflag.FlagSet) { // Note: the weird ""+ in below lines seems to be the only way to get gofmt to diff --git a/cmd/kube-controller-manager/app/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go index e0a9ac4420229..d6bfee86ffb67 100644 --- a/cmd/kube-controller-manager/app/controllermanager.go +++ b/cmd/kube-controller-manager/app/controllermanager.go @@ -58,6 +58,7 @@ import ( "github.com/golang/glog" "github.com/prometheus/client_golang/prometheus" + "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -137,6 +138,27 @@ func NewCMServer() *CMServer { return &s } +// NewControllerManagerCommand creates a *cobra.Command object with default parameters +func NewControllerManagerCommand() *cobra.Command { + s := NewCMServer() + s.AddFlags(pflag.CommandLine) + cmd := &cobra.Command{ + Use: "kube-controller-manager", + Long: `The Kubernetes controller manager is a daemon that embeds +the core control loops shipped with Kubernetes. In applications of robotics and +automation, a control loop is a non-terminating loop that regulates the state of +the system. In Kubernetes, a controller is a control loop that watches the shared +state of the cluster through the apiserver and makes changes attempting to move the +current state towards the desired state. Examples of controllers that ship with +Kubernetes today are the replication controller, endpoints controller, namespace +controller, and serviceaccounts controller.`, + Run: func(cmd *cobra.Command, args []string) { + }, + } + + return cmd +} + // VolumeConfigFlags is used to bind CLI flags to variables. This top-level struct contains *all* enumerated // CLI flags meant to configure all volume plugins. From this config, the binary will create many instances // of volume.VolumeConfig which are then passed to the appropriate plugin. The ControllerManager binary is the only diff --git a/cmd/kube-proxy/app/server.go b/cmd/kube-proxy/app/server.go index dce6bad9cd82c..5f1e3ec5690fa 100644 --- a/cmd/kube-proxy/app/server.go +++ b/cmd/kube-proxy/app/server.go @@ -45,6 +45,7 @@ import ( "k8s.io/kubernetes/pkg/util/oom" "github.com/golang/glog" + "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -142,6 +143,26 @@ func NewProxyServer( }, nil } +// NewProxyCommand creates a *cobra.Command object with default parameters +func NewProxyCommand() *cobra.Command { + s := NewProxyConfig() + s.AddFlags(pflag.CommandLine) + cmd := &cobra.Command{ + Use: "kube-proxy", + Long: `The Kubernetes network proxy runs on each node. This +reflects services as defined in the Kubernetes API on each node and can do simple +TCP,UDP stream forwarding or round robin TCP,UDP forwarding across a set of backends. +Service cluster ips and ports are currently found through Docker-links-compatible +environment variables specifying ports opened by the service proxy. There is an optional +addon that provides cluster DNS for these cluster IPs. The user must create a service +with the apiserver API to configure the proxy.`, + Run: func(cmd *cobra.Command, args []string) { + }, + } + + return cmd +} + // NewProxyServerDefault creates a new ProxyServer object with default parameters. func NewProxyServerDefault(config *ProxyServerConfig) (*ProxyServer, error) { protocol := utiliptables.ProtocolIpv4 diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go index 2fe5729b8cf9e..2998fa0d96a15 100644 --- a/cmd/kubelet/app/server.go +++ b/cmd/kubelet/app/server.go @@ -61,6 +61,7 @@ import ( "k8s.io/kubernetes/pkg/volume" "github.com/golang/glog" + "github.com/spf13/cobra" "github.com/spf13/pflag" "k8s.io/kubernetes/pkg/cloudprovider" ) @@ -219,6 +220,36 @@ func NewKubeletServer() *KubeletServer { } } +// NewKubeletCommand creates a *cobra.Command object with default parameters +func NewKubeletCommand() *cobra.Command { + s := NewKubeletServer() + s.AddFlags(pflag.CommandLine) + cmd := &cobra.Command{ + Use: "kubelet", + Long: `The kubelet is the primary "node agent" that runs on each +node. The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object +that describes a pod. The kubelet takes a set of PodSpecs that are provided through +various mechanisms (primarily through the apiserver) and ensures that the containers +described in those PodSpecs are running and healthy. + +Other than from an PodSpec from the apiserver, there are three ways that a container +manifest can be provided to the Kubelet. + +File: Path passed as a flag on the command line. This file is rechecked every 20 +seconds (configurable with a flag). + +HTTP endpoint: HTTP endpoint passed as a parameter on the command line. This endpoint +is checked every 20 seconds (also configurable with a flag). + +HTTP server: The kubelet can also listen for HTTP and respond to a simple API +(underspec'd currently) to submit a new manifest.`, + Run: func(cmd *cobra.Command, args []string) { + }, + } + + return cmd +} + // AddFlags adds flags for a specific KubeletServer to the specified FlagSet func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&s.Config, "config", s.Config, "Path to the config file or directory of files") diff --git a/docs/admin/kube-apiserver.md b/docs/admin/kube-apiserver.md index 7d70906dbd8b3..4cb745c75535f 100644 --- a/docs/admin/kube-apiserver.md +++ b/docs/admin/kube-apiserver.md @@ -43,63 +43,72 @@ for the api objects which include pods, services, replicationcontrollers, and others. The API Server services REST operations and provides the frontend to the cluster's shared state through which all other components interact. +``` +kube-apiserver +``` ### Options ``` - --address=: DEPRECATED: see --insecure-bind-address instead - --admission-control="": Ordered list of plug-ins to do admission control of resources into cluster. Comma-delimited list of: AlwaysAdmit, AlwaysDeny, DenyExecOnPrivileged, DenyEscalatingExec, LimitRanger, NamespaceAutoProvision, NamespaceExists, NamespaceLifecycle, ResourceQuota, SecurityContextDeny, ServiceAccount + --admission-control="AlwaysAdmit": Ordered list of plug-ins to do admission control of resources into cluster. Comma-delimited list of: AlwaysAdmit, AlwaysDeny, DenyEscalatingExec, DenyExecOnPrivileged, InitialResources, LimitRanger, NamespaceAutoProvision, NamespaceExists, NamespaceLifecycle, ResourceQuota, SecurityContextDeny, ServiceAccount --admission-control-config-file="": File with admission control configuration. --advertise-address=: The IP address on which to advertise the apiserver to members of the cluster. This address must be reachable by the rest of the cluster. If blank, the --bind-address will be used. If --bind-address is unspecified, the host's default interface will be used. - --allow-privileged=false: If true, allow privileged containers. - --api-prefix="": The prefix for API requests on the server. Default '/api'. - --authorization-mode="": Selects how to do authorization on the secure port. One of: AlwaysAllow,AlwaysDeny,ABAC + --allow-privileged[=false]: If true, allow privileged containers. + --authorization-mode="AlwaysAllow": Ordered list of plug-ins to do authorization on secure port. Comma-delimited list of: AlwaysAllow,AlwaysDeny,ABAC --authorization-policy-file="": File with authorization policy in csv format, used with --authorization-mode=ABAC, on the secure port. --basic-auth-file="": If set, the file that will be used to admit requests to the secure port of the API server via http basic authentication. - --bind-address=: The IP address on which to serve the --read-only-port and --secure-port ports. The associated interface(s) must be reachable by the rest of the cluster, and by CLI/web clients. If blank, all interfaces will be used (0.0.0.0). - --cert-dir="": The directory where the TLS certs are located (by default /var/run/kubernetes). If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored. + --bind-address=0.0.0.0: The IP address on which to serve the --read-only-port and --secure-port ports. The associated interface(s) must be reachable by the rest of the cluster, and by CLI/web clients. If blank, all interfaces will be used (0.0.0.0). + --cert-dir="/var/run/kubernetes": The directory where the TLS certs are located (by default /var/run/kubernetes). If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored. --client-ca-file="": If set, any request presenting a client certificate signed by one of the authorities in the client-ca-file is authenticated with an identity corresponding to the CommonName of the client certificate. --cloud-config="": The path to the cloud provider configuration file. Empty string for no configuration file. --cloud-provider="": The provider for cloud services. Empty string for no provider. - --cluster-name="": The instance prefix for the cluster + --cluster-name="kubernetes": The instance prefix for the cluster --cors-allowed-origins=[]: List of allowed origins for CORS, comma separated. An allowed origin can be a regular expression to support subdomain matching. If this list is empty CORS will not be enabled. --etcd-config="": The config file for the etcd client. Mutually exclusive with -etcd-servers. - --etcd-prefix="": The prefix for all resource paths in etcd. + --etcd-prefix="/registry": The prefix for all resource paths in etcd. --etcd-servers=[]: List of etcd servers to watch (http://ip:port), comma separated. Mutually exclusive with -etcd-config - --event-ttl=0: Amount of time to retain events. Default 1 hour. + --etcd-servers-overrides=[]: Per-resource etcd servers overrides, comma separated. The individual override format: group/resource#servers, where servers are http://ip:port, semicolon separated. + --event-ttl=1h0m0s: Amount of time to retain events. Default 1 hour. + --experimental-keystone-url="": If passed, activates the keystone authentication plugin --external-hostname="": The hostname to use when generating externalized URLs for this master (e.g. Swagger API Docs.) - -h, --help=false: help for kube-apiserver - --insecure-bind-address=: The IP address on which to serve the --insecure-port (set to 0.0.0.0 for all interfaces). Defaults to localhost. - --insecure-port=0: The port on which to serve unsecured, unauthenticated access. Default 8080. It is assumed that firewall rules are set up such that this port is not reachable from outside of the cluster and that port 443 on the cluster's public address is proxied to this port. This is performed by nginx in the default setup. + --google-json-key="": The Google Cloud Platform Service Account JSON Key to use for authentication. + --insecure-bind-address=127.0.0.1: The IP address on which to serve the --insecure-port (set to 0.0.0.0 for all interfaces). Defaults to localhost. + --insecure-port=8080: The port on which to serve unsecured, unauthenticated access. Default 8080. It is assumed that firewall rules are set up such that this port is not reachable from outside of the cluster and that port 443 on the cluster's public address is proxied to this port. This is performed by nginx in the default setup. --kubelet-certificate-authority="": Path to a cert. file for the certificate authority. - --kubelet-client-certificate="": Path to a client key file for TLS. + --kubelet-client-certificate="": Path to a client cert file for TLS. --kubelet-client-key="": Path to a client key file for TLS. - --kubelet-https=false: Use https for kubelet connections - --kubelet-port=0: Kubelet port - --kubelet-timeout=0: Timeout for kubelet operations - --long-running-request-regexp="(/|^)((watch|proxy)(/|$)|(logs|portforward|exec)/?$)": A regular expression matching long running requests which should be excluded from maximum inflight request handling. - --master-service-namespace="": The namespace from which the Kubernetes master services should be injected into pods + --kubelet-https[=true]: Use https for kubelet connections + --kubelet-port=10250: Kubelet port + --kubelet-timeout=5s: Timeout for kubelet operations + --kubernetes-service-node-port=0: If non-zero, the Kubernetes master service (which apiserver creates/maintains) will be of type NodePort, using this as the value of the port. If zero, the Kubernetes master service will be of type ClusterIP. + --log-flush-frequency=5s: Maximum number of seconds between log flushes + --long-running-request-regexp="(/|^)((watch|proxy)(/|$)|(logs?|portforward|exec|attach)/?$)": A regular expression matching long running requests which should be excluded from maximum inflight request handling. + --master-service-namespace="default": The namespace from which the kubernetes master services should be injected into pods + --max-connection-bytes-per-sec=0: If non-zero, throttle each user connection to this number of bytes/sec. Currently only applies to long-running requests --max-requests-inflight=400: The maximum number of requests in flight at a given time. When the server exceeds this, it rejects requests. Zero for no limit. --min-request-timeout=1800: An optional field indicating the minimum number of seconds a handler must keep a request open before timing it out. Currently only honored by the watch request handler, which picks a randomized value above this number as the connection timeout, to spread out load. - --old-etcd-prefix="": The previous prefix for all resource paths in etcd, if any. - --port=0: DEPRECATED: see --insecure-port instead - --profiling=true: Enable profiling via web interface host:port/debug/pprof/ - --public-address-override=: DEPRECATED: see --bind-address instead - --runtime-config=: A set of key=value pairs that describe runtime configuration that may be passed to the apiserver. api/ key can be used to turn on/off specific api versions. api/all and api/legacy are special keys to control all and legacy api versions respectively. - --secure-port=0: The port on which to serve HTTPS with authentication and authorization. If 0, don't serve HTTPS at all. + --oidc-ca-file="": If set, the OpenID server's certificate will be verified by one of the authorities in the oidc-ca-file, otherwise the host's root CA set will be used + --oidc-client-id="": The client ID for the OpenID Connect client, must be set if oidc-issuer-url is set + --oidc-issuer-url="": The URL of the OpenID issuer, only HTTPS scheme will be accepted. If set, it will be used to verify the OIDC JSON Web Token (JWT) + --oidc-username-claim="sub": The OpenID claim to use as the user name. Note that claims other than the default ('sub') is not guaranteed to be unique and immutable. This flag is experimental, please see the authentication documentation for further details. + --profiling[=true]: Enable profiling via web interface host:port/debug/pprof/ + --repair-malformed-updates[=true]: If true, server will do its best to fix the update request to pass the validation, e.g., setting empty UID in update request to its existing value. This flag can be turned off after we fix all the clients that send malformed updates. + --runtime-config=: A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/ key can be used to turn on/off specific api versions. apis// can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively. + --secure-port=6443: The port on which to serve HTTPS with authentication and authorization. If 0, don't serve HTTPS at all. --service-account-key-file="": File containing PEM-encoded x509 RSA private or public key, used to verify ServiceAccount tokens. If unspecified, --tls-private-key-file is used. - --service-account-lookup=false: If true, validate ServiceAccount tokens exist in etcd as part of authentication. + --service-account-lookup[=false]: If true, validate ServiceAccount tokens exist in etcd as part of authentication. --service-cluster-ip-range=: A CIDR notation IP range from which to assign service cluster IPs. This must not overlap with any IP ranges assigned to nodes for pods. --service-node-port-range=: A port range to reserve for services with NodePort visibility. Example: '30000-32767'. Inclusive at both ends of the range. --ssh-keyfile="": If non-empty, use secure SSH proxy to the nodes, using this user keyfile --ssh-user="": If non-empty, use secure SSH proxy to the nodes, using this user name - --storage-version="": The version to store resources with. Defaults to server preferred + --storage-versions="extensions/v1beta1,v1": The versions to store resources with. Different groups may be stored in different versions. Specified in the format "group1/version1,group2/version2...". This flag expects a complete list of storage versions of ALL groups registered in the server. It defaults to a list of preferred versions of all registered groups, which is derived from the KUBE_API_VERSIONS environment variable. --tls-cert-file="": File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). If HTTPS serving is enabled, and --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key are generated for the public address and saved to /var/run/kubernetes. --tls-private-key-file="": File containing x509 private key matching --tls-cert-file. --token-auth-file="": If set, the file that will be used to secure the secure port of the API server via token authentication. + --watch-cache[=true]: Enable watch caching in the apiserver ``` -###### Auto generated by spf13/cobra at 2015-07-06 18:03:28.852677626 +0000 UTC +###### Auto generated by spf13/cobra on 24-Oct-2015 diff --git a/docs/admin/kube-controller-manager.md b/docs/admin/kube-controller-manager.md index 0ba51b428f4e3..d5813bf380c2d 100644 --- a/docs/admin/kube-controller-manager.md +++ b/docs/admin/kube-controller-manager.md @@ -47,38 +47,55 @@ current state towards the desired state. Examples of controllers that ship with Kubernetes today are the replication controller, endpoints controller, namespace controller, and serviceaccounts controller. +``` +kube-controller-manager +``` ### Options ``` - --address=: The IP address to serve on (set to 0.0.0.0 for all interfaces) - --allocate-node-cidrs=false: Should CIDRs for Pods be allocated and set on the cloud provider. + --address=127.0.0.1: The IP address to serve on (set to 0.0.0.0 for all interfaces) + --allocate-node-cidrs[=false]: Should CIDRs for Pods be allocated and set on the cloud provider. --cloud-config="": The path to the cloud provider configuration file. Empty string for no configuration file. --cloud-provider="": The provider for cloud services. Empty string for no provider. --cluster-cidr=: CIDR Range for Pods in cluster. - --cluster-name="": The instance prefix for the cluster - --concurrent-endpoint-syncs=0: The number of endpoint syncing operations that will be done concurrently. Larger number = faster endpoint updating, but more CPU (and network) load - --concurrent-rc-syncs=0: The number of replication controllers that are allowed to sync concurrently. Larger number = more responsive replica management, but more CPU (and network) load + --cluster-name="kubernetes": The instance prefix for the cluster + --concurrent-endpoint-syncs=5: The number of endpoint syncing operations that will be done concurrently. Larger number = faster endpoint updating, but more CPU (and network) load + --concurrent_rc_syncs=5: The number of replication controllers that are allowed to sync concurrently. Larger number = more reponsive replica management, but more CPU (and network) load --deleting-pods-burst=10: Number of nodes on which pods are bursty deleted in case of node failure. For more details look into RateLimiter. --deleting-pods-qps=0.1: Number of nodes per second on which pods are deleted in case of node failure. - -h, --help=false: help for kube-controller-manager + --deployment-controller-sync-period=30s: Period for syncing the deployments. + --google-json-key="": The Google Cloud Platform Service Account JSON Key to use for authentication. + --horizontal-pod-autoscaler-sync-period=30s: The period for syncing the number of pods in horizontal pod autoscaler. + --kube-api-burst=30: Burst to use while talking with kubernetes apiserver + --kube-api-qps=20: QPS to use while talking with kubernetes apiserver --kubeconfig="": Path to kubeconfig file with authorization and master location information. + --log-flush-frequency=5s: Maximum number of seconds between log flushes --master="": The address of the Kubernetes API server (overrides any value in kubeconfig) - --namespace-sync-period=0: The period for syncing namespace life-cycle updates - --node-monitor-grace-period=40s: Amount of time which we allow running Node to be unresponsive before marking it unhealthy. Must be N times more than kubelet's nodeStatusUpdateFrequency, where N means number of retries allowed for kubelet to post node status. + --min-resync-period=12h0m0s: The resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod + --namespace-sync-period=5m0s: The period for syncing namespace life-cycle updates + --node-monitor-grace-period=40s: Amount of time which we allow running Node to be unresponsive before marking it unhealty. Must be N times more than kubelet's nodeStatusUpdateFrequency, where N means number of retries allowed for kubelet to post node status. --node-monitor-period=5s: The period for syncing NodeStatus in NodeController. - --node-startup-grace-period=1m0s: Amount of time which we allow starting Node to be unresponsive before marking it unhealthy. - --node-sync-period=0: The period for syncing nodes from cloudprovider. Longer periods will result in fewer calls to cloud provider, but may delay addition of new nodes to cluster. - --pod-eviction-timeout=0: The grace period for deleting pods on failed nodes. - --port=0: The port that the controller-manager's http service runs on - --profiling=true: Enable profiling via web interface host:port/debug/pprof/ - --pvclaimbinder-sync-period=0: The period for syncing persistent volumes and persistent volume claims - --resource-quota-sync-period=0: The period for syncing quota usage status in the system + --node-startup-grace-period=1m0s: Amount of time which we allow starting Node to be unresponsive before marking it unhealty. + --node-sync-period=10s: The period for syncing nodes from cloudprovider. Longer periods will result in fewer calls to cloud provider, but may delay addition of new nodes to cluster. + --pod-eviction-timeout=5m0s: The grace period for deleting pods on failed nodes. + --port=10252: The port that the controller-manager's http service runs on + --profiling[=true]: Enable profiling via web interface host:port/debug/pprof/ + --pv-recycler-increment-timeout-nfs=30: the increment of time added per Gi to ActiveDeadlineSeconds for an NFS scrubber pod + --pv-recycler-minimum-timeout-hostpath=60: The minimum ActiveDeadlineSeconds to use for a HostPath Recycler pod. This is for development and testing only and will not work in a multi-node cluster. + --pv-recycler-minimum-timeout-nfs=300: The minimum ActiveDeadlineSeconds to use for an NFS Recycler pod + --pv-recycler-pod-template-filepath-hostpath="": The file path to a pod definition used as a template for HostPath persistent volume recycling. This is for development and testing only and will not work in a multi-node cluster. + --pv-recycler-pod-template-filepath-nfs="": The file path to a pod definition used as a template for NFS persistent volume recycling + --pv-recycler-timeout-increment-hostpath=30: the increment of time added per Gi to ActiveDeadlineSeconds for a HostPath scrubber pod. This is for development and testing only and will not work in a multi-node cluster. + --pvclaimbinder-sync-period=10s: The period for syncing persistent volumes and persistent volume claims + --resource-quota-sync-period=10s: The period for syncing quota usage status in the system --root-ca-file="": If set, this root certificate authority will be included in service account's token secret. This must be a valid PEM-encoded CA bundle. --service-account-private-key-file="": Filename containing a PEM-encoded private RSA key used to sign service account tokens. + --service-sync-period=5m0s: The period for syncing services with their external load balancers + --terminated-pod-gc-threshold=12500: Number of terminated pods that can exist before the terminated pod garbage collector starts deleting terminated pods. If <= 0, the terminated pod garbage collector is disabled. ``` -###### Auto generated by spf13/cobra at 2015-07-06 18:03:31.507732064 +0000 UTC +###### Auto generated by spf13/cobra on 18-Oct-2015 diff --git a/docs/admin/kube-proxy.md b/docs/admin/kube-proxy.md index 3a731ecfa97dc..0646f3696169a 100644 --- a/docs/admin/kube-proxy.md +++ b/docs/admin/kube-proxy.md @@ -46,22 +46,35 @@ environment variables specifying ports opened by the service proxy. There is an addon that provides cluster DNS for these cluster IPs. The user must create a service with the apiserver API to configure the proxy. +``` +kube-proxy +``` ### Options ``` - --bind-address=: The IP address for the proxy server to serve on (set to 0.0.0.0 for all interfaces) - --healthz-bind-address=: The IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) - --healthz-port=0: The port to bind the health check server. Use 0 to disable. - -h, --help=false: help for kube-proxy + --bind-address=0.0.0.0: The IP address for the proxy server to serve on (set to 0.0.0.0 for all interfaces) + --cleanup-iptables[=false]: If true cleanup iptables rules and exit. + --config-sync-period=15m0s: How often configuration from the apiserver is refreshed. Must be greater than 0. + --google-json-key="": The Google Cloud Platform Service Account JSON Key to use for authentication. + --healthz-bind-address=127.0.0.1: The IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) + --healthz-port=10249: The port to bind the health check server. Use 0 to disable. + --hostname-override="": If non-empty, will use this string as identification instead of the actual hostname. + --iptables-sync-period=30s: How often iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0. + --kube-api-burst=10: Burst to use while talking with kubernetes apiserver + --kube-api-qps=5: QPS to use while talking with kubernetes apiserver --kubeconfig="": Path to kubeconfig file with authorization information (the master location is set by the master flag). + --log-flush-frequency=5s: Maximum number of seconds between log flushes + --masquerade-all[=false]: If using the pure iptables proxy, SNAT everything --master="": The address of the Kubernetes API server (overrides any value in kubeconfig) - --oom-score-adj=0: The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000] + --oom-score-adj=-999: The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000] + --proxy-mode="": Which proxy mode to use: 'userspace' (older, stable) or 'iptables' (experimental). If blank, look at the Node object on the Kubernetes API and respect the 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the best-available proxy (currently userspace, but may change in future versions). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy. --proxy-port-range=: Range of host ports (beginPort-endPort, inclusive) that may be consumed in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen. - --resource-container="": Absolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy). + --resource-container="/kube-proxy": Absolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy). + --udp-timeout=250ms: How long an idle UDP connection will be kept open (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxy-mode=userspace ``` -###### Auto generated by spf13/cobra at 2015-07-06 18:03:37.657112759 +0000 UTC +###### Auto generated by spf13/cobra on 23-Oct-2015 diff --git a/docs/admin/kube-scheduler.md b/docs/admin/kube-scheduler.md index 92fa92ef26fce..d3e9b566f9bd6 100644 --- a/docs/admin/kube-scheduler.md +++ b/docs/admin/kube-scheduler.md @@ -46,21 +46,29 @@ constraints, affinity and anti-affinity specifications, data locality, inter-wor interference, deadlines, and so on. Workload-specific requirements will be exposed through the API as necessary. +``` +kube-scheduler +``` ### Options ``` - --address=: The IP address to serve on (set to 0.0.0.0 for all interfaces) - --algorithm-provider="": The scheduling algorithm provider to use, one of: DefaultProvider - -h, --help=false: help for kube-scheduler + --address=127.0.0.1: The IP address to serve on (set to 0.0.0.0 for all interfaces) + --algorithm-provider="DefaultProvider": The scheduling algorithm provider to use, one of: DefaultProvider + --bind-pods-burst=100: Number of bindings per second scheduler is allowed to make during bursts + --bind-pods-qps=50: Number of bindings per second scheduler is allowed to continuously make + --google-json-key="": The Google Cloud Platform Service Account JSON Key to use for authentication. + --kube-api-burst=100: Burst to use while talking with kubernetes apiserver + --kube-api-qps=50: QPS to use while talking with kubernetes apiserver --kubeconfig="": Path to kubeconfig file with authorization and master location information. + --log-flush-frequency=5s: Maximum number of seconds between log flushes --master="": The address of the Kubernetes API server (overrides any value in kubeconfig) --policy-config-file="": File with scheduler policy configuration - --port=0: The port that the scheduler's http service runs on - --profiling=true: Enable profiling via web interface host:port/debug/pprof/ + --port=10251: The port that the scheduler's http service runs on + --profiling[=true]: Enable profiling via web interface host:port/debug/pprof/ ``` -###### Auto generated by spf13/cobra at 2015-07-06 18:03:39.24859096 +0000 UTC +###### Auto generated by spf13/cobra on 13-Oct-2015 diff --git a/docs/admin/kubelet.md b/docs/admin/kubelet.md index 1580a31539c89..27b305b367bbc 100644 --- a/docs/admin/kubelet.md +++ b/docs/admin/kubelet.md @@ -56,15 +56,18 @@ is checked every 20 seconds (also configurable with a flag). HTTP server: The kubelet can also listen for HTTP and respond to a simple API (underspec'd currently) to submit a new manifest. +``` +kubelet +``` ### Options ``` - --address=: The IP address for the Kubelet to serve on (set to 0.0.0.0 for all interfaces) - --allow-privileged=false: If true, allow containers to request privileged mode. [default=false] + --address=0.0.0.0: The IP address for the Kubelet to serve on (set to 0.0.0.0 for all interfaces) + --allow-privileged[=false]: If true, allow containers to request privileged mode. [default=false] --api-servers=[]: List of Kubernetes API servers for publishing events, and reading pods and services. (ip:port), comma separated. - --cadvisor-port=0: The port of the localhost cAdvisor endpoint - --cert-dir="": The directory where the TLS certs are located (by default /var/run/kubernetes). If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored. + --cadvisor-port=4194: The port of the localhost cAdvisor endpoint + --cert-dir="/var/run/kubernetes": The directory where the TLS certs are located (by default /var/run/kubernetes). If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored. --cgroup-root="": Optional root cgroup to use for pods. This is handled by the container runtime on a best effort basis. Default: '', which means use the container runtime default. --chaos-chance=0: If > 0.0, introduce random client errors and latency. Intended for testing. [default=0.0] --cloud-config="": The path to the cloud provider configuration file. Empty string for no configuration file. @@ -72,54 +75,69 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API --cluster-dns=: IP address for a cluster DNS server. If set, kubelet will configure all containers to use this for DNS resolution in addition to the host's DNS servers --cluster-domain="": Domain for this cluster. If set, kubelet will configure all containers to search this domain in addition to the host's search domains --config="": Path to the config file or directory of files - --configure-cbr0=false: If true, kubelet will configure cbr0 based on Node.Spec.PodCIDR. - --container-runtime="": The container runtime to use. Possible values: 'docker', 'rkt'. Default: 'docker'. - --containerized=false: Experimental support for running kubelet in a container. Intended for testing. [default=false] + --configure-cbr0[=false]: If true, kubelet will configure cbr0 based on Node.Spec.PodCIDR. + --container-runtime="docker": The container runtime to use. Possible values: 'docker', 'rkt'. Default: 'docker'. + --containerized[=false]: Experimental support for running kubelet in a container. Intended for testing. [default=false] + --cpu-cfs-quota[=false]: 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="": Handler to use when executing a command in a container. Valid values are 'native' and 'nsenter'. Defaults to 'native'. - --enable-debugging-handlers=false: Enables server endpoints for log collection and local running of containers and commands - --enable-server=false: Enable the Kubelet's server - --file-check-frequency=0: Duration between checking config files for new data - --healthz-bind-address=: The IP address for the healthz server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) - --healthz-port=0: The port of the localhost healthz endpoint - -h, --help=false: help for kubelet - --host-network-sources="": Comma-separated list of sources from which the Kubelet allows pods to use of host network. For all sources use "*" [default="file"] - --host-pid-sources="": Comma-separated list of sources from which the Kubelet allows pods to use the host pid namespace. For all sources use "*" [default="file"] - --host-ipc-sources="": Comma-separated list of sources from which the Kubelet allows pods to use the host ipc namespace. For all sources use "*" [default="file"] + --docker-exec-handler="native": Handler to use when executing a command in a container. Valid values are 'native' and 'nsenter'. Defaults to 'native'. + --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=0: 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 + --event-qps=0: If > 0, limit event creations per second to this value. If 0, unlimited. [default=0.0] + --file-check-frequency=20s: Duration between checking config files for new data + --google-json-key="": The Google Cloud Platform Service Account JSON Key to use for authentication. + --healthz-bind-address=127.0.0.1: The IP address for the healthz server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) + --healthz-port=10248: The port of the localhost healthz endpoint + --host-ipc-sources="*": Comma-separated list of sources from which the Kubelet allows pods to use the host ipc namespace. [default="*"] + --host-network-sources="*": Comma-separated list of sources from which the Kubelet allows pods to use of host network. [default="*"] + --host-pid-sources="*": Comma-separated list of sources from which the Kubelet allows pods to use the host pid namespace. [default="*"] --hostname-override="": If non-empty, will use this string as identification instead of the actual hostname. - --http-check-frequency=0: Duration between checking http for new data - --image-gc-high-threshold=0: The percent of disk usage after which image garbage collection is always run. Default: 90%% - --image-gc-low-threshold=0: The percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. Default: 80%% - --kubeconfig=: Path to a kubeconfig file, specifying how to authenticate to API server (the master location is set by the api-servers flag). - --low-diskspace-threshold-mb=0: The absolute free disk space, in MB, to maintain. When disk space falls below this threshold, new pods would be rejected. Default: 256 + --http-check-frequency=20s: Duration between checking http for new data + --image-gc-high-threshold=90: The percent of disk usage after which image garbage collection is always run. Default: 90%% + --image-gc-low-threshold=80: The percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. Default: 80%% + --kube-api-burst=10: Burst to use while talking with kubernetes apiserver + --kube-api-qps=5: QPS to use while talking with kubernetes apiserver + --kubeconfig="/var/lib/kubelet/kubeconfig": Path to a kubeconfig file, specifying how to authenticate to API server (the master location is set by the api-servers flag). + --log-flush-frequency=5s: Maximum number of seconds between log flushes + --low-diskspace-threshold-mb=256: The absolute free disk space, in MB, to maintain. When disk space falls below this threshold, new pods would be rejected. Default: 256 --manifest-url="": URL for accessing the container manifest - --master-service-namespace="": The namespace from which the Kubernetes master services should be injected into pods + --manifest-url-header="": HTTP header to use when accessing the manifest URL, with the key separated from the value with a ':', as in 'key:value' + --master-service-namespace="default": The namespace from which the kubernetes master services should be injected into pods + --max-open-files=1000000: Number of files that can be opened by Kubelet process. [default=1000000] --max-pods=40: Number of Pods that can run on this Kubelet. - --maximum-dead-containers=0: Maximum number of old instances of a containers to retain globally. Each container takes up some disk space. Default: 100. - --maximum-dead-containers-per-container=0: Maximum number of old instances of a container to retain per container. Each container takes up some disk space. Default: 2. - --minimum-container-ttl-duration=0: Minimum age for a finished container before it is garbage collected. Examples: '300ms', '10s' or '2h45m' + --maximum-dead-containers=100: Maximum number of old instances of containers to retain globally. Each container takes up some disk space. Default: 100. + --maximum-dead-containers-per-container=2: Maximum number of old instances to retain per container. Each container takes up some disk space. Default: 2. + --minimum-container-ttl-duration=1m0s: Minimum age for a finished container before it is garbage collected. Examples: '300ms', '10s' or '2h45m' --network-plugin="": The name of the network plugin to be invoked for various events in kubelet/pod lifecycle - --node-status-update-frequency=0: Specifies how often kubelet posts node status to master. Note: be cautious when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller. Default: 10s - --oom-score-adj=0: The oom-score-adj value for kubelet process. Values must be within the range [-1000, 1000] + --network-plugin-dir="/usr/libexec/kubernetes/kubelet-plugins/net/exec/": The full path of the directory in which to search for network plugins + --node-status-update-frequency=10s: Specifies how often kubelet posts node status to master. Note: be cautious when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller. Default: 10s + --oom-score-adj=-999: The oom-score-adj value for kubelet process. Values must be within the range [-1000, 1000] --pod-cidr="": The CIDR to use for pod IP addresses, only used in standalone mode. In cluster mode, this is obtained from the master. - --pod-infra-container-image="": The image whose network/ipc namespaces containers in each pod will use. - --port=0: The port for the Kubelet to serve on. Note that "kubectl logs" will not work if you set this flag. - --read-only-port=0: The read-only port for the Kubelet to serve on with no authentication/authorization (set to 0 to disable) - --really-crash-for-testing=false: If true, when panics occur crash. Intended for testing. - --register-node=false: Register the node with the apiserver (defaults to true if --api-server is set) - --registry-burst=0: Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0 + --pod-infra-container-image="beta.gcr.io/google_containers/pause:2.0": The image whose network/ipc namespaces containers in each pod will use. + --port=10250: The port for the Kubelet to serve on. Note that "kubectl logs" will not work if you set this flag. + --read-only-port=10255: The read-only port for the Kubelet to serve on with no authentication/authorization (set to 0 to disable) + --really-crash-for-testing[=false]: If true, when panics occur crash. Intended for testing. + --reconcile-cidr[=true]: Reconcile node CIDR with the CIDR specified by the API server. No-op if register-node or configure-cbr0 is false. [default=true] + --register-node[=true]: Register the node with the apiserver (defaults to true if --api-servers is set) + --register-schedulable[=true]: Register the node as schedulable. No-op if register-node is false. [default=true] + --registry-burst=10: Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0 --registry-qps=0: If > 0, limit registry pull QPS to this value. If 0, unlimited. [default=0.0] - --resource-container="": Absolute name of the resource-only container to create and run the Kubelet in (Default: /kubelet). - --root-dir="": Directory path for managing kubelet files (volume mounts,etc). - --runonce=false: If true, exit after spawning pods from local manifests or remote urls. Exclusive with --api-servers, and --enable-server + --resolv-conf="/etc/resolv.conf": Resolver configuration file used as the basis for the container DNS resolution configuration. + --resource-container="/kubelet": Absolute name of the resource-only container to create and run the Kubelet in (Default: /kubelet). + --rkt-path="": Path of rkt binary. Leave empty to use the first rkt in $PATH. Only used if --container-runtime='rkt' + --rkt-stage1-image="": image to use as stage1. Local paths and http/https URLs are supported. If empty, the 'stage1.aci' in the same directory as '--rkt-path' will be used + --root-dir="/var/lib/kubelet": Directory path for managing kubelet files (volume mounts,etc). + --runonce[=false]: If true, exit after spawning pods from local manifests or remote urls. Exclusive with --api-servers, and --enable-server + --serialize-image-pulls[=false]: Pull images one at a time. We recommend *not* changing the default value on nodes that run docker daemon with version < 1.9 or an Aufs storage backend. Issue #10959 has more details. [default=true] --streaming-connection-idle-timeout=0: Maximum time a streaming connection can be idle before the connection is automatically closed. Example: '5m' - --sync-frequency=0: Max period between synchronizing running containers and config + --sync-frequency=10s: Max period between synchronizing running containers and config --system-container="": Optional resource-only container in which to place all non-kernel processes that are not already in a container. Empty for no container. Rolling back the flag requires a reboot. (Default: ""). --tls-cert-file="": File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). If --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key are generated for the public address and saved to the directory passed to --cert-dir. --tls-private-key-file="": File containing x509 private key matching --tls-cert-file. ``` -###### Auto generated by spf13/cobra at 2015-07-06 18:03:36.451093085 +0000 UTC +###### Auto generated by spf13/cobra on 24-Oct-2015 diff --git a/hack/after-build/verify-generated-docs.sh b/hack/after-build/verify-generated-docs.sh index 52da068b7ecde..7fb6364fb177d 100755 --- a/hack/after-build/verify-generated-docs.sh +++ b/hack/after-build/verify-generated-docs.sh @@ -25,6 +25,7 @@ kube::golang::setup_env # Find binary gendocs=$(kube::util::find-binary "gendocs") +genkubedocs=$(kube::util::find-binary "genkubedocs") genman=$(kube::util::find-binary "genman") genbashcomp=$(kube::util::find-binary "genbashcomp") mungedocs=$(kube::util::find-binary "mungedocs") diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 390b7ac12ffcc..fe054a7c271c9 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -64,6 +64,7 @@ kube::golang::test_targets() { local targets=( cmd/integration cmd/gendocs + cmd/genkubedocs cmd/genman cmd/mungedocs cmd/genbashcomp diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 9c2dfa2f3d0d7..4e2b4911eb136 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -188,11 +188,18 @@ kube::util::gen-docs() { # Find binary gendocs=$(kube::util::find-binary "gendocs") + genkubedocs=$(kube::util::find-binary "genkubedocs") genman=$(kube::util::find-binary "genman") genbashcomp=$(kube::util::find-binary "genbashcomp") mkdir -p "${dest}/docs/user-guide/kubectl/" "${gendocs}" "${dest}/docs/user-guide/kubectl/" + mkdir -p "${dest}/docs/admin/" + "${genkubedocs}" "${dest}/docs/admin/" "kube-apiserver" + "${genkubedocs}" "${dest}/docs/admin/" "kube-controller-manager" + "${genkubedocs}" "${dest}/docs/admin/" "kube-proxy" + "${genkubedocs}" "${dest}/docs/admin/" "kube-scheduler" + "${genkubedocs}" "${dest}/docs/admin/" "kubelet" mkdir -p "${dest}/docs/man/man1/" "${genman}" "${dest}/docs/man/man1/" mkdir -p "${dest}/contrib/completions/bash/" diff --git a/hack/update-generated-docs.sh b/hack/update-generated-docs.sh index 146cb6dcac9cd..34a9561cfce3f 100755 --- a/hack/update-generated-docs.sh +++ b/hack/update-generated-docs.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genman cmd/genbashcomp cmd/mungedocs +"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genbashcomp cmd/mungedocs "${KUBE_ROOT}/hack/after-build/update-generated-docs.sh" "$@" diff --git a/hack/verify-generated-docs.sh b/hack/verify-generated-docs.sh index 6a31075c031d9..a8f364bd885c4 100755 --- a/hack/verify-generated-docs.sh +++ b/hack/verify-generated-docs.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genman cmd/genbashcomp cmd/mungedocs +"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genbashcomp cmd/mungedocs "${KUBE_ROOT}/hack/after-build/verify-generated-docs.sh" "$@" diff --git a/pkg/admission/plugins.go b/pkg/admission/plugins.go index 3c9e9f1bc0de0..b63e468950fb6 100644 --- a/pkg/admission/plugins.go +++ b/pkg/admission/plugins.go @@ -19,6 +19,7 @@ package admission import ( "io" "os" + "sort" "sync" "github.com/golang/glog" @@ -45,6 +46,7 @@ func GetPlugins() []string { for k := range plugins { keys = append(keys, k) } + sort.Strings(keys) return keys } diff --git a/plugin/cmd/kube-scheduler/app/server.go b/plugin/cmd/kube-scheduler/app/server.go index 6daf6bc1dc1ec..9b1e91c15b801 100644 --- a/plugin/cmd/kube-scheduler/app/server.go +++ b/plugin/cmd/kube-scheduler/app/server.go @@ -42,6 +42,7 @@ import ( "github.com/golang/glog" "github.com/prometheus/client_golang/prometheus" + "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -74,6 +75,26 @@ func NewSchedulerServer() *SchedulerServer { return &s } +// NewSchedulerCommand creates a *cobra.Command object with default parameters +func NewSchedulerCommand() *cobra.Command { + s := NewSchedulerServer() + s.AddFlags(pflag.CommandLine) + cmd := &cobra.Command{ + Use: "kube-scheduler", + Long: `The Kubernetes scheduler is a policy-rich, topology-aware, +workload-specific function that significantly impacts availability, performance, +and capacity. The scheduler needs to take into account individual and collective +resource requirements, quality of service requirements, hardware/software/policy +constraints, affinity and anti-affinity specifications, data locality, inter-workload +interference, deadlines, and so on. Workload-specific requirements will be exposed +through the API as necessary.`, + Run: func(cmd *cobra.Command, args []string) { + }, + } + + return cmd +} + // AddFlags adds flags for a specific SchedulerServer to the specified FlagSet func (s *SchedulerServer) AddFlags(fs *pflag.FlagSet) { fs.IntVar(&s.Port, "port", s.Port, "The port that the scheduler's http service runs on")