Commit Graph

498 Commits (49e72d60495e93f93b22dc93104eb5709cd7c403)

Author SHA1 Message Date
Lucas Käldström 407722b378
Remove an old proxy arg function, add clustercidr to the proxy manifest and automatically calculate the dns ip 2017-02-06 23:09:27 +02:00
Derek McQuay 318e27b68a
kubeadm: app/util/template.go has unit tests
remove TODO because unit tests have been added
2017-02-02 11:31:52 -08:00
Derek McQuay 42738fffb3
kubeadm: updated tests in app/util pkg
Tests did not follow the standard of being table driven.
2017-02-02 11:28:56 -08:00
Lucas Käldström 6d7d1317cb
Move the apiCallRetryInterval constants to a common place and a little bit cleanup 2017-02-02 00:05:14 +02:00
Lucas Käldström 8f660dc24e
Add a ParseTemplate util function for parsing go text templates easily 2017-02-01 23:33:22 +02:00
Kubernetes Submit Queue a812493aae Merge pull request #39302 from bruceauyeung/k8s-branch-fix-nil-check-and-typos
Automatic merge from submit-queue (batch tested with PRs 40132, 39302, 40194, 40619, 40601)

fix nil check and typos

**What this PR does / why we need it**:
1. nil error should be checked before defer statement.
2. fix some typos.

Signed-off-by: bruceauyeung ouyang.qinhua@zte.com.cn
2017-01-27 18:32:23 -08:00
Kubernetes Submit Queue 433e7a1fee Merge pull request #40132 from bruceauyeung/k8s-branch-add-invalid-and-valid-tokens-in-TestValidateToken-testcase
Automatic merge from submit-queue

add test tokens for TestValidateToken

Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>


**What this PR does / why we need it**:

1. add invalid tokens which token ID and token secret contain special characters such as `*`
2. add valid tokens which  token ID and token secret contain mixed lowercase characters and numeric numbers
2017-01-27 18:23:36 -08:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
bruceauyeung cc198d3293 add test tokens for TestValidateToken
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-01-19 17:16:26 +08:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
Kubernetes Submit Queue 451a24d6de Merge pull request #39677 from apprenda/kubeadm_104-lowercase_token
Automatic merge from submit-queue

kubeadm: must lower-case token portion used in DNS label.

**What this PR does / why we need it**: In Kubernetes, DNS labels must be lower-case. `kubeadm` doesn't care when creating certain objects through the API. This PR fixes that erroneous behavior.

**Which issue this PR fixes**: fixes https://github.com/kubernetes/kubeadm/issues/104

**Special notes for your reviewer**: /cc @luxas @mikedanese @dgoodwin
2017-01-16 13:43:12 -08:00
Paulo Pires a34eacc2af
kubeadm: token must be validated before creation, deletion or usage.
Refs kubernetes/kubeadm#104
2017-01-16 19:25:07 +00:00
Paulo Pires 44b044ab0a
kubeadm: token generation must respect Kubernetes DNS labeling rules.
Refs kubernetes/kubeadm#104
2017-01-16 19:14:20 +00:00
Paulo Pires 394f93b921
kubeadm: replaced period as token separator in favor of colon. 2017-01-16 18:57:23 +00:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
NickrenREN a12dea14e0 fix redundant alias clientset 2017-01-12 10:21:05 +08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Derek McQuay 8f0f09c0fe kubeadm: updated preflight types to avoid stutter
PreFlightError and PreFlightCheck to Error and Checker to avoid
preflight.PreFlightError and preflight.PreFlightCheck stutter.
2017-01-10 16:20:38 -08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Lucas Käldström 720f3b45aa
Refactor the pki, cert, kubeconfig code in the kubeadm binary into two separate and logically independent phases 2017-01-03 23:40:07 +02:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
bruceauyeung 8537aa4a99 fix nil check and typos 2016-12-29 18:00:28 +08:00
Devan Goodwin bfe345dd86 Implement kubeadm bootstrap token management.
Adds kubeadm subcommands to create, list, and delete bootstrap tokens.
Tokens can be created with a TTL duration, or 0 for tokens that will not
expire. The create command can also be used to specify your own token
(for use when bootstrapping masters and nodes in parallel), or update an
existing token's secret or ttl.

Marked "ex" for experimental for now as the boostrap controllers are not
yet hooked up in core.
2016-12-20 11:43:55 -04:00
Kubernetes Submit Queue 01b9d49673 Merge pull request #38677 from bruceauyeung/k8s-branch-fix-typos-and-comments
Automatic merge from submit-queue

path.Clean paths in GlobalEnvParams and remove unnecessary path.Join

**What this PR does / why we need it**:

