Commit Graph

2421 Commits (750881c0ab62a9f59d53582bc33826caa167aa83)

Author SHA1 Message Date
Kubernetes Submit Queue 1bc78add3e Merge pull request #40682 from dgoodwin/pod-security-context
Automatic merge from submit-queue (batch tested with PRs 38443, 40145, 40701, 40682)

Move kubeadm etcd SELinux options from container to pod.

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

Works around a bug that surfaces in Docker 1.12+ related to the pause
container's namespace and selinux labels being transferred to the etcd
container when it runs.

At present it appears that applying selinux options to a container may
be broken, or perhaps shouldn't be supported at all. Moving these to the
pod causes all containers (including pause) to run with the correct
labels.



**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**:

Related to and partial fix for https://github.com/kubernetes/kubeadm/issues/107

This is one of several selinux related fixes in flight for upcoming releases, and newer versions of Docker. To successfully run kubeadm with selinux enforcing right now would like require a recent container-selinux build as uncovered in https://github.com/kubernetes/kubeadm/issues/107, a bugfix for the format labels in #40179, and finally this fix.

**Release note**:

```release-note
Fixed an SELinux issue in kubeadm on Docker 1.12+ by moving etcd SELinux options from container to pod.
```
2017-01-30 20:59:44 -08:00
deads2k c9a008dff3 move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
Devan Goodwin 65a48b57ff Move kubeadm etcd SELinux options from container to pod.
Works around a bug that surfaces in Docker 1.12+ related to the pause
container's namespace and selinux labels being transferred to the etcd
container when it runs.

At present it appears that applying selinux options to a container may
be broken, or perhaps shouldn't be supported at all. Moving these to the
pod causes all containers (including pause) to run with the correct
labels.
2017-01-30 10:16:22 -04:00
Dr. Stefan Schimanski 44ea6b3f30 Update generated files 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
Kubernetes Submit Queue babecf10dd Merge pull request #40194 from bruceauyeung/k8s-branch-fix-error-message-in-TestGetAddonImage
Automatic merge from submit-queue (batch tested with PRs 40132, 39302, 40194, 40619, 40601)

fix error message in TestGetAddonImage

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

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

1. fix incorrect error message in TestGetAddonImage
2. rename some variables to make them more reasonable
2017-01-27 18:32:24 -08: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
Kubernetes Submit Queue 3ac0581a81 Merge pull request #39320 from bruceauyeung/k8s-branch-fix-incorrect-parameter-passing
Automatic merge from submit-queue

fix incorrect parameter passing

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


**What this PR does / why we need it**:
1. fix incorrect parameter passing when creating error
2. fix ineffectual assignment to err variable.
2017-01-27 15:50:54 -08:00
deads2k 2734f8f892 move dynamic and discovery clients 2017-01-26 08:37:06 -05:00
Kubernetes Submit Queue a931b7e238 Merge pull request #40357 from sttts/sttts-more-cutoffs-2
Automatic merge from submit-queue (batch tested with PRs 39538, 40188, 40357, 38214, 40195)

genericapiserver: cut off more dependencies – episode 2

Compare commit subjects.

approved based on #40363
2017-01-25 17:47:13 -08:00
Kubernetes Submit Queue 61d4a71853 Merge pull request #40429 from dgoodwin/self-hosted-wait
Automatic merge from submit-queue

Wait for the self-hosted control plane during kubeadm init.

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

Currently we are completing kubeadm init while the scheduler and
controller manager are likely still not yet up. In some cases if they
will fail, they won't ever come up.

Instead wait until each pod enters running state before exiting kubeadm.

**Release note**:

```release-note
NONE
```
2017-01-25 13:26:05 -08:00
Dr. Stefan Schimanski a0137e9b28 Update generated files 2017-01-25 19:49:45 +01:00
Dr. Stefan Schimanski d7eb3b6870 pkg/util: move uuid and strategicpatch into k8s.io/apimachinery 2017-01-25 19:45:09 +01:00
Devan Goodwin 1eb2e60dbf Wait for the self-hosted control plane during kubeadm init.
Currently we are completing kubeadm init while the scheduler and
controller manager are likely still not yet up. In some cases if they
will fail, they won't ever come up.

Instead wait until each pod enters running state before exiting kubeadm.
2017-01-25 12:16:03 -04:00
Timothy St. Clair bfe41927ba Cleaup Affinity post conversion from annotations to fields 2017-01-25 08:32:28 -06:00
Steve Kriss 29087066d0 fixed bug #36988 -- kubeadm crashes when using multiple API endpoints 2017-01-24 16:51:16 -08:00
Kubernetes Submit Queue df42444742 Merge pull request #40216 from sttts/sttts-more-cutoffs
Automatic merge from submit-queue (batch tested with PRs 39260, 40216, 40213, 40325, 40333)

genericapiserver: more dependency cutoffs

- cut-off pkg/api.Resource and friends - lgtm
- authn plugins -> k8s.io/apiserver - 
- webhook authz plugin -> k8s.io/apiserver - lgtm
- ~~pkg/cert -> k8s.io/apimachinery (will rebase on @deads2k's PR also moving it)~~
- split pkg/config into kubelet config merger and flags - lgtm
- split feature gate between generic apiserver and kube - lgtm
- move pkg/util/flag into k8s.io/apiserver - lgtm
2017-01-24 16:26:00 -08:00
Dr. Stefan Schimanski 2b8e938128 Update generated files 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski 82826ec273 pkg/util/flag: move to k8s.io/apiserver 2017-01-24 20:56:03 +01:00
Clayton Coleman be6d2933df
refactor: Move *Options references to metav1 2017-01-24 13:41:51 -05:00
Clayton Coleman 7b1c715496
generated: Move references to metav1.*Options 2017-01-24 13:41:48 -05:00
Clayton Coleman fca7e00608
Move all *Options to metav1 2017-01-24 13:15:26 -05:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
Kubernetes Submit Queue 0fac54e65e Merge pull request #40316 from luxas/kubeadm_fix_apiserver_certs
Automatic merge from submit-queue (batch tested with PRs 40303, 40316)

kubeadm: Fix up the apiserver kubelet client cert

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

I didn't notice that the apiserver serving cert was _only_ a server cert, not both a server and client cert in https://github.com/kubernetes/kubernetes/pull/40292.

This PR fixes that misconception and generates a dedicated client cert for apiserver -> kubelet communication and harmonizes the `ca.crt` path to `/etc/kubernetes/pki/ca.crt` on both master and node.

**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**:

```console
$ systemctl cat kubelet
# /lib/systemd/system/kubelet.service
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=http://kubernetes.io/docs/

[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf **--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt** --require-kubeconfig=true"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local"
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_EXTRA_ARGS


$ curl -k https://localhost:10250/containerLogs/kube-system/weave-net-arm64-4t2xv/weave
Forbidden (user=system:anonymous, verb=get, resource=nodes, subresource=proxy)
$ curl --cert /etc/kubernetes/pki/apiserver-kubelet-client.crt --key /etc/kubernetes/pki/apiserver-kubelet-client.key -k https://localhost:10250/containerLogs/kube-system/weave-net-arm64-4t2xv/weave
[Works!!]
```

**Release note**:

```release-note
NONE
```

@liggitt @deads2k
2017-01-24 01:57:11 -08:00
bruceauyeung 21e49646b8 fix incorrect parameter passing
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-01-24 14:37:57 +08:00
Clayton Coleman 9009c1ac14
generated: informer,client 2017-01-23 17:52:47 -05:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Clayton Coleman f623a8c908
Make all groups use metav1.AddToGroupVersion for ListOptions 2017-01-23 16:53:18 -05:00
Lucas Käldström 695fb7440e
Fix up the misunderstanding about the apiserver kubelet client cert 2017-01-23 21:45:48 +02:00
Kubernetes Submit Queue 5ea80569ae Merge pull request #40227 from deads2k/client-11-easy
Automatic merge from submit-queue

make client-go tools/auth and tools/clientcmd authoritative

These moved easily.  Pure mechanical.  I'll have a couple snip pulls for some of the more complicated packages.  `pkg/util/homedir` was a transitive that moved with. It was only used in `kubectl` and you'd need it to be consistent with `clientcmd` loading order.

@sttts
2017-01-23 09:07:17 -08:00
Kubernetes Submit Queue 071844e35f Merge pull request #40292 from luxas/kubeadm_node_ca
Automatic merge from submit-queue (batch tested with PRs 38445, 40292)

kubeadm: Secure apiserver -> kubelet communication and set storage backend to etcd3

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

Switch storage backend to etcd3
Writes ca.crt down to disk so we can set `--client-ca-file=/etc/kubernetes/ca.crt` for the kubelet.
Adds --kubelet-client-{certificate,key} to the apiserver args and make it allowed to access the kubelets
In some cases the `path` dependency is switched to `filepath`

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

fixes https://github.com/kubernetes/kubeadm/issues/118
fixes https://github.com/kubernetes/kubeadm/issues/129

**Special notes for your reviewer**:

This PR is should make it possible to secure the apiserver -> kubelet communication.

**Release note**:

```release-note
NONE
```

@pires @mikedanese @andrewrynhard @liggitt @deads2k
2017-01-23 08:11:08 -08:00
deads2k 335ef747d6 mechanical 2017-01-23 10:03:55 -05:00
deads2k 7cc9702402 separate announce factories 2017-01-23 08:02:14 -05:00
Lucas Käldström 6a37f450ae
Add --kubelet-client-{certificate,key} to the apiserver args and make it allowed to access the kubelets 2017-01-23 13:16:04 +02:00
Lucas Käldström 6579c94559
Write ca.crt down to disk in kubeadm join 2017-01-23 13:15:19 +02:00
Lucas Käldström 22ce0fdf2d
Set apiserver's storage backend to etcd3 2017-01-23 12:08:01 +02:00
Lucas Käldström 9e7ef10f95
Don't require the kubeconfigs and certs to not exist; that's now handled in later in the individual phase code. Also fix a small test 2017-01-21 01:00:17 +02:00
Lucas Käldström 13499f443a
Generate two certs and two private keys; only the necessary ones; make the certs and kubeconfig phases work with valid files already on-disk and some cleanup 2017-01-21 00:33:06 +02:00
Lucas Käldström 741b0b8c9f
Make the discovery deployment load the CA from a file 2017-01-21 00:30:35 +02:00
Kubernetes Submit Queue 0efee9a67e Merge pull request #40152 from liggitt/sign-cert-org
Automatic merge from submit-queue (batch tested with PRs 40187, 40231, 40152)

Update client/server cert generation utilities

Limit generated cert usage to client or server use.
2017-01-20 13:29:48 -08:00
Kubernetes Submit Queue b5929bfb2b Merge pull request #38789 from jessfraz/cleanup-temp-dirs
Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

Cleanup temp dirs

So funny story my /tmp ran out of space running the unit tests so I am cleaning up all the temp dirs we create.
2017-01-20 12:34:58 -08:00
Kubernetes Submit Queue 7f9997a456 Merge pull request #40075 from apprenda/kubeadm_self_hosted
Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

kubeadm: add optional self-hosted deployment

**What this PR does / why we need it**: add an optional self-hosted deployment type to `kubeadm`, for master components only, namely `apiserver`, `controller-manager` and `scheduler`.

**Which issue this PR fixes**: closes #38407

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

**Release note**:
```release-note
kubeadm: add optional self-hosted deployment for apiserver, controller-manager and scheduler.
```
2017-01-20 12:34:56 -08:00
Paulo Pires 724ce6a8a5
kubeadm: add temporary --self-hosted flag. 2017-01-20 17:41:47 +00:00
Paulo Pires c80c0275da
kubeadm: add self-hosted as optional deployment type. 2017-01-20 17:41:47 +00:00
Devan Goodwin 750cdb5bc2
kubeadm: first pass at self-hosted master components. 2017-01-20 17:41:46 +00:00
Jordan Liggitt 11012c19df
Update client/server cert generation utilities 2017-01-20 12:22:39 -05:00
deads2k 9d3dfbf630 move apimachinery/announced to apimachinery 2017-01-20 12:20:13 -05:00
deads2k dfd8db8ae9 allow API groups to be installed and registered in multiple schemes 2017-01-20 12:19:49 -05:00
Kubernetes Submit Queue 22a405055d Merge pull request #40170 from deads2k/client-10-restclient
Automatic merge from submit-queue (batch tested with PRs 36693, 40154, 40170, 39033)

make client-go authoritative for pkg/client/restclient

Moves client/restclient to client-go and a util/certs, util/testing as transitives.
2017-01-20 09:18:52 -08:00
Kubernetes Submit Queue 49cb10c843 Merge pull request #40154 from liggitt/kubeadm-rbac
Automatic merge from submit-queue (batch tested with PRs 36693, 40154, 40170, 39033)

kubeadm: RBAC cleanup

builds on https://github.com/kubernetes/kubernetes/pull/40153 and includes some follow-up items from https://github.com/kubernetes/kubernetes/pull/39846
2017-01-20 09:18:51 -08:00
deads2k ee6752ef20 find and replace 2017-01-20 08:04:53 -05:00
deads2k c587b8a21e re-run client-gen 2017-01-20 08:02:36 -05:00
bruceauyeung db08ac829e fix error message in TestGetAddonImage
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-01-20 11:14:53 +08:00
Lucas Käldström c771dff526
Only enable RBAC if the k8s version is above 1.6.0-alpha.0, move some of the defaulting of the api type into a specific file 2017-01-19 22:24:50 +02:00
Jordan Liggitt 083ffb6e93
kubeadm: clean up RBAC grants 2017-01-19 14:54:41 -05:00
Jordan Liggitt e3f79588f4
kubeadm: use built-in system:node-bootstrapper role 2017-01-19 14:52:47 -05:00
Jordan Liggitt 0b5fcbe2ab
Remove kubeadm authorizer package dependency 2017-01-19 12:01:53 -05:00
deads2k 11e8068d3f move pkg/fields to apimachinery 2017-01-19 09:50:16 -05:00
deads2k cdb2934bbc remove kubernetes copy of clientcmd types 2017-01-19 07:39:19 -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
Andrew Rynhard f46bf42ba0 Add authorization mode to kubeadm 2017-01-18 14:02:53 -08:00
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
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
Kubernetes Submit Queue b79765e38d Merge pull request #40002 from apprenda/kubeadm_dns_1_11_0
Automatic merge from submit-queue (batch tested with PRs 39911, 40002, 39969, 40012, 40009)

kubeadm: upgrade kube-dns to 1.11.0.

**What this PR does / why we need it**: See kubernetes/dns#25

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

**Special notes for your reviewer**: /cc @luxas
I know this is not the template solution you are looking for but seems to me it's important enough to do this now because of the issues it fixes.
Tested manually and it works.

`NONE`
2017-01-17 06:46:55 -08:00
Kubernetes Submit Queue 6d19340d95 Merge pull request #39911 from bruceauyeung/k8s-branch-check-docker-service-active-when-resetting-cluster
Automatic merge from submit-queue

[kubeadm] resetting cluster should check whether docker service is active

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

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

if not, `kubeadm reset` will fail to remove kubernetes-managed containers
2017-01-17 06:41:57 -08:00
Paulo Pires 6b5d803e8a
kubeadm: improve init token logging. 2017-01-17 12:42:06 +00:00
Dr. Stefan Schimanski 52f6831576 genericapiserver: cut off kube pkg/version dependency 2017-01-17 12:34:05 +01:00
Paulo Pires 2e8df3b569
kubeadm: init must validate or generate token before anything else.
Fixes kubernetes/kubeadm#112
2017-01-17 10:29:15 +00:00
Paulo Pires 262eeea0d3
kubeadm: upgrade kube-dns to 1.11.0.
Fixes kubernetes/kubeadm#121
2017-01-17 09:13:04 +00:00
bruceauyeung 2ba9347233 resetting cluster should check whether docker service is active
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-01-17 15:53:19 +08: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
Kubernetes Submit Queue dccd073888 Merge pull request #39495 from apprenda/kubeadm_89-remove_preflight_stutter
Automatic merge from submit-queue (batch tested with PRs 39495, 39547)

kubeadm: updated preflight types to avoid stutter

Small change to kubeadm preflight pkg to remove stutter from preflight types PreFlightError and PreFlightCheck (now names Error and Checker). 

**Release note**:

`NONE`
2017-01-10 23:20:08 -08:00
Kubernetes Submit Queue f74a556f56 Merge pull request #39534 from apprenda/kubeadm_refactor_token_discovery
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702)

kubeadm: refactored token discovery.

**What this PR does / why we need it**: refactored `kubeadm` token discovery to follow the discovery interface and use new TLS bootstrap mechanism.

/cc @luxas @mikedanese
2017-01-10 22:24:15 -08:00
Kubernetes Submit Queue c425f77263 Merge pull request #39617 from apprenda/kubeadm_dns_upgrade
Automatic merge from submit-queue (batch tested with PRs 39673, 39536, 39617, 39540, 39686)

kubeadm: updated DNS deployment.

**What this PR does / why we need it**: Updates KubeDNS deployment to match upstream.

**Special notes for your reviewer**: It was tested manually by bootstrapping a new cluster, running a busybox container and making sure one could `nslookup` from within the container to find `kubernetes` and other services.
2017-01-10 20:38:17 -08:00
Paulo Pires 8a195b9a1b
kubeadm: refactored token discovery. 2017-01-11 01:09:34 +00:00
Paulo Pires d2e0913e68
kubeadm: fixed TLS bootstrap. 2017-01-11 01:08:31 +00: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
Derek McQuay fb4ee4deba kubeadm: add preflight check for bridge-nf 2017-01-09 09:56:02 -08:00
Paulo Pires 070f7d9d2d
kubeadm: updated DNS deployment. 2017-01-09 15:43:30 +00:00
Kubernetes Submit Queue 41d7acc0f5 Merge pull request #39464 from apprenda/kubeadm_93-more_discovery
Automatic merge from submit-queue

Implemented file and HTTPS based discovery for kubeadm

**What this PR does / why we need it**:
This PR implements both file and HTTPS based discovery for `kubeadm`.

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

**Special notes for your reviewer**:
I'd like to add some tests but 'm sure `kubeconfig` loading is already covered by other tests in `clientcmd` package.

/cc @luxas @pipejakob
2017-01-06 05:42:02 -08:00
Paulo Pires c272bc56b1
kubeadm: flag token discovery pieces to be refactored. 2017-01-06 12:09:50 +00:00
Paulo Pires a519335303
kubeadm: added HTTPS discovery.
Fixes kubernetes/kubeadm#94
2017-01-06 12:08:34 +00:00
Paulo Pires 18370ba0c1
kubeadm: added file discovery.
Fixes kubernetes/kubeadm#93
2017-01-06 12:07:25 +00:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Kubernetes Submit Queue ed5414d333 Merge pull request #39426 from apprenda/kubeadm_95-fix_token_discovery
Automatic merge from submit-queue

kubeadm token discovery URL may not have valid input for url.Parse

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

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

**Special notes for your reviewer**:
/cc @dgoodwin @luxas @mikedanese this is a WIP! Need a couple things:
* decide token separator, `.` or `:`
* define error handling in `token.go::37`
2017-01-05 01:47:14 -08:00
Kubernetes Submit Queue f605bfda61 Merge pull request #39429 from apprenda/kubeadm_80-change_etcd_datadir
Automatic merge from submit-queue

kubeadm: change etcd data dir to match host path.

**What this PR does / why we need it**: Trivial change that adopts a well-known path for etcd data, following the `hostPath` defined.

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

**Special notes for your reviewer**:
/cc @luxas @kad
2017-01-05 00:13:28 -08:00
Paulo Pires a6cdfdef4b
kubeadm: make sure URL is valid for token discovery. 2017-01-05 08:05:48 +00:00
Jacob Beacham 5cc36c9f05 Bugfix on kubeadm join with non-token discovery.
Without this change, using a non-token discovery mechanism during a join
triggers a nil pointer panic (instead of an error message about not
being implemented yet).
2017-01-04 15:40:52 -08:00
Paulo Pires cae862dadf
kubeadm: kube-proxy needs to know the pod subnet CIDR in order to understand what's internal and external traffic.
Fixes https://github.com/kubernetes/kubeadm/issues/102
2017-01-04 20:32:27 +00:00
Jess Frazelle db75904b42
fix when os.Remove should be os.RemoveAll
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:34:06 -08:00
Paulo Pires 241c530648
kubeadm: change etcd data dir to match host path.
Fixes https://github.com/kubernetes/kubeadm/issues/80
2017-01-04 16:43:13 +00:00
Kubernetes Submit Queue d0e160559d Merge pull request #39389 from mikedanese/kubeadm-fix
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

kubeadm: readd --api-port, accidentally removed during refactor.

this broke stuff
2017-01-03 18:25:12 -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 0d6c029f7f kubeadm: readd --api-port, accidentally removed during refactor. 2017-01-03 13:38:21 -08:00
Jeff Grafton fae627dd65 Update generated for 2017 2017-01-01 23:11:09 -08: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
Kubernetes Submit Queue 67a3cd3a58 Merge pull request #39029 from kad/issue75
Automatic merge from submit-queue

Fix cloud-config name in test case

**What this PR does / why we need it**: fixes default cloud-config name in test cases for reset.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2016-12-23 06:21:27 -08:00
Kubernetes Submit Queue 9d38145cfb Merge pull request #37887 from bruceauyeung/k8s-branch-use-bytes-buffer-instead-of-append-for-error-string-concat
Automatic merge from submit-queue

use bytes.Buffer instead of append for error string concat

**What this PR does / why we need it**:
1. in my benchmark test, `bytes.Buffer` takes much less time ( about 1:1000 ) than string append( `+=` ). 
>BenchmarkAppendConcat-4           100000            151438 ns/op          578181 B/op          2 allocs/op
BenchmarkBufferSprintf-4         3000000               487 ns/op              65 B/op          3 allocs/op
BenchmarkBufferConcat-4          5000000               271 ns/op              47 B/op          1 allocs/op

the benchmark codes is here  https://play.golang.org/p/LS52zGuwZN

2. in our `RunInitMasterChecks`, `RunJoinNodeChecks` there are lots of preflight checks. they may result in a huge error message. so `bytes.Buffer` can bring considerable performance enhancement in the worst of conditions.

beyond that, this PR 
1. fix an exported struct comment,
1. and use `found = append( found, errs...)` instead of for loop for simplicity.


Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-23 03:56:32 -08:00
Devan Goodwin bf69fb1747 kubeadm: Default to using token discovery.
Recent changes to support multiple methods for discovery meant that
"kubeadm init" no longer was sufficient and users would need to add
"--discovery token://" to achieve the same results.

Instead lets assume discovery if the user does not specify anything else
to maintain parity and the brevity of our original instructions.
2016-12-22 12:54:34 -04:00
Alexander Kanevskiy 2ac85d762f Fix cloud-config name in reset tests
Default name is /etc/kubernetes/cloud-config, thus tests
should cover "cloud-config" and not "cloud-config.json"
2016-12-21 14:42:11 +02: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
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Lucas Käldström 96850dc600 Set --anonymous-auth to false on v1.5 clusters to preserve the locked-down v1.4 behaviour 2016-12-13 17:51:15 +02:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
bruceauyeung 12e97da0c1 use bytes.Buffer instead of append for error string concat
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-13 09:10:13 +08:00
Lucas Käldström 5222bd3e34 Bump default kubernetes version when no internet is present to v1.5 2016-12-12 23:59:14 +02:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue e732ee70f4 Merge pull request #38406 from liggitt/remove-internal-json-annotations
Automatic merge from submit-queue

Remove json serialization annotations from internal types

fixes #3933

Internal types should never be serialized, and including json serialization tags on them makes it possible to accidentally do that without realizing it.

fixes in this PR:

* types
  * [x] remove json tags from internal types
  * [x] fix references from serialized types to internal ObjectMeta
* generation
  * [x] remove generated json codecs for internal types (they should never be used)
* kubectl
  * [x] fix `apply` to operate on versioned object
  * [x] fix sorting by field to operate on versioned object
  * [x] fix `--record` to build annotation patch using versioned object
* hpa
  * [x] fix unmarshaling to internal CustomMetricTargetList in validation
* thirdpartyresources
  * [x] fix encoding API responses using internal ObjectMeta
* tests
  * [x] fix tests to use versioned objects when checking encoded content
  * [x] fix tests passing internal objects to generic printers

follow ups (will open tracking issues or additional PRs):
- [ ] remove json tags from internal kubeconfig types (`kubectl config set` pathfinding needs to work against external type)
- [ ] HPA should version CustomMetricTargetList serialization in annotations
- [ ] revisit how TPR resthandlers encoding objects
- [ ] audit and add tests for printer use (human-readable printer requires internal versions, generic printers require external versions)
- [ ] add static analysis tests preventing new internal types from adding tags
- [ ] add static analysis tests requiring json tags on external types (and enforcing lower-case first letter)
- [ ] add more tests for `kubectl get` exercising known and unknown types with all output options
2016-12-10 14:00:17 -08:00
Kubernetes Submit Queue ac05e7135a Merge pull request #37568 from luxas/various_kubeadm_improvements
Automatic merge from submit-queue (batch tested with PRs 37270, 38309, 37568, 34554)

kubeadm UX improvements for the v1.5 stable release

This PR targets the next stable kubeadm release.

It's work in progress, but please comment on it and review, since there are many changes.

I tried to group the commits logically, so you can review them separately.

Q: Why this large PR? Why not many small?
A: Because of the Submit Queue and the time it takes.

PTAL @kubernetes/sig-cluster-lifecycle

_Edit:_ This work was splitted up in three PRs in total
2016-12-09 14:11:19 -08:00
Jordan Liggitt d5afb71cf4
Remove json serialization annotations from internal types 2016-12-09 16:26:03 -05: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
Kubernetes Submit Queue 5b5b1e7533 Merge pull request #38371 from wojtek-t/get_options_in_client
Automatic merge from submit-queue (batch tested with PRs 38354, 38371)

Add GetOptions parameter to Get() calls in client library

Ref #37473 

This PR is super mechanical - the non trivial commits are:
- Update client generator
- Register GetOptions in batch/v2alpha1 group
2016-12-09 04:12:09 -08: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
Lucas Käldström e46d8fef60 Run the root check before the other checks in order to fail fast if non-root to avoid strange errors. Also auto-start the kubelet if inactive 2016-12-09 12:48:11 +02:00
Lucas Käldström 95d97a0e8e Mark socat, ethtool and ebtables as soft deps, since kubelet can be run in a container. Also refactor preflight.go a little bit and improve logging 2016-12-09 12:48:11 +02:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
bruceauyeung 511350a369 trimspace on user specified env params
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-08 10:31:23 +08:00
Kubernetes Submit Queue 72e7adb658 Merge pull request #36735 from YuPengZTE/devHTTP
Automatic merge from submit-queue

type HttpProxyCheck should be HTTPProxyCheck

**What this PR does / why we need it**:
Change HttpProxyCheck to HTTPProxyCheck
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
golint
**Release note**:

```release-note
```

Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-12-07 16:21:21 -08:00
Kubernetes Submit Queue aa08702d23 Merge pull request #37835 from luxas/kubeadm_cloudprovider_and_dns
Automatic merge from submit-queue (batch tested with PRs 38294, 37009, 36778, 38130, 37835)

Add a cloudprovider validator flag to kubeadm and update the DNS spec

Broken out from: https://github.com/kubernetes/kubernetes/pull/37568

This PR creates a flag for `cloud-provider` that validates the value before `RunInit()` is run, which makes it now act as a "real" flag
Then it removes the `k8s.io/kubernetes/pkg/cloudprovider` dependency, which makes the binary ~40MB smaller! That's _really_ worth it!

In the second commit, the DNS addon is updated to the latest version: https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/skydns-rc.yaml.base

@kubernetes/sig-cluster-lifecycle
2016-12-07 10:45:22 -08:00
Lucas Käldström f4cb405164 Update the built-in DNS addon of kubeadm to the v1.5 version 2016-12-07 16:24:21 +02:00
Lucas Käldström 342f98d516 Create a new cloud-provider flag in order to catch wrong args directly and don't import the cloudprovider package and save ~50% in binary size 2016-12-07 16:24:02 +02:00
Kubernetes Submit Queue 87d907cafe Merge pull request #37084 from kenan435/fail-fast-on-duplicate-node
Automatic merge from submit-queue (batch tested with PRs 38194, 37594, 38123, 37831, 37084)

[kubeadm] Fail fast if there already is a node in the cluster with that name

kubeadm Fail fast if there is another node with the same name already in the cluster. 

Fixes #36255

cc @kubernetes/sig-cluster-federation
2016-12-06 17:41:37 -08:00
Kubernetes Submit Queue 4eb4777df1 Merge pull request #37831 from luxas/improve_reset
Automatic merge from submit-queue (batch tested with PRs 38194, 37594, 38123, 37831, 37084)

Improve kubeadm reset

Depends on: https://github.com/kubernetes/kubernetes/pull/36474
Broken out from: https://github.com/kubernetes/kubernetes/pull/37568
Carries: https://github.com/kubernetes/kubernetes/pull/35709, @camilocot

This makes the `kubeadm reset` command more robust and user-friendly.
I'll rebase after #36474 merges...

cc-ing reviewers: @mikedanese @errordeveloper @dgoodwin @jbeda
2016-12-06 17:41:35 -08:00
Kenan Karamehmedovic 16453a3334 Fail fast if there is already a node with same name as the one being joined. 2016-12-06 15:46:15 +01:00
Lucas Käldström 7a463eff08 Drain node on kubeadm reset and make it possible to specify if the node should be removed from the cluster as well 2016-12-06 15:43:59 +02:00
Lucas Käldström 67d4ddaf59 Improve the kubeadm reset command. Reorder the functions and log more user-friendly output 2016-12-06 14:45:29 +02:00
Lucas Käldström 51d733f418 Remove the cni directory when resetting; otherwise kubelet can pick up the wrong config on the next kubeadm init run 2016-12-06 14:45:19 +02:00
Alexander Kanevskiy 1eeb3f155f Pass proxy environment variables to static pods
To access outside world or cloud provider APIs it might be
required to use proxy.

Fixes: kubernetes/kubernetes#36573, kubernetes/kubeadm#5
2016-12-06 14:38:48 +02:00
Alexander Block fd8e6d03e6 Fix test failures in manifests_test.go 2016-12-05 10:28:23 +01:00
Alexander Block 8373ab5890 kubeadm: Let apiserver and controller-manager host-mount /etc/pki when required
fixes: #36150
2016-12-05 10:11:15 +01:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Kubernetes Submit Queue 00e369b14f Merge pull request #37813 from kubernetes/revert-36625-branch-eliminate-recursive-call-attemptToUpdateMasterRoleLabelsAndTaints
Automatic merge from submit-queue (batch tested with PRs 35300, 36709, 37643, 37813, 37697)

Revert "[kubeadm] use iteration instead of recursion in function"

Reverts kubernetes/kubernetes#36625

Removing the recursive call means that `n` is never updated, so you never succeed in the update, and you've creating an infinite loop.

Also, this entire bit of functionality should be a patch and you won't have to worry about conflicts.  

@luxas
2016-12-03 08:55:59 -08:00
Kubernetes Submit Queue efa42b95a6 Merge pull request #37532 from smarterclayton/remove_export
Automatic merge from submit-queue

Remove ExportOptions from api/internal and use unversioned

Should only have one internal object in use

Part of #37530
2016-12-02 21:11:56 -08:00
Kubernetes Submit Queue c868b870e6 Merge pull request #37498 from dgoodwin/firewalld-check
Automatic merge from submit-queue (batch tested with PRs 37945, 37498, 37391, 37209, 37169)

Warn if firewalld service is enabled.

Fixes https://github.com/kubernetes/kubeadm/issues/21

Output will be:

```
(root@centos1 ~) $ kubeadm init             
Running pre-flight checks
WARNING: firewalld is active, please ensure ports [6443 9898 10250] are open
```

I went with the port list from @errordeveloper 's ansible playbook here but it's possible there should be others listed.
2016-12-02 20:32:44 -08:00
Kubernetes Submit Queue 51458a0ef0 Merge pull request #37524 from vwfs/skip_etcd_checks_reset
Automatic merge from submit-queue (batch tested with PRs 36263, 36755, 37357, 37222, 37524)

kubeadm: Skip etcd related preflight checks and reset actions for external etcd

**What this PR does / why we need it**:
Skip etcd related preflight checks and reset actions for external etcd

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # https://github.com/kubernetes/kubeadm/issues/69#issuecomment-262988388

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
kubeadm: Skip etcd related preflight checks and reset actions for external etcd
```
2016-12-02 16:26:51 -08: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
Derek McQuay b3a56abed0 kubeadm: updated pkg node tests to correct type
updated ""k8s.io/kubernetes/pkg/api" to apiv1 "k8s.io/kubernetes/pkg/api/v1" to fix broken types in tests.
2016-12-02 08:42:46 -08:00
Derek McQuay 644a0ceec9 kubeadm: adding test owner and bazel update 2016-12-02 08:42:46 -08:00
Derek McQuay 49b53b8644 kubeadm: unit tests for app/master/apiclient.go 2016-12-02 08:42:46 -08:00
Derek McQuay ada63282ed kubeadm: unit tests for app/master/addons.go 2016-12-02 08:42:45 -08:00
Derek McQuay a54515d281 kubeadm: unit tests for app/master/discovery.go 2016-12-02 08:42:45 -08:00
Derek McQuay fe73a8a8ff kubeadm: unit tests for app/master/pki.go 2016-12-02 08:42:45 -08:00
Derek McQuay bd4d98fabe kubeadm: unit tests for app/master/manifests.go 2016-12-02 08:42:45 -08:00
Derek McQuay 124dab6c5a kubeadm: unit tests for app/master/kubeconfig.go 2016-12-02 08:42:45 -08:00
Derek McQuay cb3b08a8d4 kubeadm: unit tests for app/master/tokens.go 2016-12-02 08:42:45 -08:00
Kubernetes Submit Queue 53b27ef14e Merge pull request #36474 from bruceauyeung/branch-failure-check-on-umount-when-kubeadm-reset
Automatic merge from submit-queue

add failure check on umount when kubeadm reset, and on service stop

**What this PR does / why we need it**:
before this PR, `umount` will exit with code `123` if `grep` does not match anything
`xargs` has an option:

>-r, --no-run-if-empty
              If the standard input does not contain any nonblanks, do not run the command.  Normally, the command is run  once  even  if
              there is no input.  This option is a GNU extension.


1. this PR add `-r` option to `xargs` , so `umount` will not execute and exit with code `0` correctly while `grep` does not match anything.
2. this PR add failure check on umount. for example, if the directory to be umount is busy, a error message will be printed:
>failed to unmount directories in /var/lib/kubelet, umount: /var/lib/kubelet/foo/bar: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

3. add failure check on kubelet service stop.


Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-02 05:45:03 -08:00
Kubernetes Submit Queue edefe66c78 Merge pull request #36106 from apprenda/kubeadm-unit-tests-pkg-node
Automatic merge from submit-queue

Kubeadm unit tests pkg node

Added unit tests for the kubeadm/app/node package testing functionality of bootstrap.go, csr.go, and discovery.go. 

This PR is part of the ongoing effort to add tests (#35025)

/cc @pires @jbeda
2016-12-02 05:45:01 -08:00
Kubernetes Submit Queue 9a67c20b3d Merge pull request #37327 from jasonbrooks/pr-kubeadm-selinux
Automatic merge from submit-queue

change unconfined_t to spc_t

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

When installing kube via kubeadm on a system w/ selinux enabled, it's necessary to disable selinux in order for the etcd and kube-discovery containers to run. 

The kube etcd and discovery pods are currently set to unconfined_t in order to avoid disabling selinux, but the correct type for an unconfined container is spc_t. For more information, see http://danwalsh.livejournal.com/2016/10/03/.
2016-12-02 01:00:42 -08:00
Derek McQuay d87d3ff9ca
kubeadm: updated pkg node tests to correct types
updated pkg "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" to "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5" because the type that bootstrap.go:126 checkAPIEndpoint requires changed as well as *internalversion.CertificatesClient in csr_test.go:69
2016-12-01 10:32:41 -08:00
Derek McQuay 4ab42db17e kubeadm: unit tests for app/node/ pkg 2016-12-01 09:30:19 -08:00
David Eads ce7b08af92 Revert "[kubeadm] use iteration instead of recursion in function" 2016-12-01 08:48:45 -05:00
Kubernetes Submit Queue 2fab199390 Merge pull request #36334 from luxas/add_preflight
Automatic merge from submit-queue

Add the system verification test to the kubeadm preflight checks

And refactor the system verification test to accept to write to a specific writer in order to customize the output

This PR is targeting v1.5, PTAL
cc @Random-Liu @dchen1107 @kubernetes/sig-cluster-lifecycle
2016-12-01 04:52:07 -08:00
Kubernetes Submit Queue aef15aa875 Merge pull request #36625 from bruceauyeung/branch-eliminate-recursive-call-attemptToUpdateMasterRoleLabelsAndTaints
Automatic merge from submit-queue

[kubeadm] use iteration instead of recursion in function

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

before this PR, function `attemptToUpdateMasterRoleLabelsAndTaints` recursively call itself. there are some defeats in it:
1. potential stack overflow.
2. unnecessary extra  `json.Marshal` calls.
3. unnecessary extra `client.Nodes().List` calls.

this PR rewrite `attemptToUpdateMasterRoleLabelsAndTaints` function, use iterate instead of recursion.
so these 3 defeats the metioned above are gone.
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-01 00:39:14 -08:00
Kubernetes Submit Queue c74fae7b14 Merge pull request #36172 from apprenda/kubeadm-tests-table-driven
Automatic merge from submit-queue

kubeadm: changed tests to be table driven

Small change to migrate tests in kubeadm/app/util/tokens_test.go to be table driven which should make adding more tests in the future easier and also have them match how other tests are being written. 

This PR is part of the ongoing effort to add tests (#35025)
2016-12-01 00:39:07 -08:00
Kubernetes Submit Queue 39e64fde8c Merge pull request #35948 from spacexnice/master
Automatic merge from submit-queue

support customize repository prefix of image through environment KUBE…

## Problem
kubeadm does not support customize repository prefix of image. this prevent us from using our own image repository to deploy k8s.

## Fix
make ```gcr.io/google_containers/ ``` be configurable.
ADD environment variable KUBE_REPO_PREFIX

Signed-off-by: yaoyao.xyy <yaoyao.xyy@alibaba-inc.com>
2016-11-30 18:39:25 -08:00
Alexander Kanevskiy 6338b7fda0 Fallback to known good stable version in case of network errors.
Hardcoded known stable version will be returned if user
didn't request specific version and kubeadm for some reason
not able to fetch latest stable information from release servers.

For now, fallback version is v1.4.6
2016-11-30 18:00:29 +02: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
Kubernetes Submit Queue 40d5dca16a Merge pull request #35921 from luxas/bump_kubeadm_etcd3
Automatic merge from submit-queue

Update kubeadm etcd to 3.0.13 in order to switch to the etcd3 storage format

ref: https://github.com/kubernetes/kubernetes/issues/35723

I think we should switch as soon as possible, but run it in etcd2 mode until the full etcd3 mode is stable

@kubernetes/sig-cluster-lifecycle @wojtek-t @xiang90 @lavalamp
2016-11-28 16:52:59 -08:00
Clayton Coleman 3dde81f8d0
Remove references to v1/internal ExportOptions 2016-11-27 23:21:06 -05:00
Alexander Block de0e92b4fd Skip etcd related preflight checks and reset actions for external etcd
We should not assume ownership of etcd when external etcd endpoints were
set.

Fixes: https://github.com/kubernetes/kubeadm/issues/69
2016-11-27 12:53:07 +01:00
Devan Goodwin 16e01c65c4 Warn if firewalld service is enabled.
In future we might try to verify ports are actually exposed in firewalld
policy, but this can be quite complex. Instead lets just warn the user
if we see firewalld is running.
2016-11-25 15:37:28 -04:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu e3cf383181 cmd/kubeadm 2016-11-23 15:53:09 -08:00
Jason Brooks bf153fc1d3 change unconfined_t to spc_t
The kube etcd and discovery pods are set to unconfined_t in
order to avoid disabling selinux, but the correct type for
an unconfined container is spc_t. For more information, see
http://danwalsh.livejournal.com/2016/10/03/.
2016-11-22 16:25:31 -08:00
Lucas Käldström aecb0994fb Update the default etcd version for kubeadm to 3.0.14-kubeadm 2016-11-21 16:41:56 +02:00
Derek McQuay bff1af69e9 kubeadm: fixed typo in kubeadm/app/master/pki.go 2016-11-15 09:55:27 -08: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
yupeng 62681dbe73 type HttpProxyCheck should be HTTPProxyCheck
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-14 15:04:58 +08:00
Lucas Käldström a26cbbf3d0 Add the system verification check to the kubeadm preflight checks 2016-11-12 16:37:12 +02:00
bruceauyeung f3c5a6ef8f eliminate recursive call attemptToUpdateMasterRoleLabelsAndTaints
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-11-11 12:25:36 +08:00
bruceauyeung 06a6ec2181 add failure check on umount when kubeadm reset, and on service stop
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-11-09 10:55:34 +08:00
Kubernetes Submit Queue 9761442b19 Merge pull request #36040 from bruceauyeung/add-master-address-desc-into-kubeadm-join-and-some-validations
Automatic merge from submit-queue

add master address into kubeadm join help message and some validations

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

1, add master address into kubeadm join help message. looks like :

>Usage:
>  kubeadm join <master address> [flags]

2, when user provides more than one master address, return an error.

3, since `kubeadm join` not only support ip addresses but also host names or domain names, so i delete the word `ip` from error message `must specify master ip address (see --help)`


Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-11-08 14:52:09 -08:00
Kubernetes Submit Queue 15fa0df93e Merge pull request #35975 from justinsb/role_labels_2
Automatic merge from submit-queue

Add constants for node role labels
2016-11-07 15:02:58 -08:00
Kubernetes Submit Queue afa99c68b8 Merge pull request #35144 from pipejakob/generate-token
Automatic merge from submit-queue

New command: "kubeadm token generate"

As part of #33930, this PR adds a new top-level command to kubeadm to just generate a token for use with the init/join commands. Otherwise, users are left to either figure out how to generate a token on their own, or let `kubeadm init` generate a token, capture and parse the output, and then use that token for `kubeadm join`.

At this point, I was hoping for feedback on the CLI experience, and then I can add tests. I spoke with @mikedanese and he didn't like the original propose of `kubeadm util generate-token`, so here are the runners up:

```
$ kubeadm generate-token          # <--- current implementation
$ kubeadm generate token          # in case kubeadm might generate other things in the future?
$ kubeadm init --generate-token   # possibly as a subcommand of an existing one
```

Currently, the output is simply the token on one line without any padding/formatting:

```
$ kubeadm generate-token
1087fd.722b60cdd39b1a5f
```

CC: @kubernetes/sig-cluster-lifecycle 

**Release note**:

<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->

``` release-note
New kubeadm command: generate-token
```
2016-11-05 16:12:52 -07:00
Justin Santa Barbara cef8315ae8 Add constants for node role labels
Rather than sharing well-known strings, we should be declaring these in
the API.
2016-11-04 18:00:35 -04:00
yaoyao.xyy 73244f078c support customize repository prefix of image through environment KUBE_REPO_PREFIX=gcr.io/google_containers/.
Signed-off-by: yaoyao.xyy <yaoyao.xyy@alibaba-inc.com>
2016-11-04 16:17:01 +08:00
bruceauyeung 3616a04177 add master address desc into kubeadm join and some validations
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-11-03 10:07:39 +08:00
Devan Goodwin fe03e1319f Fix preflight check failure on node join.
We recently improved this to tolerate existence of things like
/etc/kubernetes/manifests/ as an empty dir, but forgot to do so for the
join pre-flight checks where it is also failing.

Instead ensure only the sub-directories and files we need are available.
2016-11-02 16:09:09 -03:00
Kubernetes Submit Queue 7d14b568c3 Merge pull request #36001 from smarterclayton/change_double_decode
Automatic merge from submit-queue

Avoid double decoding all client responses

Fixes #35982 

The linked issue uncovered that we were always double decoding the response in restclient for get, list, update, create, and patch.  That's fairly expensive, most especially for list.  This PR refines the behavior of the rest client to avoid double decoding, and does so while minimizing the changes to rest client consumers.

restclient must be able to deal with multiple types of servers. Alter the behavior of restclient.Result#Raw() to not process the body on error, but instead to return the generic error (which still matches the error checking cases in api/error like IsBadRequest). If the caller uses
.Error(), .Into(), or .Get(), try decoding the body as a Status.

For older servers, continue to default apiVersion "v1" when calling restclient.Result#Error(). This was only for 1.1 servers and the extensions group, which we have since fixed.

This removes a double decode of very large objects (like LIST) - we were trying to DecodeInto status, but that ends up decoding the entire result and then throwing it away.  This makes the decode behavior specific to the type of action the user wants.

```release-note
The error handling behavior of `pkg/client/restclient.Result` has changed.  Calls to `Result.Raw()` will no longer parse the body, although they will still return errors that react to `pkg/api/errors.Is*()` as in previous releases.  Callers of `Get()` and `Into()` will continue to receive errors that are parsed from the body if the kind and apiVersion of the body match the `Status` object.

This more closely aligns rest client as a generic RESTful client, while preserving the special Kube API extended error handling for the `Get` and `Into` methods (which most Kube clients use).
```
2016-11-02 11:36:41 -07:00
Kubernetes Submit Queue c6c06f5492 Merge pull request #36025 from mikedanese/kubeadm_config_defaults
Automatic merge from submit-queue

kubeadm: move defaulting to the api group

ref #35796

@pires @kubernetes/sig-cluster-lifecycle
2016-11-02 03:51:00 -07:00
Kubernetes Submit Queue a8502d14c0 Merge pull request #35965 from YuPengZTE/devCmdDot
Automatic merge from submit-queue

Align with other cli descriptions

**What this PR does / why we need it**:
Align with other cli descriptions

**Special notes for your reviewer**:
![image](https://cloud.githubusercontent.com/assets/20062886/19887803/adbeee16-a065-11e6-9933-98bfff784086.png)



Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-02 03:07:50 -07:00
Clayton Coleman f0fa26bcf6
ExportOptions should be registered to all public schemas 2016-11-01 22:55:58 -04:00
Mike Danese a00db0a32f kubeadm: move kubeadm over to apigroup defaulting 2016-11-01 16:48:39 -07:00
Paulo Pires c7e9ac6f94 autogenerated 2016-11-01 16:48:25 -07:00
Paulo Pires a01b943a7f kubeadm: add defaulting for kubeadm config api group 2016-11-01 16:48:24 -07:00
Kubernetes Submit Queue 1fe9fb2d69 Merge pull request #35972 from kad/proxy-warning
Automatic merge from submit-queue

kubeadm preflight checks: Warn user if connections to API or Discovery are going to be over proxy

**What this PR does / why we need it**: Continuing discussion from PR #35044, new version will provide warning if kubeadm run in environment where http connections would go over proxy.
Most of the time, it is not expected behaviour and leads to situations like in #34695

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

kubeadm during initialization of master and slave nodes need to make
several API calls directly to the node where it is running or master.
In environments with http/https proxies, user might accidentally
have configuration where connections to API would go over proxy instead
of directly.

User can re-run kubeadm with corrected NO_PROXY variable. Example:

  $ NO_PROXY=* kubeadm join ...
2016-11-01 15:56:51 -07:00
Alexander Kanevskiy ce9a13ef13 Warn user if connections to API or Discovery are going to be over proxy
kubeadm during initialization of master and slave nodes need to make
several API calls directly to the node where it is running or master.
In environments with http/https proxies, user might accidentally
have configuration where connections to API would go over proxy instead
of directly.

User can re-run kubeadm with corrected NO_PROXY variable. Example:

  $ NO_PROXY=* kubeadm join ...
2016-11-01 16:23:10 +02:00
yupeng 7d1219fb06 Align with other cli descriptions
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-01 18:59:45 +08:00
Mike Danese 58479268e8 kubeadm: lower default component logging level 2016-10-31 15:29:10 -07:00
Jacob Beacham cf6b6778dc Adding CLI tests for kubeadm. 2016-10-31 11:12:51 -07:00
Jacob Beacham f65c58124d New command: "kubeadm token generate"
This surfaces the token generation logic so that users can first
generate and store a token, then pass it to kubeadm init/join.
Otherwise, users have to capture and parse the output of "kubeadm init"
to feed the token to "kubeadm join."
2016-10-31 11:12:51 -07:00
Kubernetes Submit Queue e4b41dd292 Merge pull request #35777 from redhatlinux10/fix-inconsistent-util-package-import
Automatic merge from submit-queue

make kubeadm version use kubeadmutil

What this PR does / why we need it:

this PR makes sure `kubeadmutil.CheckErr()` other than `cmdutil.CheckErr()` is called in `kubeadm version` subcommand. 
in `version.go`, `RunVersion()` function only returns `nil`, `kubeadmutil.CheckErr()` is enough for this

Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>
2016-10-30 18:08:27 -07:00
Kubernetes Submit Queue 9e71a65335 Merge pull request #35326 from apprenda/kubeadm-unit-tests-pkg-preflight
Automatic merge from submit-queue

kubeadm: added unit test for app/preflight pkg

Added unit test for kubeadm/app/preflight package testing functionality of checks.go.

This PR is part of the ongoing effort to add tests (#35025)

/cc @pires @jbeda
2016-10-30 10:31:56 -07:00
Kubernetes Submit Queue b4f8d88d51 Merge pull request #35843 from bulletRush/feature/pre-hostname-check
Automatic merge from submit-queue

[kubeadm] pre-flight check hostname to ensure kubelet can launch static pods li…

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: pre-flight check hostname to ensure kubelet can launch static pods like kube-apiserver/kube-controller-manager

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

**Special notes for your reviewer**:

# what is the influence of this issue?

kubelet will not create api server and kcm pod if your hostname is uncorrect. It complain the config files in "/etc/kubernetes/manifests" are invlid.

# how to reproduce this issue?

change your hostname by `hostnamectl set-hostname vm_81_12_centos`. then run `kubeadm init`. you will get this error log from kubelet:

```log
Oct 27 11:12:57 vm_81_12_centos kubelet: I1027 11:12:57.279458    2695 file.go:123] Can't process config file "/etc/kubernetes/manifests/kube-controller-manager.json": invalid pod: [metadata.name: Invalid value: "kube-controller-manager-vm_81_12_centos": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com') spec.nodeName: Invalid value: "vm_81_12_centos": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com')]
```

# where the error comes from in the code?

`pkg/kubelet/config/file.go:144 sourceFile:extractFromDir`

```go
func (s *sourceFile) extractFromDir(name string) ([]*api.Pod, error) {
	dirents, err := filepath.Glob(filepath.Join(name, "[^.]*"))
	if err != nil {
		return nil, fmt.Errorf("glob failed: %v", err)
	}

	pods := make([]*api.Pod, 0)
	if len(dirents) == 0 {
		return pods, nil
	}

	sort.Strings(dirents)
	for _, path := range dirents {
		statInfo, err := os.Stat(path)
		if err != nil {
			glog.V(1).Infof("Can't get metadata for %q: %v", path, err)
			continue
		}

		switch {
		case statInfo.Mode().IsDir():
			glog.V(1).Infof("Not recursing into config path %q", path)
		case statInfo.Mode().IsRegular():
			pod, err := s.extractFromFile(path)
			if err != nil {
-->				glog.V(1).Infof("Can't process config file %q: %v", path, err)
			} else {
				pods = append(pods, pod)
			}
		default:
			glog.V(1).Infof("Config path %q is not a directory or file: %v", path, statInfo.Mode())
		}
	}
	return pods, nil
}
```

# how to fix it?

1. change hostname by `hostnamectl set-hostname <right host name>` or
2. add `hostnameOverride` config. If hostnameOverride is set, then kubelet will use this value instead of system hostname.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```

…ke kube-apiserver/kube-controller-manager and so on.
2016-10-30 09:56:25 -07:00
Kubernetes Submit Queue defb44a4d6 Merge pull request #35231 from apprenda/kubeadm-unit-tests-pkg-util
Automatic merge from submit-queue

Kubeadm added unit tests for pkg app/util

Added unit tests for kubeadm/app/util package testing functionality of tokens.go, error.go, and kubeconfig.go.

This PR is part of the ongoing effort to add tests (#35025)

/cc @pires @jbeda
2016-10-30 09:21:31 -07:00
bulletRush 590ef489c8 [kubeadm] pre-flight check hostname to ensure kubelet can launch static pods 2016-10-30 09:40:33 -04:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Paulo Pires f6bac22d69
kubeadm: updated cmd/kubeadm/app/node package related BUILD file. 2016-10-29 11:39:02 -04: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
Paulo Pires b054117c24
kubeadm: updated cmd/kubeadm/app/preflight package related BUILD file. 2016-10-29 09:40:13 -04:00
Derek McQuay a5919a9340
kubeadm: added unit test for app/preflight pkg 2016-10-29 09:40:06 -04:00
redhatlinux10 67f379e510 fix inconsistent util package import
Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>

fix inconsistent util package import

Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>
2016-10-29 04:11:01 +08:00
Kubernetes Submit Queue 0563b45772 Merge pull request #35556 from apprenda/kubeadm-alphawarning-typo
Automatic merge from submit-queue

kubeadm: fixed small typo in alpha warning

Small typo in the alpha warning that I noticed and fixed.
2016-10-27 13:49:53 -07:00
Kubernetes Submit Queue a8e9a1bce6 Merge pull request #35632 from dgoodwin/preflight-conf-fixes
Automatic merge from submit-queue

kubeadm: Stop assuming full ownership of /etc/kubernetes.

Packages may auto-create directories in /etc/kubernetes, and users also
need files such as cloud-config.json to be present and preserved at
their default locations in /etc/kubernetes. As such this modifies
pre-flight checks to only require the absence of the files and
directories we explicitly create in kubeadm.

Reset is similarly modified to not wipe out /etc/kubernetes entirely.
When resetting directories we also now preserve the directory itself,
but delete it's contents.

Also adds tests for reset command logic specifically for /etc/kubernetes
cleanup, to ensure user files are not inadvertently wiped out.
2016-10-27 11:55:27 -07:00
Devan Goodwin 2ee787c583 kubeadm: Empty directories during reset, but do not delete them.
This will allow packages to maintain ownership of config and data
directories, which may carry selinux or other attributes that should be
preserved, but we do not wish to manage within kubeadm itself.
2016-10-27 10:26:41 -03:00
Devan Goodwin 37b1ae42c0 kubeadm: Stop assuming full ownership of /etc/kubernetes.
Packages may auto-create directories in /etc/kubernetes, and users also
need files such as cloud-config.json to be present and preserved at
their default locations in /etc/kubernetes. As such this modifies
pre-flight checks to only require the absence of the files and
directories we explicitly create in kubeadm.

Reset is similarly modified to not wipe out /etc/kubernetes entirely.
When resetting directories we also now preserve the directory itself,
but delete it's contents.

Also adds tests for reset command logic specifically for /etc/kubernetes
cleanup, to ensure user files are not inadvertently wiped out.
2016-10-27 09:14:20 -03:00
Derek McQuay 89b1c950bc
kubeadm: fixed small typo in alpha warning 2016-10-25 17:30:56 -04:00
Ilya Dmitrichenko fe32eddca9
Change default service IP range to 10.96/12 2016-10-25 09:45:32 +01:00
Kubernetes Submit Queue 377967935b Merge pull request #35453 from mikedanese/build-rename
Automatic merge from submit-queue

rename build/ dirs to other things.

#35359
2016-10-24 17:03:25 -07:00
Kubernetes Submit Queue 03c69e114f Merge pull request #35270 from errordeveloper/bump-default-version-in-kubeadm
Automatic merge from submit-queue

Bump kubeadm to use v1.4.4 by default

**Release note**:

```release-note
NONE
```
2016-10-24 16:17:53 -07:00
Mike Danese 763c4987f2 autogenerated 2016-10-24 14:47:27 -07:00
Kubernetes Submit Queue ffdfe9fa9b Merge pull request #35119 from errordeveloper/tidy-up-kubeadm
Automatic merge from submit-queue

Start tidying kubeadm up

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

This PR addresses https://github.com/kubernetes/kubernetes/pull/33262#discussion_r80337511.

**Release note**:
```release-note
NONE
```
2016-10-24 02:26:36 -07:00
Kubernetes Submit Queue a7db9bccb5 Merge pull request #35332 from apprenda/kubeadm-unit-tests-pkg-images
Automatic merge from submit-queue

kubeadm: added unit tests for app/images pkg

Added unit tests for kubeadm/app/images package testing functionality of images.go.

This PR is part of the ongoing effort to add tests (#35025)

/cc @pires @jbeda
2016-10-23 16:21:37 -07:00
Kubernetes Submit Queue 1bd46e5a4e Merge pull request #35265 from redhatlinux10/master-patch-optimise-kubeadm-join-args-generation
Automatic merge from submit-queue

enhance join arguments generation logic using template

**What this PR does / why we need it**:
this PR enhances kubeadm join arguments generation logic using template, this makes code more readable and adding arguments more  easier.

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```

Signed-off-by: 欧阳钦华10079130 <ouyang.qinhua@zte.com.cn>
2016-10-22 17:15:59 -07:00
欧阳钦华10079130 8bbeae02d3 enhance join arguments generation logic using template
Signed-off-by: 欧阳钦华10079130 <ouyang.qinhua@zte.com.cn>

change JoinArgsData to joinArgsData, improve template readability

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

fix extra = type

Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>
2016-10-23 06:38:14 +08:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Derek McQuay 3765c846a4
kubeadm: added unit tests for app/images pkg 2016-10-21 14:47:46 -07:00
Ilya Dmitrichenko 9703df391f
Eliminate half-baked multi-architecture support, but keep node affinity architecture-agnostic (fix #33916) 2016-10-21 14:56:02 +01:00
Ilya Dmitrichenko f09c4833bd
Bump kubeadm to use v1.4.4 by default 2016-10-21 09:25:49 +01:00
Kubernetes Submit Queue 60be3c5f57 Merge pull request #35111 from apprenda/kubeadm_normalize_reset
Automatic merge from submit-queue

kubeadm: Normalized reset command to match init and join commands.

**What this PR does / why we need it**: Overall, improves code structure. Opening single PR in order avoid big PRs in the future, when adding tests and new functionality, i.e. #34404.

```release-note
NONE
```
2016-10-20 20:02:58 -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
Ilya Dmitrichenko b7b0822654
Refactor `getComponentCommand()` for readability 2016-10-19 14:56:55 +01:00
Paulo Pires 0699457f2b
kubeadm: Normalized reset command to match init and join commands. 2016-10-19 13:08:27 +01:00
Ilya Dmitrichenko 6f57775669
Ensure `MasterConfiguration` is refered to as `cfg` throughout 2016-10-17 12:08:11 +01:00
Ilya Dmitrichenko 327dec43fb
Add flags for alternative API and discovery ports (close #34311 #34307 #33638) 2016-10-17 12:08:11 +01:00
Lucas Käldström 4ac49a74aa Remove duplicate --etcd-servers arguments in kubeadm 2016-10-16 21:48:16 +03:00
Lucas Käldström d46490c21e Register the kubeadm api group in cmd/kubeadm 2016-10-15 22:18:23 +03:00
Kubernetes Submit Queue ab14c31b84 Merge pull request #34885 from apprenda/kubeadm_join_configuration
Automatic merge from submit-queue

kubeadm join: Added support for config file.

As more behavior (#34719, #34807, fix for #33641) is added to `kubeadm join`, this will be eventually very much needed. Makes sense to go in sooner rather than later.

Also references #34501 and #34884.

/cc @luxas @mikedanese
2016-10-15 10:11:49 -07:00
Kubernetes Submit Queue 88d6d7a677 Merge pull request #34807 from luxas/kubeadm_reset
Automatic merge from submit-queue

Implement kubeadm reset

@kubernetes/sig-cluster-lifecycle
2016-10-15 06:10:36 -07:00
Kubernetes Submit Queue 7e6fda2eb2 Merge pull request #34718 from taimir/kubeadm-disco-wait
Automatic merge from submit-queue

kubeadm join: polling discovery service API

**What this PR does / why we need it**: Enhance kubeadm to allow for parallel provisioning of API endpoints and slave nodes, in addition to https://github.com/kubernetes/kubernetes/pull/33543. This PR let's `kubeadm join` poll the discovery service API and retry connecting to it every couple of seconds. That way `kubeadm init` and `kubeadm join` can be executed in parallel.

**Fixes**: https://github.com/kubernetes/kubernetes/issues/33542

**Special notes for your reviewer**:

@pires @errordeveloper last part of the discussed changes, in addition to https://github.com/kubernetes/kubernetes/pull/33543 and https://github.com/kubernetes/kubernetes/pull/34703
2016-10-15 04:12:45 -07:00
Paulo Pires 0cc50d37e1
kubeadm join: Added support for config file. 2016-10-15 11:44:21 +01:00
Lucas Käldström ecdaa7195a Implement kubeadm reset 2016-10-15 11:58:06 +03:00
Kubernetes Submit Queue 3e9e507a9b Merge pull request #34703 from taimir/kubeadm
Automatic merge from submit-queue

kubeadm join: wait for API endpoints

**What this PR does / why we need it**: enhance kubeadm to allow for parallel provisioning of API endpoints and slave nodes, continued from https://github.com/kubernetes/kubernetes/pull/33543

**Fixes**: https://github.com/kubernetes/kubernetes/issues/33542

**Special notes for your reviewer**:

* Introduces a concurrent retry mechanism for bootstrapping with a single API endpoint during `kubeadm join` (this was left out in https://github.com/kubernetes/kubernetes/pull/33543 so that it can be implemented in a separate PR). The polling of the discovery service API itself is yet to come.

@errordeveloper @pires
2016-10-14 20:00:27 -07:00
Paulo Pires cf000bff95
kubeadm: fix preflight checks. 2016-10-14 20:16:56 +01:00
Kubernetes Submit Queue b189f5446e Merge pull request #34744 from pipejakob/typos
Automatic merge from submit-queue

Fix simple typos.
2016-10-14 03:08:46 -07:00
Kubernetes Submit Queue a944748ccb Merge pull request #34341 from apprenda/kubeadm-require-root
Automatic merge from submit-queue

kubeadm implement preflight checks

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.

fixes #33908
2016-10-13 15:02:53 -07:00
Atanas Mirchev 072259f80f kubeadm join: wait for API endpoints
* Introduce a concurrent retry mechanism for bootstrapping
   with a single API endpoint
2016-10-13 22:16:11 +02:00
Jacob Beacham 2230714d32 Fix simple typos. 2016-10-13 11:29:26 -07:00
Kubernetes Submit Queue 33a8e5cf67 Merge pull request #34097 from mayflower/kubeadm-typo
Automatic merge from submit-queue

kubeadm: fix typo
2016-10-13 10:08:03 -07:00
Devan Goodwin 4231c046dd Fix errors and improve output in kubeadm pre-flight checks.
Add skip-preflight-checks to known flags.
Fix bug with preflight checks not returning system is-active as errors.
Fix error handling to use correct function.
2016-10-13 11:10:19 -03: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
Devan Goodwin b673e2d0a0 Add kubeadm preflight check framework.
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.
2016-10-13 10:06:52 -03:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
Atanas Mirchev 32edc87e4b kubeadm join: polling discovery service API
* `kubeadm join` will now retry to connect to the discovery service
API instead of exit on first failure. Allows for parallel install.
of master and slave nodes.
2016-10-13 14:51:04 +02:00
Kubernetes Submit Queue c1986f0fc7 Merge pull request #34501 from mikedanese/kubeadm-init-cfg
Automatic merge from submit-queue

kubeadm: allow kubeadm init to read config from file

@kubernetes/sig-cluster-lifecycle
2016-10-13 04:19:05 -07:00
Kubernetes Submit Queue 4a223efd27 Merge pull request #34573 from errordeveloper/fix-early-deployment-issue
Automatic merge from submit-queue

Test API more extensivelly before declaring readiness 

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

It's possible that first deployment kubeadm creates will hit `deployments.extensions "kube-discovery" is forbidden: not yet ready to handle request`, which comes from NamespaceLifecycle admission controller and has something to do with cache. According to @derekwaynecarr, we need to create a namespace-scoped resource to really check for this. I didn't want to make a check with deployment of whatever comes first right now, and decided to have explicit step for this in `apiclient.go`.

**Which issue this PR fixes**: fixes #34411

**Special notes for your reviewer**: @kubernetes/sig-cluster-lifecycle 

**Release note**:
```release-note
NONE
```
2016-10-13 01:44:24 -07:00
Kubernetes Submit Queue d236b84b4f Merge pull request #34555 from mikedanese/conversion
Automatic merge from submit-queue

kubeadm: fix conversion macros and add kubeadm to round trip testing

Tests are probably broken but I'll fix. @jbeda this probably fixes your change unless we decide we need generated deep copies or conversions.

@kubernetes/sig-cluster-lifecycle
2016-10-12 19:47:58 -07:00
Kubernetes Submit Queue 0357341fd5 Merge pull request #34596 from xiaopeng163/master
Automatic merge from submit-queue

fixed grammatical errors

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-10-12 13:46:07 -07:00
Mike Danese 25e4dccefe kubeadm: fix conversion macros and add kubeadm to round trip testing 2016-10-12 13:26:23 -07:00
Kubernetes Submit Queue 346f3b3e76 Merge pull request #33543 from taimir/kubeadm
Automatic merge from submit-queue

Decouple master bootstrap from CSR in kubeadm

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: enhance `kubeadm` to allow for parallel provisioning of API endpoints and slave nodes

**Fixes**: https://github.com/kubernetes/kubernetes/issues/33542

**Special notes for your reviewer**:
This is work in progress, trying to 

 * Introduce a concurrent retry mechanism for bootstrapping
   with a single API endpoint
 * Refactor API client creation, decouple from CSR
2016-10-12 08:53:43 -07:00
Ilya Dmitrichenko 0cb54e7eb2
Append first address from `--api-advertise-addresses` to `kube-apiserver` flags 2016-10-12 12:59:24 +01:00
Peng Xiao c5b96e48ea fixed grammatical errors 2016-10-12 16:29:04 +08:00
Atanas Mirchev 8c8da393e0 Decouple master bootstrap from CSR
* Refactor API client creation, decouple from CSR
2016-10-12 09:16:38 +02:00
Ilya Dmitrichenko 53e393ad42
Test API more extensivelly before declaring readiness (close #34411) 2016-10-11 22:33:39 +01:00
Mike Danese dc616dde7c kubeadm: register all cloudproviders 2016-10-11 11:19:46 -07:00
Mike Danese 58d25e378c kubeadm: allow kubeadm init to read config from file 2016-10-11 10:25:28 -07:00
Lucas Käldström 99aaa3d8f4 Bump kubeadm to use kubernetes v1.4.1 2016-10-10 22:25:26 +03:00
Kubernetes Submit Queue 851705ea59 Merge pull request #34147 from mikedanese/kubeadm-api
Automatic merge from submit-queue

kubeadm: turn api into a real apigroup

@kubernetes/sig-cluster-lifecycle
2016-10-10 09:59:54 -07:00
Kubernetes Submit Queue 7746cb9182 Merge pull request #34352 from mikedanese/fix-cm
Automatic merge from submit-queue

kubeadm: still run cm if not pod cidr is specified

@kubernetes/sig-cluster-lifecycle
2016-10-08 18:25:43 -07:00
Mike Danese 45b92085c4 kubeadm: still run cm if not pod cidr is specified 2016-10-07 12:31:10 -07:00
Mike Danese b3dae78c62 kubeadm: turn api into a real apigroup 2016-10-07 11:14:53 -07:00
Mike Danese db963fc16d kubeadm: mark etcd flags as deprecated 2016-10-05 14:36:03 -07:00
Robin Gloster f2ae2cad0b
kubeadm: fix typo 2016-10-05 18:39:24 +02: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
Kubernetes Submit Queue 64d2b12d21 Merge pull request #33859 from luxas/not_so_aggressve_probes
Automatic merge from submit-queue

Do not probe so aggressively which may lead to unnecessary restarts

@errordeveloper @mikedanese PTAL

I came across a case where etcd restarted about 5-10 times because the load was very high on the machine. 
The load seems to have lead to that the `etcd` container occasionally didn't respond to the probe, which caused many restart and made the whole thing even worse.

Maybe we should remove the etcd probe totally? I don't know, what do you think?
This is at least a try to loosen the limits here...
2016-10-03 05:55:42 -07:00
Kubernetes Submit Queue 347d448180 Merge pull request #33831 from rustyrobot/print-cert-info
Automatic merge from submit-queue

Kubeadm: print information about certificates

Prints basic information about certificates to the user.

Example of `kubeadm init` output:
```
<master/pki> generated Certificate Authority key and certificate:
Issuer: CN=kubernetes | Subject: CN=kubernetes | CA: true
Not before: 2016-09-30 11:19:19 +0000 UTC Not After: 2026-09-28 11:19:19 +0000 UTC
Public: /etc/kubernetes/pki/ca-pub.pem
Private: /etc/kubernetes/pki/ca-key.pem
Cert: /etc/kubernetes/pki/ca.pem
<master/pki> generated API Server key and certificate:
Issuer: CN=kubernetes | Subject: CN=kube-apiserver | CA: false
Not before: 2016-09-30 11:19:19 +0000 UTC Not After: 2017-09-30 11:19:19 +0000 UTC
Alternate Names: [172.18.76.239 10.0.0.1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local]
Public: /etc/kubernetes/pki/apiserver-pub.pem
Private: /etc/kubernetes/pki/apiserver-key.pem
Cert: /etc/kubernetes/pki/apiserver.pem
<master/pki> generated Service Account Signing keys:
Public: /etc/kubernetes/pki/sa-pub.pem
Private: /etc/kubernetes/pki/sa-key.pem
```

Example of `kubeadm join` command:
```
<node/csr> received signed certificate from the API server:
Issuer: CN=kubernetes | Subject: CN=system:node:minion | CA: false
Not before: 2016-09-30 11:28:00 +0000 UTC Not After: 2017-09-30 11:28:00 +0000 UTC
```

Fixes #33642
cc @kubernetes/sig-cluster-lifecycle
2016-10-01 11:31:25 -07:00
Lucas Käldström 60274778bc Set FailureTreshold to 8 for kubeadm components in order to not restart unless really necessary 2016-10-01 16:25:27 +03:00
Kubernetes Submit Queue 5a9acd9113 Merge pull request #33681 from zachaller/master
Automatic merge from submit-queue

fix kubeadm on AWS so that kube-controller has access to certs for am…

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: This fixes an issue with kubeadm not mounting ssl certs for kube-controller

**Which issue this PR fixes** : fixes #33680

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Fixes Kubeadm so kube-controller has certs for using amazon api
```
2016-09-30 23:24:56 -07:00
Evgeny L 12f8c979ba kubeadm: user-friendly certificates formatting 2016-10-01 04:57:30 +00:00
Kubernetes Submit Queue 239630ce9a Merge pull request #33644 from errordeveloper/kubeadm-remove-glog
Automatic merge from submit-queue

Remove glog added by mistake, start converting phase1+ TODOs to issues

**What this PR does / why we need it**:
Minor cleanup in `cmd/kubeadm/app/node/csr.go`.

**Release note**:
```release-note
NONE
```
2016-09-29 08:44:28 -07:00
Kubernetes Submit Queue df0ae9f67d Merge pull request #33668 from mikedanese/private-ip
Automatic merge from submit-queue

kubeadm: default to using a private range for service subnet

We are currently using a subnet that is reserved for ISPs. Private network administrators don't control this space. Default to a subnet that private network administrators do control.

@errordeveloper @kubernetes/sig-cluster-lifecycle
2016-09-28 18:49:46 -07:00
Zach Aller bd1d93e2e0 fix kubeadm on AWS so that kube-controller has access to certs for amazon api 2016-09-28 18:47:23 +00:00
Mike Danese 3c8c71e80e default to using a private range for service subnet 2016-09-28 10:01:55 -07:00
Ilya Dmitrichenko 037ef3e50c
Remove glog added by mistake, start converting phase1+ TODOs to issues 2016-09-28 10:27:53 +01:00
Kubernetes Submit Queue 1854bdcb0c Merge pull request #29048 from justinsb/volumes_nodename_not_hostname
Automatic merge from submit-queue

Use strongly-typed types.NodeName for a node name

We had another bug where we confused the hostname with the NodeName.

Also, if we want to use different values for the Node.Name (which is
an important step for making installation easier), we need to keep
better control over this.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName
2016-09-27 17:58:41 -07:00
Kubernetes Submit Queue cf7301f16c Merge pull request #33564 from oz123/fix_typo
Automatic merge from submit-queue

Fix typo fialed->failed

Just a tiny fix .
2016-09-27 10:06:54 -07:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Oz N Tiram ae5d5867ab Fix typo fialed->failed 2016-09-27 16:38:01 +02:00
Evgeny L 8f586d916e Kubeadm: fix SELinux rules for kubernetes discovery service 2016-09-27 13:24:29 +00:00
Luke Marsden 3a4613d3b2 fix https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/33262/kubernetes-pull-verify-all/15586/ 2016-09-26 09:13:09 +01:00
Lucas Käldström 51573860fa Update CHANGELOG and gofmt 2016-09-26 09:13:09 +01:00
Lucas Käldström b17e107def Various improvements plus added a version command 2016-09-25 22:38:39 +03:00
Ilya Dmitrichenko a023085a5f
Address comments in review 2016-09-24 17:28:34 +01:00
Ilya Dmitrichenko d0e29789b0
Fix sorting of linted packages and gofmt 2016-09-24 14:46:43 +01:00
Lucas Käldström 37dab80173
Make the Kubernetes control plane version configurable 2016-09-24 14:46:42 +01:00
Atanas Mirchev 5862ea6f38
Fix boostrap token encoding bug during master init
Currently the boostrap fails when a token is provided by the user
on `master init` and works when the token is generated. This is
because of a mismatch of how the token string in the kube-discovery
secret is encoded.
2016-09-24 14:46:42 +01:00
Evgeny L 0a68bb05ea
Rename flag `--schedule-workload` to `--schedule-pods-here` for kubeadm init 2016-09-24 14:46:41 +01:00
Atanas Mirchev ab3b2d579f
Fix package / struct naming after core refactoring. 2016-09-24 14:46:41 +01:00
Devan Goodwin 832d83efaa
Allow etcd container to work with selinux. 2016-09-24 14:46:40 +01:00
Ilya Dmitrichenko 0f05ccb019
Cleanup some low-hanging fruits and review TODOs 2016-09-24 14:46:40 +01:00
Atanas Mirchev 9eeae34581
Add node CIDR allocation as an option to kubeadm.
This is useful for users who are used to deploying with a flannel
overlay network.
2016-09-24 14:46:40 +01:00
Luke Marsden 38b53e31f3
Before declaring success, require that the discovery deployment has at least one active pod. 2016-09-24 14:46:39 +01:00
Paulo Pires 389cb2c7cd
Add support for external and optionally secured etcd cluster. 2016-09-24 14:46:39 +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
Lucas Käldström cab23e202e
Various improvements for kubeadm. Removed the user command, as it's too little time for implementing that. Now it's possible to use multiple arches. 2016-09-24 14:46:37 +01:00
Evgeny L a2a807b50d
Mount etcd data directory to host 2016-09-24 14:46:36 +01:00
Ilya Dmitrichenko b9fd31ff7e
Refactoring improtant parts and start on docs 2016-09-24 14:46:35 +01:00
Lucas Käldström 26c4f593aa
Cleanup/refactor some things, make it possible to use individual images, hide unused flags 2016-09-24 14:46:34 +01:00
Ilya Dmitrichenko b48df06aba
Refactor kube-dns addon constructors, more labels
- also add another IP to SANs
- fix mkdir calls
- add TODO for ComponentConfig
- start tagging TODOs by phases
2016-09-24 14:46:34 +01:00
Paulo Pires 9e4fc59d39
Added DNS add-on. 2016-09-24 14:46:34 +01:00
Ilya Dmitrichenko 1c132fe974
Address comments in review
- start cleaning up `cmd/manual.go`
- refine progress and error messages
- add missing blank lines after the license headers
- run `gofmt -s -w`
- do not set fake cloud provider
- add a note on why we cannot remove `HostNetwork: true` from `kube-discovery` pod just yet
- taint master and use `role=master`, set tolerations and affinity for `kube-discovery`
- parametrise log-level flag for all components
2016-09-24 14:46:33 +01:00
Ilya Dmitrichenko f223d814da
Initial version of kubeadm 2016-09-24 14:46:24 +01:00