Merge pull request #69332 from neolit123/v1alpha-doc-update

kubeadm: include better details about v1alpha3 godocs
pull/58/head
k8s-ci-robot 2018-10-02 10:57:18 -07:00 committed by GitHub
commit a7da82fb9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 6 deletions

View File

@ -23,18 +23,32 @@ limitations under the License.
// Some of these options are also available as command line flags, but // Some of these options are also available as command line flags, but
// the preferred way to configure kubeadm is to pass a single YAML file with // the preferred way to configure kubeadm is to pass a single YAML file with
// multiple configuration types in with the --config option. // multiple configuration types in with the --config option.
// The configuration types should be separated by a line with `---`.
// //
// kubeadm defines several configuration types: // kubeadm uses several API types:
// * InitConfiguration // * InitConfiguration
// https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha3#InitConfiguration
// * JoinConfiguration // * JoinConfiguration
// https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha3#JoinConfiguration
// * ClusterConfiguration // * ClusterConfiguration
// https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha3#ClusterConfiguration
// * KubeProxyConfiguration
// https://godoc.org/k8s.io/kube-proxy/config/v1alpha1#KubeProxyConfiguration
// * KubeletConfiguration
// https://godoc.org/k8s.io/kubelet/config/v1beta1#KubeletConfiguration
// //
// InitConfiguration and JoinConfiguration cannot share a single YAML file, // For `kubeadm init` you can include the following types:
// however it is expected that InitConfiguration and ClusterConfiguration will // InitConfiguration, ClusterConfiguration, KubeProxyConfiguration, KubeletConfiguration
// share a single YAML file.
// //
// A fully populated example of a single YAML file containing multiple // For `kubeadm join` you can include the following types:
// JoinConfiguration, KubeProxyConfiguration, KubeletConfiguration
//
// To print the default values for certain API type you can use:
// kubeadm config print-default --api-objects=<type1>,<type2>
//
// Here is a fully populated example of a single YAML file containing multiple
// configuration types to be used during a `kubeadm init` run. // configuration types to be used during a `kubeadm init` run.
//
// apiVersion: kubeadm.k8s.io/v1alpha3 // apiVersion: kubeadm.k8s.io/v1alpha3
// kind: InitConfiguration // kind: InitConfiguration
// bootstrapTokens: // bootstrapTokens:
@ -127,4 +141,5 @@ limitations under the License.
// //
// TODO: The BootstrapTokenString object should move out to either k8s.io/client-go or k8s.io/api in the future // TODO: The BootstrapTokenString object should move out to either k8s.io/client-go or k8s.io/api in the future
// (probably as part of Bootstrap Tokens going GA). It should not be staged under the kubeadm API as it is now. // (probably as part of Bootstrap Tokens going GA). It should not be staged under the kubeadm API as it is now.
//
package v1alpha3 // import "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha3" package v1alpha3 // import "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha3"

View File

@ -98,9 +98,11 @@ func NewCmdConfigPrintDefault(out io.Writer) *cobra.Command {
Aliases: []string{"print-defaults"}, Aliases: []string{"print-defaults"},
Short: "Print the default values for a kubeadm configuration object.", Short: "Print the default values for a kubeadm configuration object.",
Long: fmt.Sprintf(dedent.Dedent(` Long: fmt.Sprintf(dedent.Dedent(`
This command prints the default InitConfiguration object that is used for 'kubeadm init' and 'kubeadm upgrade', This command prints objects such as the default InitConfiguration that is used for 'kubeadm init' and 'kubeadm upgrade',
and the default JoinConfiguration object that is used for 'kubeadm join'. and the default JoinConfiguration object that is used for 'kubeadm join'.
For documentation visit: https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha3
Note that sensitive values like the Bootstrap Token fields are replaced with silly values like %q in order to pass validation but Note that sensitive values like the Bootstrap Token fields are replaced with silly values like %q in order to pass validation but
not perform the real computation for creating a token. not perform the real computation for creating a token.
`), sillyToken), `), sillyToken),