1. clean all paths in `GlobalEnvParams`
1. remove unnecessary path.Join call in `pki.go`
2. fix some typos and comment errors

Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-17 12:16:47 -08:00
bruceauyeung 02c1814113 remove unnecessary path.Join
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-17 11:57:00 +08:00
Mike Danese 7945c437e5 kubeadm: support --discovery token:// 2016-12-15 13:54:49 -08:00
Mike Danese 690c7e578b kubeadm: refactor discovery behind an interface 2016-12-15 13:54:49 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Lucas Käldström b0603046b4 Fix review feedback, bazel files, tests and the dnsmasq-metrics spec. Set --kubelet-preferred-address-types on v1.5 and higher clusters 2016-12-09 22:16:37 +02:00
Lucas Käldström 810e9e107f Refactor the whole binary, a lot of changes in one commit I know, but I just hacked on this and modified everything I thought was messy or could be done better.
Fix boilerplates, comments in the code and make the output of kubeadm more user-friendly
Start using HostPKIPath and KubernetesDir everywhere in the code, so they can be changed for real
More robust kubeadm reset code now.
Removed old glog-things from app.Run()
Renamed /etc/kubernetes/cloud-config.json to /etc/kubernetes/cloud-config since it shouldn't be a json file
Simplification of the code
Less verbose output from master/pki.go
Cleaned up dead code

Start a small logging/output framework:
 - fmt.Println("[the-stage-here] Capital first letter of this message. Tell the user what the current state is")
 - fmt.Printf("[the-stage-here] Capital first letter. Maybe a [%v] in the end if an error should be displayed. Always ends with \n")
 - fmt.Errorf("Never starts with []. Includes a short error message plus the underlying error in [%v]. Never ends with \n")
2016-12-09 12:48:12 +02:00
Kubernetes Submit Queue 1132d1645b Merge pull request #37222 from kad/dyn-version
Automatic merge from submit-queue (batch tested with PRs 36263, 36755, 37357, 37222, 37524)

kubeadm: Implement support for symbolic labels in --use-kubernetes-version

**What this PR does / why we need it**: This patch adds "stable", "latest" and other labels as valid versions in "kubeadm init --use-kubernetes-version" flag.

Now, defaults can be pointing to "stable" and users will always get
latest available stable build of Kubernetes via kubeadm.
There is no need anymore to hardcode version string inside kubeadm
binary.

 It is also possible to use labels like "latest" or point to exact
 branch: "stable-1.4"

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:
```release-note
- kubeadm init --use-kubernetes-version now understands "stable","latest", "stable-1.4" and other labels as valid version. It will fetch actual build number from release servers. 
```
2016-12-02 16:26:49 -08:00
Alexander Kanevskiy 39f55cb4df Added test case for KubernetesReleaseVersion 2016-11-30 18:00:29 +02:00
Alexander Kanevskiy 78e28923ba Implement support for symbolic labels in --use-kubernetes-version
Now, defaults can be pointing to "stable" and users will always get
latest available stable build of Kubernetes via kubeadm.
There is no need anymore to hardcode version string inside kubeadm
binary.

It is also possible to use labels like "latest" or point to exact
branch: "stable-1.4"
2016-11-30 18:00:29 +02:00
Derek McQuay 4f035181cb kubeadm: changed tests to be table driven
This change was to make tests found in tokens_test.go be table driven to
match other testing development that has been going on in kubeadm.
2016-11-15 09:55:27 -08:00
Paulo Pires eb6eeb704a
kubeadm: gofmt'ed cmd/kubeadm. 2016-10-29 11:38:53 -04:00
Derek McQuay b7c685d421
kubeadm: EnvParam struct and GlobalEnvParam
Previously, GetEnvParams (now called SetEnvParams) had no way of being altered unless
it was through enviroment variables. These changes allow for a global
EnvParam to be set and also altered while still initally getting their value from
set enviroment variables. This change is especially helpful for testing
(see kubeadm/app/util/kubeconfig_test.go).
2016-10-29 09:41:51 -04:00
Derek McQuay a018564975
kubeadm: added tests for util/{error,kubeconfig} 2016-10-29 09:41:51 -04:00
Derek McQuay 1bfa867088
kubeadm: added unit tests for util/tokens 2016-10-29 09:41:50 -04:00
Derek McQuay 89b1c950bc
kubeadm: fixed small typo in alpha warning 2016-10-25 17:30:56 -04:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Jacob Beacham ec7561fdef If token validation fails, give the user the expected format.
Part of #33930.
2016-10-19 14:28:17 -07:00
Derek McQuay 16b159c12b kubeadm implement preflight checks
Includes checks for verifying services exist and are enabled, ports are
open, directories do not exist or are empty, and required binaries are
in the path.

Checks that user running kubeamd init and join is root and will only execute
command if user is root. Moved away from using kubectl error handling to
having kubeadm handle its own errors. This should allow kubeadm to have
more meaningful errors, exit codes, and logging for specific kubeadm use
cases.
2016-10-13 10:09:36 -03:00
Mike Danese b3dae78c62 kubeadm: turn api into a real apigroup 2016-10-07 11:14:53 -07:00
Mike Danese 56ea178e7c kubeadm: refactor config
1) break object into substructures
2) seperate a config object for master and node
2016-10-03 14:44:18 -07:00
Ilya Dmitrichenko a023085a5f
Address comments in review 2016-09-24 17:28:34 +01:00
Ilya Dmitrichenko 0f05ccb019
Cleanup some low-hanging fruits and review TODOs 2016-09-24 14:46:40 +01:00
Paulo Pires 26aa32d32b
Reviewed help text, fix typos, go {fmt,vet,lint}. 2016-09-24 14:46:38 +01:00
Ilya Dmitrichenko a42ad6a913
Move `pkg/kubadm` to `cmd/kubeadm/app`, remove `cmd/manual.go` 2016-09-24 14:46:38 +01:00