Commit cd700ee3 authored by Eric Paris's avatar Eric Paris

Merge pull request #26313 from nikhiljindal/fedServerDoc

federation: Adding a tool to generate docs for federation apiserver and controller manager
parents 2127a405 060e5379
.generated_docs .generated_docs
contrib/completions/bash/kubectl contrib/completions/bash/kubectl
docs/admin/federation-apiserver.md
docs/admin/federation-controller-manager.md
docs/admin/kube-apiserver.md docs/admin/kube-apiserver.md
docs/admin/kube-controller-manager.md docs/admin/kube-controller-manager.md
docs/admin/kube-proxy.md docs/admin/kube-proxy.md
......
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
<!-- BEGIN STRIP_FOR_RELEASE -->
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.
Documentation for other releases can be found at
[releases.k8s.io](http://releases.k8s.io).
</strong>
--
<!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING -->
## federation-controller-manager
### Synopsis
The federation controller manager is a daemon that embeds
the core control loops shipped with federation. In applications of robotics and
automation, a control loop is a non-terminating loop that regulates the state of
the system. In federation, a controller is a control loop that watches the shared
state of the federation cluster through the apiserver and makes changes attempting
to move the current state towards the desired state. Examples of controllers that
ship with federation today is the cluster controller.
```
federation-controller-manager
```
### Options
```
--address=0.0.0.0: The IP address to serve on (set to 0.0.0.0 for all interfaces)
--cluster-monitor-period=40s: The period for syncing ClusterStatus in ClusterController.
--federated-api-burst=30: Burst to use while talking with federation apiserver
--federated-api-qps=20: QPS to use while talking with federation apiserver
--kube-api-content-type="": ContentType of requests sent to apiserver. Passing application/vnd.kubernetes.protobuf is an experimental feature now.
--kubeconfig="": Path to kubeconfig file with authorization and master location information.
--leader-elect[=false]: Start a leader election client and gain leadership before executing the main loop. Enable this when running replicated components for high availability.
--leader-elect-lease-duration=15s: The duration that non-leader candidates will wait after observing a leadership renewal until attempting to acquire leadership of a led but unrenewed leader slot. This is effectively the maximum duration that a leader can be stopped before it is replaced by another candidate. This is only applicable if leader election is enabled.
--leader-elect-renew-deadline=10s: The interval between attempts by the acting master to renew a leadership slot before it stops leading. This must be less than or equal to the lease duration. This is only applicable if leader election is enabled.
--leader-elect-retry-period=2s: The duration the clients should wait between attempting acquisition and renewal of a leadership. This is only applicable if leader election is enabled.
--log-flush-frequency=5s: Maximum number of seconds between log flushes
--master="": The address of the federation API server (overrides any value in kubeconfig)
--port=10253: The port that the controller-manager's http service runs on
--profiling[=true]: Enable profiling via web interface host:port/debug/pprof/
```
###### Auto generated by spf13/cobra on 25-May-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/admin/federation-controller-manager.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->
/*
Copyright 2016 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/doc"
"k8s.io/kubernetes/cmd/genutils"
fedapiservapp "k8s.io/kubernetes/federation/cmd/federation-apiserver/app"
fedcmapp "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app"
)
// Note: We have a separate binary for generating federation docs and kube docs because of the way api groups are registered.
// If we import both kube-apiserver and federation-apiserver in the same binary then api groups from both kube and federation will get registered in both the apiservers
// and hence will produce incorrect flag values.
// We can potentially merge cmd/kubegendocs and this when we have fixed that problem.
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 "federation-apiserver":
// generate docs for federated-apiserver
apiserver := fedapiservapp.NewAPIServerCommand()
doc.GenMarkdownTree(apiserver, outDir)
case "federation-controller-manager":
// generate docs for kube-controller-manager
controllermanager := fedcmapp.NewControllerManagerCommand()
doc.GenMarkdownTree(controllermanager, outDir)
default:
fmt.Fprintf(os.Stderr, "Module %s is not supported", module)
os.Exit(1)
}
}
...@@ -115,6 +115,7 @@ kube::golang::test_targets() { ...@@ -115,6 +115,7 @@ kube::golang::test_targets() {
cmd/genswaggertypedocs cmd/genswaggertypedocs
cmd/linkcheck cmd/linkcheck
examples/k8petstore/web-server/src examples/k8petstore/web-server/src
federation/cmd/genfeddocs
vendor/github.com/onsi/ginkgo/ginkgo vendor/github.com/onsi/ginkgo/ginkgo
test/e2e/e2e.test test/e2e/e2e.test
test/e2e_node/e2e_node.test test/e2e_node/e2e_node.test
......
...@@ -187,6 +187,7 @@ kube::util::gen-docs() { ...@@ -187,6 +187,7 @@ kube::util::gen-docs() {
genman=$(kube::util::find-binary "genman") genman=$(kube::util::find-binary "genman")
genyaml=$(kube::util::find-binary "genyaml") genyaml=$(kube::util::find-binary "genyaml")
genbashcomp=$(kube::util::find-binary "genbashcomp") genbashcomp=$(kube::util::find-binary "genbashcomp")
genfeddocs=$(kube::util::find-binary "genfeddocs")
mkdir -p "${dest}/docs/user-guide/kubectl/" mkdir -p "${dest}/docs/user-guide/kubectl/"
"${gendocs}" "${dest}/docs/user-guide/kubectl/" "${gendocs}" "${dest}/docs/user-guide/kubectl/"
...@@ -196,6 +197,8 @@ kube::util::gen-docs() { ...@@ -196,6 +197,8 @@ kube::util::gen-docs() {
"${genkubedocs}" "${dest}/docs/admin/" "kube-proxy" "${genkubedocs}" "${dest}/docs/admin/" "kube-proxy"
"${genkubedocs}" "${dest}/docs/admin/" "kube-scheduler" "${genkubedocs}" "${dest}/docs/admin/" "kube-scheduler"
"${genkubedocs}" "${dest}/docs/admin/" "kubelet" "${genkubedocs}" "${dest}/docs/admin/" "kubelet"
"${genfeddocs}" "${dest}/docs/admin/" "federation-apiserver"
"${genfeddocs}" "${dest}/docs/admin/" "federation-controller-manager"
mkdir -p "${dest}/docs/man/man1/" mkdir -p "${dest}/docs/man/man1/"
"${genman}" "${dest}/docs/man/man1/" "${genman}" "${dest}/docs/man/man1/"
mkdir -p "${dest}/docs/yaml/kubectl/" mkdir -p "${dest}/docs/yaml/kubectl/"
......
...@@ -29,7 +29,8 @@ kube::golang::setup_env ...@@ -29,7 +29,8 @@ kube::golang::setup_env
cmd/genman \ cmd/genman \
cmd/genyaml \ cmd/genyaml \
cmd/genbashcomp \ cmd/genbashcomp \
cmd/mungedocs cmd/mungedocs \
federation/cmd/genfeddocs
kube::util::ensure-temp-dir kube::util::ensure-temp-dir
......
...@@ -32,11 +32,6 @@ kube::golang::setup_env ...@@ -32,11 +32,6 @@ kube::golang::setup_env
cmd/mungedocs cmd/mungedocs
# Find binary # Find binary
gendocs=$(kube::util::find-binary "gendocs")
genkubedocs=$(kube::util::find-binary "genkubedocs")
genman=$(kube::util::find-binary "genman")
genyaml=$(kube::util::find-binary "genyaml")
genbashcomp=$(kube::util::find-binary "genbashcomp")
mungedocs=$(kube::util::find-binary "mungedocs") mungedocs=$(kube::util::find-binary "mungedocs")
DOCROOT="${KUBE_ROOT}/docs/" DOCROOT="${KUBE_ROOT}/docs/"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment