Production-Grade Container Scheduling and Management
Go to file
Kubernetes Submit Queue 6895518177 Merge pull request #40008 from apprenda/kubeadm_112_init_token
Automatic merge from submit-queue

kubeadm: init must validate or generate token before anything else.

**What this PR does / why we need it**: `kubeadm init` must validate or generate a token before anything else. Otherwise, if token validation or generation fail, one will need to run `kubeadm reset && systemctl restart kubelet` before re-running `kubeadm init`.

**Which issue this PR fixes**: fixes kubernetes/kubeadm#112

**Special notes for your reviewer**: /cc @luxas

Tested manually.

### With no token

```
$ sudo ./kubeadm init
[kubeadm] WARNING: kubeadm is in alpha, please do not use it for production clusters.
[preflight] Running pre-flight checks
[init] Using Kubernetes version: v1.5.2
[token-discovery] A token has not been provided, generating one
[certificates] Generated Certificate Authority key and certificate.
[certificates] Generated API Server key and certificate
[certificates] Generated Service Account signing keys
[certificates] Created keys and certificates in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[apiclient] Created API client, waiting for the control plane to become ready
[apiclient] All control plane components are healthy after 7.762803 seconds
[apiclient] Waiting for at least one node to register and become ready
[apiclient] First node is ready after 1.003148 seconds
[apiclient] Creating a test deployment
[apiclient] Test deployment succeeded
[token-discovery] Using token: 8321b6:a535ba541af7623c
[token-discovery] Created the kube-discovery deployment, waiting for it to become ready
[token-discovery] kube-discovery is ready after 1.003423 seconds
[addons] Created essential addon: kube-proxy
[addons] Created essential addon: kube-dns
Your Kubernetes master has initialized successfully!
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
    http://kubernetes.io/docs/admin/addons/
You can now join any number of machines by running the following on each node:
kubeadm join --discovery token://8321b6:a535ba541af7623c@10.142.0.6:9898
```

### With invalid token

```
$ sudo ./kubeadm init --discovery token://12345:12345
[kubeadm] WARNING: kubeadm is in alpha, please do not use it for production clusters.
[preflight] Running pre-flight checks
[init] Using Kubernetes version: v1.5.2
[token-discovery] A token has been provided, validating [&{ID:12345 Secret:12345 Addresses:[]}]
token ["12345:12345"] was not of form ["^([a-z0-9]{6})\\:([a-z0-9]{16})$"]
```

### With valid token

```
$ sudo ./kubeadm ex token generate
cd540e:c0e0318e2f4a63b1

$ sudo ./kubeadm init --discovery token://cd540e:c0e0318e2f4a63b1
[kubeadm] WARNING: kubeadm is in alpha, please do not use it for production clusters.
[preflight] Running pre-flight checks
[init] Using Kubernetes version: v1.5.2
[token-discovery] A token has been provided, validating [&{ID:cd540e Secret:c0e0318e2f4a63b1 Addresses:[]}]
[certificates] Generated Certificate Authority key and certificate.
[certificates] Generated API Server key and certificate
[certificates] Generated Service Account signing keys
[certificates] Created keys and certificates in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[apiclient] Created API client, waiting for the control plane to become ready
[apiclient] All control plane components are healthy after 13.513305 seconds
[apiclient] Waiting for at least one node to register and become ready
[apiclient] First node is ready after 0.502656 seconds
[apiclient] Creating a test deployment
[apiclient] Test deployment succeeded
[token-discovery] Using token: cd540e:c0e0318e2f4a63b1
[token-discovery] Created the kube-discovery deployment, waiting for it to become ready
[token-discovery] kube-discovery is ready after 2.002457 seconds
[addons] Created essential addon: kube-proxy
[addons] Created essential addon: kube-dns
Your Kubernetes master has initialized successfully!
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
    http://kubernetes.io/docs/admin/addons/
You can now join any number of machines by running the following on each node:
kubeadm join --discovery token://cd540e:c0e0318e2f4a63b1@10.142.0.6:9898
```

**Release note**:
```release-note
NONE
```
2017-01-18 04:03:48 -08:00
.github
api generated: swagger 2017-01-16 16:13:30 -05:00
build Wait until kubernetes-src.tar.gz is build before building node/server. 2017-01-11 15:55:44 -08:00
cluster Merge pull request #39925 from appscode/kube-dns-1.11.0 2017-01-17 10:08:48 -08:00
cmd Merge pull request #40008 from apprenda/kubeadm_112_init_token 2017-01-18 04:03:48 -08:00
docs Fix broken link to logging documentation 2017-01-15 00:14:12 -08:00
examples Merge pull request #39709 from smarterclayton/object_meta 2017-01-17 15:32:33 -08:00
federation generated: staging 2017-01-17 16:17:20 -05:00
Godeps bump(k8s.io/gengo):3c6a809462caf39389d70d9ea787ed24c5acffed 2017-01-16 16:13:31 -05:00
hack Swagger doc generation needs to work on meta/v1 2017-01-17 16:17:19 -05:00
hooks Fix spelling in package naming linter error message 2016-12-20 15:48:14 -05:00
logo
pkg Merge pull request #40030 from colemickens/colemickens-dyn-disk-name-length 2017-01-17 21:37:02 -08:00
plugin Merge pull request #40042 from seh/add-ingress-to-rbac-roles 2017-01-17 15:32:45 -08:00
staging Correct import statements 2017-01-17 16:18:18 -05:00
test Correct import statements 2017-01-17 16:18:18 -05:00
third_party start the apimachinery repo 2017-01-11 09:09:48 -05:00
translations Add initial translation support. 2016-12-23 20:45:52 -08:00
vendor generated: staging 2017-01-17 16:17:20 -05:00
.gazelcfg.json Generate a dummy BUILD file in _output/local/go to keep Bazel out of trouble 2017-01-05 22:05:17 -08:00
.generated_docs add create rolebinding 2016-12-21 09:03:27 -05:00
.generated_files List generated files for the github size munger 2016-11-15 15:47:22 -08:00
.gitattributes Add -diff attributes for generated files 2016-12-08 17:12:07 -08:00
.gitignore
BUILD.bazel Add a rule to create kubernetes-src.tar.gz 2017-01-05 14:14:13 -08:00
CHANGELOG.md Update CHANGELOG.md for v1.5.2. 2017-01-11 23:06:30 -08:00
code-of-conduct.md
CONTRIBUTING.md updated munge-docs 2016-11-29 01:35:11 -08:00
labels.yaml
LICENSE LICENSE: revert modifications to Apache license 2016-11-22 11:44:46 -08:00
Makefile make help should be bazel aware 2017-01-06 14:56:01 -08:00
Makefile.generated_files Remove a from each codegen path 2016-12-30 18:44:32 -08:00
OWNERS
OWNERS_ALIASES OWNERS: Create sig-node alias 2017-01-17 16:25:40 -08:00
README.md Update README.md 2016-12-20 08:51:06 -06:00
Vagrantfile Customizable vagrant rsync args and excludes 2016-11-14 11:18:44 +01:00
WORKSPACE build test binary with bazel 2017-01-09 14:39:15 -08:00

Kubernetes

Submit Queue Widget GoDoc Widget Coverage Status Widget

Introduction

Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications. Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF)

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.


Are you ...

Code of Conduct

The Kubernetes community abides by the CNCF code of conduct. Here is an excerpt:

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

Community

Do you want to help "shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented? ". If you are a company, you should consider joining the CNCF. For details about who's involved in CNCF and how Kubernetes plays a role, read the announcement. For general information about our community see the website community page.

Join us on social media (Twitter, Google+) and read our blog

Ask questions and help answer them on Slack or Stack Overflow

Attend our key events (kubecon, cloudnativecon, weekly community meeting)

Join a Special Interest Group (SIG)

Contribute

If you're interested in being a contributor and want to get involved in developing Kubernetes, get started with this reading:

You will then most certainly gain a lot from joining a SIG, attending the regular hangouts as well as the community meeting.

If you have an idea for a new feature, see the Kubernetes Features repository for a list of features that are coming in new releases as well as details on how to propose one.

Building Kubernetes for the impatient

If you want to build Kubernetes right away there are two options:

$ go get -d k8s.io/kubernetes
$ cd $GOPATH/src/k8s.io/kubernetes
$ make
$ git clone https://github.com/kubernetes/kubernetes
$ cd kubernetes
$ make quick-release

If you are less impatient, head over to the developer's documentation.

Support

While there are many different channels that you can use to get hold of us (Slack, Stack Overflow, Issues, Forums/Mailing lists), you can help make sure that we are efficient in getting you the help that you need.

If you need support, start with the troubleshooting guide and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another. We don't bite!

Analytics