Commit Graph

1688 Commits (11b25366bc7bfe2ad273c8bf9c332fd9d233bffc)

Author SHA1 Message Date
Kubernetes Submit Queue a552ee61a0 Merge pull request #46672 from smarterclayton/initializer_with_config
Automatic merge from submit-queue (batch tested with PRs 46967, 46992, 43338, 46717, 46672)

Select initializers from the dynamic configuration

Continues #36721

kubernetes/features#209
2017-06-05 20:27:50 -07:00
Fabiano Franz 39e5812848 Update generated 2017-06-05 20:32:30 -03:00
Clayton Coleman 772ab8e1b4
Load initializers from dynamic config
Handle failure cases on startup gracefully to avoid causing cascading
errors and poor initialization in other components. Initial errors from
config load cause the initializer to pause and hold requests. Return
typed errors to better communicate failures to clients.

Add code to handle two specific cases - admin wants to bypass
initialization defaulting, and mirror pods (which want to bypass
initialization because the kubelet owns their lifecycle).
2017-06-05 19:12:41 -04:00
Clayton Coleman 034f06d7e4
Remove Initializers from federation 2017-06-05 19:12:36 -04:00
Torin Sandall 470e99c6a5 federation: Add admission controller for policy-based placement 2017-06-05 07:58:59 -07:00
Kubernetes Submit Queue 6236522738 Merge pull request #46498 from zjj2wry/adherence
Automatic merge from submit-queue (batch tested with PRs 45871, 46498, 46729, 46144, 46804)

Fix some comments in dnsprovider

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

**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
NONE
```
2017-06-05 03:06:22 -07:00
Łukasz Oleś 6e6c903a04 Add NodeInternalIP as a fallback to federation api-server nodeport service 2017-06-05 11:28:05 +02:00
Madhusudan.C.S c3d5113365 Delete cluster role and their bindings federated clusters.
This is part of the namespace deletion big hammer. `kubefed join` not
just creates federation-system namespace, but also cluster role and
cluster role bindings in the joining clusters. Sometimes unjoin fails
to delete them. So we use a big hammer here to delete them.

This smells like a real problem in kubefed and needs investigation.
This is a short term fix to unblock the submit queue.
2017-06-04 21:26:44 -07:00
Madhusudan.C.S c30afde32e Delete federation system namespace from all the federated clusters.
This is a big hammer. `kubefed join` creates federation-system namespace
in the joining clusters if they don't already exist. This namespace
usually exists in the host cluster and hence cannot be deleted while
unjoining. So in order to be safe, we don't delete the federation-system
namespace from any federated cluster while unjoining them. This causes
a problem in our test environment if certain resources are left in the
namespace. Therefore we are deleting all federation-system namespace in
all the clusters.
2017-06-04 21:26:42 -07:00
Madhusudan.C.S 60d10e9e27 Do not delete PVs with --all, instead delete them selectively.
PV is a non-namespaced resource. Running `kubectl delete pv --all`, even
with `--namespace` is going to delete all the PVs in the cluster. This
is a dangerous operation and should not be deleted this way.

Instead we now retrieve the PVs bound to the PVCs in the namespace we
are deleteing and delete only those PVs.

Fixes issue #46380.
2017-06-04 14:57:43 -07:00
Kubernetes Submit Queue dbd1503b65 Merge pull request #45924 from janetkuo/daemonset-history
Automatic merge from submit-queue

Implement Daemonset history

~Depends on #45867 (the 1st commit, ignore it when reviewing)~ (already merged)

Ref https://github.com/kubernetes/community/pull/527/ and https://github.com/kubernetes/community/pull/594

@kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews @erictune @kow3ns @lukaszo @kargakis 

---

TODOs:
- [x] API changes
  - [x] (maybe) Remove rollback subresource if we decide to do client-side rollback 
- [x] deployment controller 
  - [x] controller revision
    - [x] owner ref (claim & adoption)
    - [x] history reconstruct (put revision number, hash collision avoidance)
    - [x] de-dup history and relabel pods
    - [x] compare ds template with history 
  - [x] hash labels (put it in controller revision, pods, and maybe deployment)
  - [x] clean up old history 
  - [x] Rename status.uniquifier when we reach consensus in #44774 
- [x] e2e tests 
- [x] unit tests 
  - [x] daemoncontroller_test.go 
  - [x] update_test.go 
  - [x] ~(maybe) storage_test.go // if we do server side rollback~

kubectl part is in #46144

--- 

**Release note**:

```release-note
```
2017-06-03 16:52:38 -07:00
Tim Hockin be987b015c Merge pull request #46716 from thockin/proxy-comments
Kube-proxy cleanups
2017-06-03 15:57:17 -07:00
Kubernetes Submit Queue 445795186d Merge pull request #46483 from shashidharatd/fed-sc-ut-delete
Automatic merge from submit-queue (batch tested with PRs 36721, 46483, 45500, 46724, 46036)

Federation: Minor corrections in service controller and add a unit testcase

**What this PR does / why we need it**:
This PR fixes few outdated comments in federation service controller and few other minor fixes.
This also adds a unit test case to test federated service deletion.


/assign @quinton-hoole 
/cc @marun @kubernetes/sig-federation-pr-reviews 

```release-note
NONE
```
2017-06-03 08:08:38 -07:00
Kubernetes Submit Queue 07f85565a2 Merge pull request #36721 from smarterclayton/initializers
Automatic merge from submit-queue

Add initializer support to admission and uninitialized filtering to rest storage

Initializers are the opposite of finalizers - they allow API clients to react to object creation and populate fields prior to other clients seeing them.

High level description:

1. Add `metadata.initializers` field to all objects
2. By default, filter objects with > 0 initializers from LIST and WATCH to preserve legacy client behavior (known as partially-initialized objects)
3. Add an admission controller that populates .initializer values per type, and denies mutation of initializers except by certain privilege levels (you must have the `initialize` verb on a resource)
4. Allow partially-initialized objects to be viewed via LIST and WATCH for initializer types
5. When creating objects, the object is "held" by the server until the initializers list is empty
6. Allow some creators to bypass initialization (set initializers to `[]`), or to have the result returned immediately when the object is created.

The code here should be backwards compatible for all clients because they do not see partially initialized objects unless they GET the resource directly. The watch cache makes checking for partially initialized objects cheap. Some reflectors may need to change to ask for partially-initialized objects.

```release-note
Kubernetes resources, when the `Initializers` admission controller is enabled, can be initialized (defaulting or other additive functions) by other agents in the system prior to those resources being visible to other clients.  An initialized resource is not visible to clients unless they request (for get, list, or watch) to see uninitialized resources with the `?includeUninitialized=true` query parameter.  Once the initializers have completed the resource is then visible.  Clients must have the the ability to perform the `initialize` action on a resource in order to modify it prior to initialization being completed.
```
2017-06-03 07:16:52 -07:00
Irfan Ur Rehman bc9852fca4 [Federation][Kubefed] Support documentation for kubefed and its sub commands 2017-06-03 17:11:36 +05:30
Janet Kuo 4e6f70ff67 Autogen: run hack/update-all.sh 2017-06-03 00:43:53 -07:00
Kubernetes Submit Queue 348bf1e032 Merge pull request #46627 from deads2k/api-12-labels
Automatic merge from submit-queue (batch tested with PRs 46239, 46627, 46346, 46388, 46524)

move labels to components which own the APIs

During the apimachinery split in 1.6, we accidentally moved several label APIs into apimachinery.  They don't belong there, since the individual APIs are not general machinery concerns, but instead are the concern of particular components: most commonly the kubelet.  This pull moves the labels into their owning components and out of API machinery.

@kubernetes/sig-api-machinery-misc @kubernetes/api-reviewers @kubernetes/api-approvers 
@derekwaynecarr  since most of these are related to the kubelet
2017-06-02 23:37:38 -07:00
Clayton Coleman 4ce3907639
Add Initializers to all admission control paths by default 2017-06-02 22:09:04 -04:00
Clayton Coleman 2568a92119
Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
Clayton Coleman 331eea67d8
Allow initialization of resources
Add support for creating resources that are not immediately visible to
naive clients, but must first be initialized by one or more privileged
cluster agents. These controllers can mark the object as initialized,
allowing others to see them.

Permission to override initialization defaults or modify an initializing
object is limited per resource to a virtual subresource "RESOURCE/initialize"
via RBAC.

Initialization is currently alpha.
2017-06-02 22:09:03 -04:00
Kubernetes Submit Queue 77710c41bb Merge pull request #45563 from perotinus/rssyncconversion
Automatic merge from submit-queue (batch tested with PRs 46801, 45184, 45930, 46192, 45563)

[Federation] Add a SchedulingAdapter that can extend the FederatedTypeAdapter and that provides hooks for scheduling objects into clusters.

**Release note**:
```release-note
NONE
```
2017-06-02 18:06:00 -07:00
Jordan Liggitt 24c50a7df7
Regenerate openapi for 1.8 2017-06-02 11:07:37 -04:00
zhengjiajin 6bc2d4257b fix some err message 2017-06-02 18:33:05 +08:00
Tim Hockin fc34a9d6ba 'Global' -> 'Cluster' for traffic policy 2017-06-01 16:17:38 -07:00
Kubernetes Submit Queue f7a1f10275 Merge pull request #45919 from ericchiang/audit-webhook-backend
Automatic merge from submit-queue

apiserver: add a webhook implementation of the audit backend

This builds off of #45315 and is intended to implement an interfaced defined in #45766.

TODO:

- [x] Rebase on top of API types PR.
- [x] Rebase on top of API types updates (#46065)
- [x] Rebase on top of feature flag (#46009)
- [x] Rebase on top of audit instrumentation.
- [x] Hook up API server flag or register plugin (depending on #45766)

Features issue https://github.com/kubernetes/features/issues/22

Design proposal https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auditing.md

```release-notes
Webhook added to the API server which omits structured audit log events.
```

/cc @soltysh @timstclair @soltysh @deads2k
2017-06-01 13:41:59 -07:00
Kubernetes Submit Queue 14a1cdd208 Merge pull request #44785 from jingxu97/April/apistorage
Automatic merge from submit-queue

Add Local Storage Capacity Isolation API

This PR adds the new APIs to support storage capacity isolation as
described in the proposal [https://github.com/kubernetes/community/pull/306](url)

1. Add SizeLimit for emptyDir volume
2. Add scratch and overlay storage type used by container level or
node level


**Release note**:

```release-note
Alpha feature: Local volume Storage Capacity Isolation allows users to set storage limit to isolate EmptyDir volumes, container storage overlay, and also supports allocatable storage for shared root file system. 
```
2017-06-01 09:12:19 -07:00
Konstantinos Tsakalozos e78699558b Do not retunr svc in case of error. Rename apiServerNodePortPort. 2017-06-01 16:31:01 +03:00
Kubernetes Submit Queue 3e1d68624e Merge pull request #46323 from marun/fed-kubefed-beta-storage-class-annotation
Automatic merge from submit-queue (batch tested with PRs 46686, 45049, 46323, 45708, 46487)

[Federation][kubefed]: Use StorageClassName for etcd pvc

This PR updates kubefed to use the StorageClassName field [added in 1.6](http://blog.kubernetes.io/2017/03/dynamic-provisioning-and-storage-classes-kubernetes.html
) for etcd's pvc to allow the user to specify which storage class they want to use.  If no value is provided to ``kubefed init``, the field will not be set, and initialization of the pvc may fail on a cluster without a default storage class configured.

The alpha annotation that was previously used (``volume.alpha.kubernetes.io/storage-class``) was deprecated as of 1.4 according to the following blog post:

http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html

**Release note**:

```
'kubefed init' has been updated to support specification of the storage class (via --etcd-pv-storage-class) for the Persistent Volume Claim (PVC) used for etcd storage.  If --etcd-pv-storage-class is not specified, the default storage class configured for the cluster will be used.
```

cc: @kubernetes/sig-federation-pr-reviews
2017-06-01 03:42:07 -07:00
shashidharatd b4ddf4720d Auto generated files 2017-06-01 06:14:56 +05:30
shashidharatd 296fe66bf7 Add federated service delete unit testcase 2017-06-01 06:14:55 +05:30
shashidharatd be0d7f0aeb Add RegisterFakeOnDelete to test federation object deletion 2017-06-01 06:14:55 +05:30
shashidharatd 80ceb5b3d6 Some minor corrections in service controller 2017-06-01 06:14:55 +05:30
Jing Xu 695f7be697 generated files 2017-05-31 13:06:39 -07:00
Eric Chiang a88e0187f9 apiserver: add a webhook implementation of the audit backend 2017-05-31 09:45:23 -07:00
deads2k 954eb3ceb9 move labels to components which own the APIs 2017-05-31 10:32:06 -04:00
Kubernetes Submit Queue 9c7b59778c Merge pull request #46394 from alexandercampbell/write-help-messages-to-stdout
Automatic merge from submit-queue (batch tested with PRs 46394, 46650, 46436, 46673, 46212)

Write "kubectl options" help message to stdout, not stderr

Fix a very minor issue causing `kubectl` to write its help messages to `stderr` instead of `stdout`.

Try this:

`kubectl options | grep log`

It should print only the options related to logging, but right now it prints the entire help menu (since it's printing to stderr).

This patch brings us closer to unix convention and reduces user friction.

~~Another use case (if a user can't remember whether it's `-r` or `-R` for recursion):~~

~~`kubectl patch -h | grep recursive`~~

Update: this patch only affects `kubectl options`. The other commands are working as intended.

**Release note**:

```release-note
NONE
```
2017-05-31 00:14:00 -07:00
Kubernetes Submit Queue e97b72296f Merge pull request #46556 from mbohlool/gvk
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Use meta.v1 GroupVersionKind with json tags to generate OpenAPI spec

We are using two different GVK struct in generation of OpenAPI extensions. This PR unify that and also add json tags to meta.v1 GVK to comply with json naming system in other serializations. Also the value of Action extension is now lowercase.

ref: https://github.com/kubernetes/kubernetes/pull/46388
2017-05-30 23:20:04 -07:00
Kubernetes Submit Queue 8c1f45953b Merge pull request #46431 from zjj2wry/rollback-rollback
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

Fix api description in swagger

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

**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
 NONE
```
2017-05-30 14:57:05 -07:00
mbohlool fcb9290062 Generated spec 2017-05-30 14:43:27 -07:00
Jonathan MacMillan 1130b368eb [Federation] Add a SchedulingAdapter that can extend the FederatedTypeAdapter and that provides hooks for scheduling objects into clusters. 2017-05-30 12:08:53 -07:00
Kubernetes Submit Queue cb201802a1 Merge pull request #46459 from p0lyn0mial/move_admission_lifecycle_to_genericapi
Automatic merge from submit-queue (batch tested with PRs 46552, 46608, 46390, 46605, 46459)

Move admission lifecycle to genericapi

**What this PR does / why we need it**:  ends the whole sequence of moving some admission plugins to generic api.


**Release note**:

```release-note
NONE
```
2017-05-30 08:42:02 -07:00
Kubernetes Submit Queue cd2e304360 Merge pull request #45534 from YuPengZTE/devPodStatus
Automatic merge from submit-queue (batch tested with PRs 45534, 37212, 46613, 46350)

check err

Signed-off-by: yupengzte <yu.peng36@zte.com.cn>



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

**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
```
2017-05-30 04:45:59 -07:00
p0lyn0mial 77eb2f3950 register all generic admission plugins when AdmissionOptions are created.
lifecycle plugin: make use of the libraries under k8s.io/client-go/pkg/api and k8s.io/client-go/kubernetes
for the client libraries instead of k8s.io/kubernetes/client/*

move registration to AdmissionOptions
2017-05-29 22:08:59 +02:00
Kubernetes Submit Queue 66a1d07ef4 Merge pull request #46407 from liggitt/namespace-delete-collection
Automatic merge from submit-queue (batch tested with PRs 46407, 46457)

Remove deletecollection support from namespace object

Namespace storage accidentally picked up deletecollection support from embedding the generic store. If invoked, it skips the custom namespace `Delete()` storage method that enforces finalization, and skips the namespace lifecycle admission plugin that protects immortal namespaces from deletion.

Given the data integrity implications of skipping namespace finalization, I'd backport this as far as we're releasing patch releases.

```release-note
The namespace API object no longer supports the deletecollection operation.
```
2017-05-28 13:16:54 -07:00
Alexander Campbell 0d65d9594c cmd/options: `kubectl options` writes to `out` stream
Previous behavior was to write to stderr (thanks to the fallback system
in the Cobra library), which made it difficult to grep for flags.

For example:

	kubectl options | grep recursive
2017-05-28 11:23:44 -07:00
Kubernetes Submit Queue c2667203e4 Merge pull request #45859 from DirectXMan12/refactor/protobuf-for-metrics
Automatic merge from submit-queue

Protobuf generation for k8s.io/metrics

This PR introduces protobuf generation for k8s.io/metrics.  Doing so required:

- fixing a bug in `go-to-protobuf` causing the `cast{key,value,type}` values to not be quoted when coming from struct tags (and not auto-injection by `go-to-protobuf` itself).
- Making sure the proto IDL in k8s.io/client-go had a package name of `k8s.io.client_go.xyz` and not `k8s.io.kubernetes.xyz`.

Additionally, I updated `go-to-protobuf` to skip functions and non-public types when composing the import list, which cuts down on the more bizarre imports in the IDL (like importing the sample API package in every IDL file because it contained `addToScheme`, like every other API package).

We use `castvalue` to force gogo-proto to realize that it should consider the value of the map which underlies `ResourceList` when calculating which imports need to be named.  Otherwise, it ignores the value's type, leading to compilation errors when it later can't find an import it assumed existed.  We accidentally didn't hit this in `k8s.io/kubernetes/pkg/api/v1` since another field coincidentally happens to directly use `resource.Quantity` (the value type of `ResourceList`).

**Release note**:
```release-note
NONE
```
2017-05-27 14:08:46 -07:00
Solly Ross 8d03536d00 Regenerate protobuf and client-go
This commit regenerates the protobuf as per the recent generation
changes (removing erroneous imports, adding k8s.io/metrics), and
syncs the changes to client-go (which also ensures that client-go
protobuf IDL has the correct package names).
2017-05-27 00:37:49 -04:00
Kubernetes Submit Queue f8c90e04cd Merge pull request #46252 from perotinus/cs
Automatic merge from submit-queue (batch tested with PRs 46252, 45524, 46236, 46277, 46522)

[Federation] Refactor the cluster selection logic in the sync controller

This is intended to make it easier to define the interaction between cluster selection and scheduling preferences in the sync controller when used for workload types.

**Release note**:

```release-note
NONE
```
2017-05-26 19:47:56 -07:00
Kubernetes Submit Queue b30ed6d7b8 Merge pull request #46019 from YuPengZTE/devAnalysePods
Automatic merge from submit-queue (batch tested with PRs 46450, 46272, 46453, 46019, 46367)

check err

Signed-off-by: yupengzte <yu.peng36@zte.com.cn>



**What this PR does / why we need it**:
When the err in not nil, the podStatus is nil, it is dangerous "podStatus[cluster.Name].RunningAndReady".
**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
```
2017-05-26 18:49:02 -07:00
Kubernetes Submit Queue 63857a35ba Merge pull request #46453 from emaildanwilson/fedClusterSelectorIngress
Automatic merge from submit-queue (batch tested with PRs 46450, 46272, 46453, 46019, 46367)

Add ClusterSelector to Ingress Controller

This pull request adds ClusterSelector to the Federated Ingress Controller ref: design #29887 
This back ports the same functionality from the sync controller (merged pull #40234) in order to make this feature available across all Controllers for the 1.7 release.

cc: @kubernetes/sig-federation-pr-reviews @shashidharatd

**Release note**:
```
The annotation `federation.alpha.kubernetes.io/cluster-selector` can be used with Ingress objects to target federated clusters by label.
```
2017-05-26 18:49:00 -07:00
Kubernetes Submit Queue 3be6879bde Merge pull request #46440 from deads2k/crd-03-invert
Automatic merge from submit-queue (batch tested with PRs 42256, 46479, 45436, 46440, 46417)

move CRD behind TPR

Second attempt at https://github.com/kubernetes/kubernetes/pull/46297

@liggitt since @sttts is out can you take a look and hopefully find me a different, more sane way to do this? It's a little crazy, but I left a large comment explaining why I think its the only way.
2017-05-26 15:59:03 -07:00
deads2k 18177e2bde move CRD behind TPR 2017-05-26 12:15:13 -04:00
Kubernetes Submit Queue d10c9975dc Merge pull request #46118 from shashidharatd/federation-dns-controller
Automatic merge from submit-queue

[Federation] Move service dns controller to its own package

This PR does nothing but just moves service dns controller code to its own package.

**Release note**:
```release-note
NONE
```
cc @kubernetes/sig-federation-pr-reviews 
/assign @marun
2017-05-26 09:11:00 -07:00
Kubernetes Submit Queue 9ecf57e39c Merge pull request #46288 from henriquetruta/fix_typo_test
Automatic merge from submit-queue

Fix typo in test_helper

`CompareObjectMeta` is comparting Name attribute, but
logging Namespace. Looks like a copy/paste error.
2017-05-26 08:12:05 -07:00
zhengjiajin 60c3152c56 fix api description in swagger 2017-05-26 20:37:10 +08:00
zhengjiajin f5af345de2 Fix some comments in dnsprovider 2017-05-26 18:53:11 +08:00
shashidharatd 8ef48a93d7 Auto generated files 2017-05-26 12:40:09 +05:30
shashidharatd 62b203fc3c Move service dns controller to its own package 2017-05-26 12:39:14 +05:30
Kubernetes Submit Queue f006dcc9e1 Merge pull request #45492 from matt-potter/multizone-dns-fed
Automatic merge from submit-queue (batch tested with PRs 46429, 46308, 46395, 45867, 45492)

deduplicate endpoints before DNS registration

**What this PR does / why we need it**: Multizone clusters will return duplicated endpoints to the federation controller manager. The FCM will then attempt to create an A record with duplicate entries, which will fail. As a result, federated services on multi-AZ clusters don't work right now. This PR deduplicates the endpoint IPs before attempting the DNS record registration. 

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

**Special notes for your reviewer**:
I believe there is a lot of refactoring required with multizone federated clusters, most notably with regard to AWS and optimising for ALIAS records rather than A, but this PR will at least allow basic functionality to work.

```release-note NONE
```
2017-05-25 22:42:11 -07:00
emaildanwilson 0a2b4742f5 Add ClusterSelector to Ingress Controller
fix log messages
2017-05-25 13:10:18 -07:00
Maru Newby 2c886e93e9 kubefed: Use StoraceClassName class field for etcd pvc 2017-05-25 10:21:08 -07:00
Kubernetes Submit Queue 9a33db8a4f Merge pull request #46248 from emaildanwilson/fedClusterSelectorServices
Automatic merge from submit-queue (batch tested with PRs 44774, 46266, 46248, 46403, 46430)

[Federation] ClusterSelector for Service Controller

This pull request adds ClusterSelector to the Federated Service Controller ref: design #29887 This back ports the same functionality from the sync controller (merged pull #40234).

cc: @nikhiljindal @marun
2017-05-25 06:17:58 -07:00
Kubernetes Submit Queue 26d7ee0447 Merge pull request #44774 from kargakis/uniquifier
Automatic merge from submit-queue

Switch Deployments to new hashing algo w/ collision avoidance mechanism

Implements https://github.com/kubernetes/community/pull/477

@kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews 

Fixes https://github.com/kubernetes/kubernetes/issues/29735
Fixes https://github.com/kubernetes/kubernetes/issues/43948

```release-note
Deployments are updated to use (1) a more stable hashing algorithm (fnv) than the previous one (adler) and (2) a hashing collision avoidance mechanism that will ensure new rollouts will not block on hashing collisions anymore.
```
2017-05-25 06:09:58 -07:00
Henrique Truta 06b634d616 Fix typo in test_helper
`CompareObjectMeta` is comparting Name attribute, but
logging Namespace. Looks like a copy/paste error.
2017-05-25 10:07:10 -03:00
Michail Kargakis 9190a47c37
Generated changes for collision count
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 12:23:17 +02:00
Jordan Liggitt 664fe6e5c2
Generated changes 2017-05-25 00:17:08 -04:00
Jonathan MacMillan 748ea1109d [Federation] Uniquify the ClusterRole and ClusterRoleBinding names created by . 2017-05-24 12:04:16 -07:00
Jonathan MacMillan b5c6af7b42 [Federation] Refactor the cluster selection logic in the sync controller.
This is intended to make it easier to define the interaction between cluster selection and scheduling preferences in the sync controller when used for workload types.
2017-05-24 11:06:53 -07:00
emaildanwilson c68bf0b260 add ClusterSelector to services 2017-05-24 09:57:04 -07:00
Matt Potter 76a95e8ce8 refactor to remove loop / use sets.String{} 2017-05-24 13:57:08 +01:00
Kubernetes Submit Queue f30443cacc Merge pull request #42042 from perotinus/svcaccounts
Automatic merge from submit-queue (batch tested with PRs 42042, 46139, 46126, 46258, 46312)

[Federation] Use service accounts instead of the user's credentials when accessing joined clusters' API servers.

Fixes #41267.

Release notes:
```release-note
Modifies kubefed to create and the federation controller manager to use credentials associated with a service account rather than the user's credentials.
```
2017-05-23 19:42:57 -07:00
Kubernetes Submit Queue 95a6f108bd Merge pull request #46289 from p0lyn0mial/admission_plugins_remove_init_blocks
Automatic merge from submit-queue

remove init blocks from all admission plugins

**What this PR does / why we need it**:
removes init blocks from all admission plugins

**Release note**:

```release-note
NONE
```
2017-05-23 17:00:59 -07:00
p0lyn0mial c5019bf696 remove init blocks from all admission plugins 2017-05-23 22:00:32 +02:00
Konstantinos Tsakalozos 462b8d87cc Check uper limit of port and ensure 0 corresponds to random port 2017-05-23 16:15:49 +03:00
Konstantinos Tsakalozos 1ffcba7d83 Adding option to set the federation api server port if nodeport is set 2017-05-23 14:00:47 +03:00
Matt Potter 743cc5d685 autogen BUILD file 2017-05-23 11:37:48 +01:00
Matt Potter ae102d64c4 refactor to use sets.String 2017-05-23 11:37:48 +01:00
Matt Potter b8c0314861 deduplicate endpoints before DNS registration 2017-05-23 11:37:48 +01:00
Kubernetes Submit Queue 455e9fff09 Merge pull request #46176 from vmware/vSphereStoragePolicySupport
Automatic merge from submit-queue

vSphere storage policy support for dynamic volume provisioning

Till now, vSphere cloud provider provides support to configure persistent volume with VSAN storage capabilities - kubernetes#42974. Right now this only works with VSAN.

Also there might be other use cases:

- The user might need a way to configure a policy on other datastores like VMFS, NFS etc.
- Use Storage IO control, VMCrypt policies for a persistent disk.

We can achieve about 2 use cases by using existing storage policies which are already created on vCenter using the Storage Policy Based Management service. The user will specify the SPBM policy ID as part of dynamic provisioning 

- resultant persistent volume will have the policy configured with it. 
- The persistent volume will be created on the compatible datastore that satisfies the storage policy requirements. 
- If there are multiple compatible datastores, the datastore with the max free space would be chosen by default.
- If the user specifies the datastore along with the storage policy ID, the volume will created on this datastore if its compatible. In case if the user specified datastore is incompatible, it would error out the reasons for incompatibility to the user.
- Also, the user will be able to see the associations of persistent volume object with the policy on the vCenter once the volume is attached to the node.

For instance in the below example, the volume will created on a compatible datastore with max free space that satisfies the "Gold" storage policy requirements.

```
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
       name: fast
provisioner: kubernetes.io/vsphere-volume
parameters:
      diskformat: zeroedthick
      storagepolicyName: Gold
```

For instance in the below example, the vSphere CP checks if "VSANDatastore" is compatible with "Gold" storage policy requirements. If yes, volume will be provisioned on "VSANDatastore" else it will error that "VSANDatastore" is not compatible with the exact reason for failure.

```
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
       name: fast
provisioner: kubernetes.io/vsphere-volume
parameters:
      diskformat: zeroedthick
      storagepolicyName: Gold
      datastore: VSANDatastore
```

As a part of this change, 4 commits have been added to this PR.

1. Vendor changes for vmware/govmomi
2. Changes to the VsphereVirtualDiskVolumeSource in the Kubernetes API. Added 2 additional fields StoragePolicyName, StoragePolicyID
3. Swagger and Open spec API changes.
4. vSphere Cloud Provider changes to implement the storage policy support.

**Release note**:


```release-note
vSphere cloud provider: vSphere Storage policy Support for dynamic volume provisioning
```
2017-05-22 23:41:10 -07:00
Balu Dontu 668fa94ccb Open API and swagger spec changes 2017-05-22 19:45:02 -07:00
Maru Newby 080d1081d0 fed: Add support for etcd image override to kubefed init 2017-05-22 15:16:41 -07:00
Kubernetes Submit Queue 06c12e717a Merge pull request #46071 from emaildanwilson/fedClusterSelectorIntegration
Automatic merge from submit-queue

[Federation] ClusterSelector Integration Testing

This pull request adds integration testing for the federated ClusterSelector ref: design #29887 merged pull #40234

cc: @nikhiljindal @marun
2017-05-21 23:18:44 -07:00
Kubernetes Submit Queue 95ce463e95 Merge pull request #46020 from marun/fed-override-server-image-default
Automatic merge from submit-queue

[Federation][kubefed]: Move server image definition to cmd

This enables consumers like openshift to provide a different default without editing the kubefed init logic.

cc: @kubernetes/sig-federation-pr-reviews
2017-05-20 14:30:55 -07:00
Kubernetes Submit Queue 4f55f49035 Merge pull request #46042 from derekwaynecarr/quota-admission-registry
Automatic merge from submit-queue (batch tested with PRs 45346, 45903, 45958, 46042, 45975)

ResourceQuota admission control injects registry

**What this PR does / why we need it**:
The `ResourceQuota` admission controller works with a registry that maps a GroupKind to an Evaluator.  The registry used in the existing plug-in is not injectable, which makes usage of the ResourceQuota plug-in in other API server contexts difficult.  This PR updates the code to support late injection of the registry via a plug-in initializer.
2017-05-19 22:29:34 -07:00
Kubernetes Submit Queue 113cf85612 Merge pull request #45903 from brendandburns/azure-disk-api
Automatic merge from submit-queue (batch tested with PRs 45346, 45903, 45958, 46042, 45975)

Azure disk api

This is to update the AzureDiskApi and split it from the implementation which is caught in rebase hell...

Once this is merged, we'll get the implementation in.

@smarterclayton suggested this as a way to break the rebase hell logjam. request for a quick review.

Thanks!
2017-05-19 22:29:30 -07:00
Jonathan MacMillan af2a8f7e8a [Federation] Use service accounts instead of the user's credentials when accessing joined clusters' API servers. 2017-05-19 18:05:09 -07:00
emaildanwilson 2cef454fd3 fed cluster selector integration test
updates from review
2017-05-19 13:47:52 -07:00
Shashidhara T D 40c32b02d7 Revert "[Federation] Fix federated service reconcilation issue due to addition of External…" 2017-05-19 18:29:07 +05:30
Kubernetes Submit Queue 57adadd42a Merge pull request #46063 from madhusudancs/fed-kubefed-logv4
Automatic merge from submit-queue

Log kubefed operations at log level 4 in our test environments.

This is useful for debugging test failures that involve federation control plane turn up/down.


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

/assign @perotinus @csbell 
/sig federation

cc @kubernetes/sig-federation-pr-reviews
2017-05-18 21:48:39 -07:00
Brendan Burns 97f6c52ffd more stuff. 2017-05-18 20:31:10 -07:00
Derek Carr a71bea312a ResourceQuota admission control injects registry 2017-05-18 23:17:13 -04:00
Kubernetes Submit Queue c061994742 Merge pull request #46056 from marun/fed-federated-updater-deletion-error
Automatic merge from submit-queue (batch tested with PRs 41535, 45985, 45929, 45948, 46056)

[Federation] Fix bad logic of deletion error handling for federated updater

Reverts a change accidentally added in #45364.

cc: @kubernetes/sig-federation-pr-reviews
2017-05-18 19:58:17 -07:00
Madhusudan.C.S 47de152365 Log kubefed operations at log level 4 in our test environments.
This is useful for debugging test failures that involve federation
control plane turn up/down.
2017-05-18 16:57:46 -07:00
Maru Newby b4381d0c44 fed: Move kubefed server image definition to cmd
This enables consumers like openshift to provide a different default
without editing the kubefed init logic.
2017-05-18 14:25:44 -07:00
Maru Newby 37cb9c4dc2 fed: Fix bad logic of deletion error handling for federated updater 2017-05-18 14:21:55 -07:00
Brendan Burns 83e856411d generated stuff 2017-05-18 11:38:56 -07:00
Clayton Coleman bdd4d34c7d
generated: api changes 2017-05-18 10:07:47 -04:00
yupengzte 443228d8c4 check err
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
2017-05-18 15:46:39 +08:00
Kubernetes Submit Queue ca75521199 Merge pull request #40234 from emaildanwilson/fedTargetClusterByLabel
Automatic merge from submit-queue (batch tested with PRs 40234, 45885, 42975)

Fed target cluster by label for sync controller

[use clusterselector w/ federated configmap deploys](667dc77444)

**What this PR does / why we need it**: adds the ability to indicate objects are sent to subsets of federated clusters ref #29887 

**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
```
2017-05-17 20:27:49 -07:00
Kubernetes Submit Queue 8710f6e62d Merge pull request #45745 from marun/fed-test-cluster-addition
Automatic merge from submit-queue (batch tested with PRs 45990, 45544, 45745, 45742, 45678)

[Federation]  Add integration testing for cluster addition

This PR adds integration testing of the sync controller for cluster addition.  This ensures coverage equivalency between the integration tests and the old controller unit tests, so those tests are removed by this PR.

Resolves #45257

cc: @kubernetes/sig-federation-pr-reviews
2017-05-17 18:40:54 -07:00
Wilson, Dan 32787c5258 use clusterselector w/ federated configmap deploys
fix test error formatting

updates from comments

update gofmt

simplify tests

add to new sync controller

add tests

remove configmap changes due to rebase

updates from review

refactor tests to be based on operations

improvements from review

updates from rebase

rebase to #45374

updates from review

refactor SendToCluster for tests

fix import order

rebase to upstream
2017-05-17 13:48:57 -07:00
Kubernetes Submit Queue 799283f2e7 Merge pull request #45941 from cblecker/gengo
Automatic merge from submit-queue (batch tested with PRs 45852, 45965, 45941)

Update k8s.io/gengo dependency

**What this PR does / why we need it**:
Brings in changes to improve type checker and deep copy

**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
NONE
```
2017-05-17 12:32:51 -07:00
Maru Newby ee5dbf103e fed: Remove redundant unit tests
The equivalent coverage is provided by integration tests.
2017-05-17 07:17:47 -07:00
Maru Newby 578f17c668 fed: Add integration testing for cluster addition 2017-05-17 05:04:35 -07:00
Kubernetes Submit Queue a45a1ef28f Merge pull request #42895 from shashidharatd/coredns-2
Automatic merge from submit-queue (batch tested with PRs 42895, 45940)

[Federation] Automate configuring nameserver in cluster-dns for CoreDNS provider

Addresses issue #42894 #42822

**Release note**:
```
[Federation] CoreDNS server will be automatically added to nameserver resolv.conf chain When using CoreDNS as dns provider for federation during federation join.
```
cc @madhusudancs @kubernetes/sig-federation-bugs
2017-05-17 03:22:49 -07:00
Christoph Blecker 4361a9146e
Update generated files 2017-05-17 00:59:52 -07:00
Kubernetes Submit Queue b8f084a6c5 Merge pull request #45034 from shashidharatd/federation-service-controller-3
Automatic merge from submit-queue (batch tested with PRs 45247, 45810, 45034, 45898, 45899)

[Federation] Segregate DNS related code to separate controller

**What this PR does / why we need it**:
This is the continuation of service controller re-factor work as outlined in #41253
This PR segregates DNS related code from service controller to another controller `service-dns controller` which manages the DNS records on the configured DNS provider.
`service-dns controller` monitors the federated services for the ingress annotations and create/update/delete DNS records accordingly.
`service-dns controller` can be optionally disabled and DNS record management could be done by third party components by monitoring the ingress annotations on federated services. (This would enable something like federation middleware for CoreDNS where federation api server could be used as a backend to CoreDNS eliminating the need for etcd storage.)

**Special notes for your reviewer**:

**Release note**:
```
Federation: A new controller for managing DNS records is introduced which can be optionally disabled to enable third party components to manage DNS records for federated services.
```
cc @kubernetes/sig-federation-pr-reviews
2017-05-16 19:01:59 -07:00
Kubernetes Submit Queue 3f0ebbe884 Merge pull request #45247 from mbohlool/c3
Automatic merge from submit-queue (batch tested with PRs 45247, 45810, 45034, 45898, 45899)

Apiregistration v1alpha1→v1beta1

Promoting apiregistration api from v1alpha1 to v1beta1.

API Registration is responsible for registering an API `Group`/`Version` with
another kubernetes like API server. The `APIService` holds information
about the other API server in `APIServiceSpec` type as well as general
`TypeMeta` and `ObjectMeta`. The `APIServiceSpec` type have the main
configuration needed to do the aggregation. Any request coming for
specified `Group`/`Version` will be directed to the service defined by
`ServiceReference` (on port 443) after validating the target using provided
`CABundle` or skipping validation if development flag `InsecureSkipTLSVerify`
is set. `Priority` is controlling the order of this API group in the overall
discovery document.
The return status is a set of conditions for this aggregation. Currently
there is only one condition named "Available", if true, it means the
api/server requests will be redirected to specified API server.

```release-note
API Registration is now in beta.
```
2017-05-16 19:01:55 -07:00
Kubernetes Submit Queue 2c2c92659a Merge pull request #44474 from ahmetb/fix-types-links
Automatic merge from submit-queue (batch tested with PRs 45374, 44537, 45739, 44474, 45888)

Update 'More info' links on API types and fields

> **Please just review the first commit, the rest is generated files.**

Recent docs website shuffling during 1.6 caused majority of links in the API
types and fields to break. Since we do not have server-side 301 redirects, user
has to click an extra link, and the #target fragment in the URL will be lost.  (This is
because GitHub’s redirect_from feature is not ideal.) 

For the time being, I have manually gone through all of them to bring them up to date
and add HTTPS to those missing it. This is a docs-only change and impacts generated
code, generated swaggers, API reference docs etc.

cc: @steveperry-53 @devin-donnelly @chenopis fyi, docs links changes (even small title changes) easily breaks links in API reference, Swagger, kubectl explain, and many other places.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-16 18:11:04 -07:00
Kubernetes Submit Queue 0e73596141 Merge pull request #45374 from marun/fed-refactor-sync-controller
Automatic merge from submit-queue (batch tested with PRs 45374, 44537, 45739, 44474, 45888)

[Federation] Refactor sync controller's reconcile method for maintainability

This PR refactors the sync controllers reconcile method for maintainability with the goal of eliminating the need for type-specific controller unit tests.  The unit test coverage for reconcile is not complete, but I think it's a good start.

cc: @kubernetes/sig-federation-pr-reviews
2017-05-16 18:10:53 -07:00
Kubernetes Submit Queue 8ef6857881 Merge pull request #44403 from pmichali/issue44351
Automatic merge from submit-queue (batch tested with PRs 45860, 45119, 44525, 45625, 44403)

coredns: support IPv6 record set

Added support for AAAA record for coredns and included unit test.
Refactored common test code to reduce duplication from added test and
existing tests.
Fixed function names in comments for Google and AWS tests to match
actual test name in this area.



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

Adding IPv6 support to kubernetes, once piece at a time. :)

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

**Special notes for your reviewer**:
In addition to the change and unit test method, I did some minor refactoring (since the UT was a near clone of an existing test). Fixed typos in related test methods' comment lines. Please let me know if this is OK (I was thinking it was a small change, but don't know the protocol here), or if I need to break it into multiple commits.

**Release note**:

```NONE
```
2017-05-16 16:14:57 -07:00
Kubernetes Submit Queue 31cb269d4c Merge pull request #44525 from irfanurrehman/fed-common-preferences
Automatic merge from submit-queue (batch tested with PRs 45860, 45119, 44525, 45625, 44403)

[Federation] Move annotations and related parsing code as common code

This PR moves some code, which was duplicate, around as common code.
Changes the names of structures used for annotations to common names.
s/FederatedReplicaSetPreferences/ReplicaAllocationPreferences/
s/ClusterReplicaSetPreferences/PerClusterPreferences/
This can be reused in job controller and hpa controller code.

**Special notes for your reviewer**:
@kubernetes/sig-federation-misc 

**Release note**:

```NONE
```
2017-05-16 16:14:54 -07:00
Kubernetes Submit Queue ece4124e17 Merge pull request #45355 from p0lyn0mial/admission_options_spits_out_admission_control
Automatic merge from submit-queue (batch tested with PRs 45408, 45355, 45528)

Admission options spits out admission control

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

This PR adds ApplyTo method to AdmissionOptions struct. The method creates and initialises admission control to the server configuration.

**Release note**:

```
NONE
```
2017-05-16 09:11:54 -07:00
Paul Michali 8d9e90cccf coredns: support IPv6 record set
Added support for AAAA record for coredns and included unit test.

Fixed function names in comments for Google and AWS tests to match
actual test name in this area.
2017-05-16 15:51:18 +00:00
shashidharatd 005e11bfb3 Auto-generated bazel build file 2017-05-16 19:55:49 +05:30
shashidharatd 2ba7c8e1e6 Add stubDomains to kube-dns configmap for private nameserver 2017-05-16 19:55:49 +05:30
shashidharatd c1070166a8 Add coredns-endpoints to CoreDNS provider config 2017-05-16 18:56:23 +05:30
shashidharatd c9454f81cf Auto generated bazel build file 2017-05-16 09:20:44 +05:30
shashidharatd d0ef025455 Segregate DNS related code to separate controller 2017-05-16 09:20:44 +05:30
mbohlool 103c1bfc1e Update generated files 2017-05-15 15:34:33 -07:00
Ahmet Alp Balkan e1e8095ea7
Generated files (update-federation-api-reference-docs.sh)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-15 15:30:28 -07:00
p0lyn0mial 7b0950b298 bazel update 2017-05-16 00:18:38 +02:00
Ahmet Alp Balkan 7d7b5fe2af
Generated files (update-federation-swagger-spec.sh)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-15 15:12:00 -07:00
Ahmet Alp Balkan bc4c561c67
Generated files (update-federation-generated-swagger-docs.sh)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-15 15:00:19 -07:00
Ahmet Alp Balkan 455baadc40
Autogenerated files
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-15 14:15:30 -07:00
Ahmet Alp Balkan 893280d3e4
Update 'More info' links on API types and fields
Recent docs website shuffling during 1.6 caused majority of links in the API
types and fields to break. Since we do not have server-side 301 redirects, user
has to click an extra link and the #target segment in the URL will be lost.

I have manually gone through all of them to bring them up to date and add HTTPS
to those missing it.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-15 13:32:25 -07:00
Kubernetes Submit Queue a4307eb7a2 Merge pull request #45600 from nikhiljindal/waitForDel
Automatic merge from submit-queue (batch tested with PRs 41331, 45591, 45600, 45176, 45658)

Updating generic registry to return UID of the deleted resource

Ref https://github.com/kubernetes/kubernetes/issues/42594

cc @kubernetes/sig-api-machinery-pr-reviews @smarterclayton 

```release-note
Updating apiserver to return UID of the deleted resource. Clients can use this UID to verify that the resource was deleted or waiting for finalizers.
```
2017-05-15 13:25:47 -07:00
Maru Newby b7bc39f5b6 fed: Update sync controller to use runtime.HandleError 2017-05-15 13:07:47 -07:00
Kubernetes Submit Queue f038c5494e Merge pull request #45798 from shashidharatd/federated-service
Automatic merge from submit-queue

[Federation] Fix federated service reconcilation issue due to addition of External…

…TrafficPolicy field to v1.Service

**What this PR does / why we need it**:
New fields (ExternalTrafficPolicy) are introduced to v1.Service by this PR #41162. If this field is not specified in service spec, the service controller will assign default and updates the service spec.
In federation, the service spec is not updated and we continuously try to reconcile as the federated service and the service in federated cluster do not match.

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


**Special notes for your reviewer**:

**Release note**:
```
NONE
```

cc @kubernetes/sig-federation-bugs @madhusudancs
2017-05-15 00:47:17 -07:00
nikhiljindal 4c828eeaab Autogenerated swagger changes 2017-05-14 23:11:02 -07:00
shashidharatd d22527522f Fix federated service reconcilation issue due to addition of ExternalTrafficPolicy field to v1.Service 2017-05-15 10:30:51 +05:30
nikhiljindal 49b6899232 Autogenerated changes from update-federation-api-reference-docs.sh 2017-05-14 17:20:24 -07:00
nikhiljindal 283e820596 Autogenerated changes from update-federation-swagger-spec.sh 2017-05-14 17:20:23 -07:00
p0lyn0mial 8cea69aa98 This PR implements AdmissionOptions.ApplyTo
ApplyTo adds the admission chain to the server configuration the method lazily initializes a generic plugin
that is appended to the list of pluginInitializers.

apiserver.Config will hold an instance of SharedInformerFactory to ensure we only have once instance.
The field will be initialized in apisever.SecureServingOptions
2017-05-14 10:30:19 +02:00
Kubernetes Submit Queue 35eba22cc7 Merge pull request #41162 from MrHohn/esipp-ga
Automatic merge from submit-queue (batch tested with PRs 45623, 45241, 45460, 41162)

Promotes Source IP preservation for Virtual IPs from Beta to GA

Fixes #33625. Feature issue: kubernetes/features#27.

Bullet points:
- Declare 2 fields (ExternalTraffic and HealthCheckNodePort) that mirror the ESIPP annotations.
- ESIPP alpha annotations will be ignored.
- Existing ESIPP beta annotations will still be fully supported.
- Allow promoting beta annotations to first class fields or reversely.
- Disallow setting invalid ExternalTraffic and HealthCheckNodePort on services. Default ExternalTraffic field for nodePort or loadBalancer type service to "Global" if not set.

**Release note**:

```release-note
Promotes Source IP preservation for Virtual IPs to GA.

Two api fields are defined correspondingly:
- Service.Spec.ExternalTrafficPolicy <- 'service.beta.kubernetes.io/external-traffic' annotation.
- Service.Spec.HealthCheckNodePort <- 'service.beta.kubernetes.io/healthcheck-nodeport' annotation.
```
2017-05-12 15:00:46 -07:00
Zihong Zheng 12b6c2b879 Autogenerated files 2017-05-12 10:59:00 -07:00
Maru Newby 23b2cee8de fed: Further refactor of sync controller reconcile
This change breaks out non-delete cluster updates into a method for
testability.
2017-05-12 08:26:43 -07:00
Maru Newby 547ece5b83 fed: Refactor sync controller's reconcile method 2017-05-12 08:25:54 -07:00
Maru Newby cf71a8ef11 fed: Factor annotation mutation out of the crudtester for reuse 2017-05-12 08:25:54 -07:00
Irfan Ur Rehman de2544d5c3 [Federation] Move annotations and related parsing code as common code 2017-05-12 18:22:37 +05:30
Kubernetes Submit Queue 7b0dee89f2 Merge pull request #44984 from perotinus/rssync
Automatic merge from submit-queue (batch tested with PRs 45684, 45266, 45669, 44787, 44984)

[Federation] Unify the delivery methods in the ReplicaSet controller.

Unifies the federated and non-federated object delivery methods. The reconcile method that's called already checks for existence, and no other controller has a similar paradigm, so it seems reasonable to simplify it here.

cc @marun

**Release note**:
```release-note
NONE
```
2017-05-12 03:20:45 -07:00
Kubernetes Submit Queue d437703d27 Merge pull request #44787 from mbohlool/c1
Automatic merge from submit-queue (batch tested with PRs 45684, 45266, 45669, 44787, 44984)

Add GroupVersionKind extension to OpenAPI operations

Fixes: #43249
ref: #34254

```release-note
Added Group/Version/Kind and Action extension to OpenAPI Operations 
```
2017-05-12 03:20:42 -07:00
Jonathan MacMillan ab101c9c74 [Federation] Unify the delivery methods in the ReplicaSet controller. 2017-05-11 15:31:39 -07:00
Kubernetes Submit Queue 15df7fedca Merge pull request #44626 from madhusudancs/fed-dns-paged-list
Automatic merge from submit-queue (batch tested with PRs 44626, 45641)

Update Google Cloud DNS provider Rrset.Get(name) method to return a list and change the `Rrset.List()` implementation to perform a paged walk

Some federated service e2e tests and a few ingress tests would become flaky after a few hundred runs. @csbell spent quite a lot of time debugging this and found out that this flakiness was due to a bug in the federated service controller deletion logic. Deletion of a federated service object triggers a logic in the controller to update the DNS records corresponding to that object. This DNS record update logic would return an error in failed runs which would in-turn cause the controller to reschedule the operation. This led to an infinite retry-failure cycle that never gave the API server a chance to garbage collect the deleted service object.

A couple of days ago we started seeing a correlation between the number of resource records in a DNS managed zone and these test failures. If you look at the test runs before and after run 2900 in the test grid - https://k8s-testgrid.appspot.com/cluster-federation#gce, you will notice that the grid became super green at 2900. That's when I deleted all the dangling DNS records from the past runs.

After some investigation yesterday, we found that `ResourceRecordSet.Get()` interface and its implementation, and `ResourceRecordSet.List()` implementation at least for Google Cloud DNS were incorrect.

This PR makes minimal set of changes (read: least invasive) in Google Cloud DNS provider implementation to fix these problems:

1. Modifies DNS provider Rrset.Get(name) interface to return multiple records and updates federated service controller.

    There can be multiple DNS resource records for a given name. They can vary by type, ttl, rrdata and a number of various other parameters. It is incorrect to return a single resource record for a given name.

    This change updates the Get interface to return multiple records for a given name and uses this list in the federated service controller to perform DNS operations.

2. Update Google Cloud DNS List implementation to perform a paged walk of lists to aggregate all the DNS records.

    The current `List()` implementation just lists the DNS resorce records in a given managed zone once and retruns the list. It neither performs a paged walk nor does it consider the `page_token` in the returned response.

    This change walks all the pages and aggregates the records in the pages and returns the aggregated list. This is potentially dangerous as it can blow up memory if there are a huge number of records in the given managed zone. But this is the best we can do without changing the provider interface too much. 

    Next step is to define a new paged list interface and implement it.

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

/assign @csbell 

cc @justinsb @shashidharatd @quinton-hoole @kubernetes/sig-federation-pr-reviews
2017-05-11 03:59:35 -07:00
Madhusudan.C.S 4bde13ac62 Remove all the existing records before creating new ones to avoid DNS misconfiguration.
When we fetch the dns records by name, we get a list of records that match
the given name. As an optimization we look up to see if the new record we
want to create is already in the returned list to avoid performing any updates.

However, when the new record we want to create isn't in the returned list, it
is hard to say if the returned list contains the list of records that we want
to retain. For example, we might get a list of A records and we want to create
a CNAME record. Creating a new CNAME record without removing the A records is
a DNS misconfiguration. So to play safe we just remove all the existing records
in the list and create the new desired record.

**Note**: This is the opposite of what I said here - https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/44626#-Ki9xQOzybryHvsxNrra.
2017-05-11 00:47:11 -07:00
Kubernetes Submit Queue c2f6ccf0ef Merge pull request #45256 from perotinus/rs_noindexer
Automatic merge from submit-queue (batch tested with PRs 45556, 45561, 45256)

[Federation] Replace the indexing lister with a regular store in the replicaset controller

This is part of the refactoring work to allow the replicaset controller to use the generic sync controller.

None of the other controllers use a lister, including the deployment controller

**Release note**:
```release-note
NONE
```
2017-05-10 22:24:43 -07:00
Kubernetes Submit Queue b8186966b4 Merge pull request #45382 from marun/fed-updater-timeout-per-instance
Automatic merge from submit-queue (batch tested with PRs 45382, 45384, 44781, 45333, 45543)

[Federation] Provide updater timeout to instance rather than to Update()

This PR changes the federated updater to receive its timeout at construction rather than on every call to Update().  This provides a slight decrease in coupling by removing the need for the deletion handler to be provided the timeout along with the updater.

cc: @kubernetes/sig-federation-pr-reviews @perotinus
2017-05-10 17:47:39 -07:00
Kubernetes Submit Queue 57c72a46ea Merge pull request #42296 from perotinus/kubefedlogs-update
Automatic merge from submit-queue

[Federation] Improve the logging and user feedback in 'kubefed init'

This is a follow-up to #41849, which added some status information. This PR is based off of that one, and includes its changes as well.

See #41725.

```release-note
None
```
2017-05-10 13:41:00 -07:00
Jonathan MacMillan 6f6955819f [Federation] Replace the indexing store with a regular store in the replicaset controller. 2017-05-10 11:37:05 -07:00
Maru Newby 3f2dab896c fed: Provide updater timeout to instance rather than to Update() 2017-05-10 09:18:37 -07:00
Madhusudan.C.S 20e558060c Address review comments. 2017-05-10 00:03:42 -07:00
Madhusudan.C.S e0ca8abba8 Update Google Cloud DNS List implementation to perform a paged walk of lists to aggregate all the DNS records.
The current `List()` implementation just lists the DNS resorce records in
a given managed zone once and retruns the list. It neither performs a paged
walk nor does it consider the `page_token` in the returned response.

This change walks all the pages and aggregates the records in the pages
and returns the aggregated list. This is potentially dangerous as it can
blow up memory if there are a huge number of records in the given
managed zone. But this is the best we can do without changing the
provider interface too much. Next step is to define a new paged list
interface and implement it.
2017-05-10 00:03:42 -07:00
Madhusudan.C.S 704d13bfc8 Modify the DNS provider Rrset.Get(name) interface to return multiple records and update federated service controller.
There can be multiple DNS resource records for a given name. They can
vary by type, ttl, rrdata and a number of various other parameters. It
is incorrect to return a single resource record for a given name.

This change updates the Get interface to return multiple records for a given
name and uses this list in the federated service controller to perform
DNS operations.
2017-05-10 00:03:41 -07:00
Jonathan MacMillan 0f851bfa2e [Federation] Improve the logging and user feedback in 'kubefed init'. 2017-05-09 16:06:37 -07:00
Jonathan MacMillan 6856dad472 [Federation] Add a worker queue to the generic sync controller. 2017-05-09 15:40:42 -07:00
yupengzte 32a3c1fe84 check err
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
2017-05-09 19:45:44 +08:00
deads2k 4389f71576 refactor names for the apiserver handling chain 2017-05-08 07:55:31 -04:00
zhangxiaoyu-zidif a76c4cee7e federation:update outdated link 2017-05-08 09:07:40 +08:00
mbohlool 9e51f18635 Update OpenAPI spec 2017-05-05 18:46:50 -07:00
Kubernetes Submit Queue 17d33ea82e Merge pull request #44830 from NickrenREN/remove-NodeLegacyHostIP
Automatic merge from submit-queue

Remove deprecated NodeLegacyHostIP

**Release note**:
```release-note
Remove deprecated node address type `NodeLegacyHostIP`.
```

ref #44807
2017-05-05 15:38:58 -07:00
Kubernetes Submit Queue 8f9216a76f Merge pull request #45218 from NickrenREN/fed-useragent
Automatic merge from submit-queue

Keep UserAgentName style consistent

Keep using UserAgentName for controllers  and add some logs for debugging

**Release note**:

```release-note
NONE
```
2017-05-05 00:49:32 -07:00
NickrenREN 7922f568bf Add ConcurrentDeploymentSyncs to avoid reuse ConcurrentDeploymentSyncs and keep UserAgentName var style consistent
Add some logs for debugging and add concurrent-deployment-syncs flag
2017-05-05 10:19:38 +08:00
Kubernetes Submit Queue b3beeff9c2 Merge pull request #45364 from marun/fed-record-events-in-updater
Automatic merge from submit-queue

[Federation] Record events in federated updater

Controllers for federated types were previously recording events when generating the list of operations.  This change delegates responsibility for recording events to the federated updater so that events are recorded when the operations are actually executed, and ensures consistency across recording of both operation initiation and failure.  

The deletion helper was similarly updated to rely on the federated updater for event recording.  To support this change to the deletion helper, controllers have been updated to provide a namespace qualified name via the objNameFunc function to ensure that the updater can record events for deletions with the same detail as for add and update operations.

cc: @kubernetes/sig-federation-pr-reviews @perotinus
2017-05-04 16:27:15 -07:00
Kubernetes Submit Queue d22a9c2599 Merge pull request #45321 from caesarxuchao/remove-GetGVK
Automatic merge from submit-queue (batch tested with PRs 45362, 45159, 45321, 45238)

Remove redundent GetObjectKind() defined on types

Embedding TypeMeta is enough.
2017-05-04 13:25:05 -07:00
Maru Newby 00ea2eb1cb fed: Make federated updater responsible for recording events 2017-05-04 12:14:10 -07:00
Chao Xu 5f5a70f65f generated clientset changes
propagate to client-go
update-bazel.sh
2017-05-04 11:30:51 -07:00
Chao Xu 47b410f58b Remove redundent GetObjectKind() defined on top-level types
TypeMeta is embedded in all these types and TypeMeta has GetObjectKind()
method to implement the runtime.Object interface.
2017-05-04 10:31:58 -07:00
Maru Newby fd4ff0caa5 fed: Fix deletion helper to use namespace-qualified object names 2017-05-04 07:53:17 -07:00
Kubernetes Submit Queue 99af041604 Merge pull request #45248 from ixdy/docker-bundle-rule
Automatic merge from submit-queue (batch tested with PRs 45283, 45289, 45248, 44295)

Use docker_bundle rule from new rules_docker repo

**What this PR does / why we need it**: switched to using the new `docker_bundle` rule from `rules_docker` instead of my patched `docker_build` rule. This also brings in some fixes for the docker rules that were missing from my fork.

Additionally, I switched out the `git_repository` rules for `http_archive` rules, since that seems to be recommended by the bazel docs (and might be faster). 

Lastly, I updated the `pkg_tar` rules to use my patch, which doesn't prepend `./` to files inside the tarballs.
This one should likely be merged upstream in the near future.

I think this is the last of the changes necessary to have `bazel run //:ci-artifacts` working properly to support using bazel for e2e in CI.

**Release note**:

```release-note
NONE
```
2017-05-03 12:07:58 -07:00
Jeff Grafton e231d4280b Replace git_repository with http_archive and use ixdy's fork of bazel tools for pkg_tar 2017-05-03 10:13:06 -07:00
Kubernetes Submit Queue fc51574bb4 Merge pull request #44913 from zhangxiaoyu-zidif/cleancode-util-for-err
Automatic merge from submit-queue

cleancode:util.go

cleancode, the modification point make code clean and light
2017-05-02 17:03:26 -07:00
Kubernetes Submit Queue 7f2011c160 Merge pull request #45225 from FengyunPan/update-event-type
Automatic merge from submit-queue (batch tested with PRs 40544, 44338, 45225)

[Federation]Update event type

Use EventTypeWarning instead of EventTypeNormal when get failure
Left behind after pr #40296
2017-05-02 13:03:59 -07:00
Kubernetes Submit Queue 72a469f3ac Merge pull request #40544 from henriquetruta/broken-podspec-link
Automatic merge from submit-queue

Fixes broken link in PodSpec

The PodSpec reference to NodeSelector misses
the `.md` extension in the file.



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

**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
```
2017-05-02 12:45:48 -07:00
Kubernetes Submit Queue 0487d38771 Merge pull request #42513 from perotinus/generatedsecrets
Automatic merge from submit-queue (batch tested with PRs 45100, 45152, 42513, 44796, 45222)

[Federation] Generate the secret name in kubefed join.

Addresses part of #42324. A follow-up PR will address annotating Federation resources.

```release-note
Remove the `--secret-name` flag from `kubefed join`, instead generating the secret name arbitrarily.
```
2017-05-02 10:35:09 -07:00
Henrique Truta 4a487cbb11 Fixes broken link in PodSpec
The PodSpec reference to NodeSelector misses
 the .md extension in the file.
2017-05-02 13:33:49 -03:00
FengyunPan eb8f5d3508 [Federation]Update event type 2017-05-02 18:43:53 +08:00
FengyunPan f880e0d5ec Return clusterErr rather than err
The updateClusterIngressUIDToMasters() should return clusterErr,
not err. And do not log fallbackUID when fallbackUID is nil.
2017-05-02 12:26:33 +08:00
Kubernetes Submit Queue 8f6df26755 Merge pull request #44545 from FengyunPan/remove-GetClientsetForCluster
Automatic merge from submit-queue

Remove GetClientsetForCluster()

The newClusterClientset() has insteaded of GetClientsetForCluster(),
and GetClientsetForCluster() run wrong. Let's remove it.
2017-05-01 20:39:47 -07:00
Jonathan MacMillan 77e71a890e [Federation] Generate the secret name in kubefed join. 2017-05-01 14:05:23 -07:00
Kubernetes Submit Queue 70f6f13323 Merge pull request #44988 from zhangxiaoyu-zidif/update-readme-links
Automatic merge from submit-queue

README.md: Update outdated links

**What this PR does / why we need it**:
the PR aims to update some links.
Some links with "#" would not redirect to right point of pages.
Other links without "#" can work, but they are outdated. I change them by the way.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
none
2017-04-30 20:34:52 -07:00
Kubernetes Submit Queue 9bce5f01c8 Merge pull request #44483 from FengyunPan/ignore-notFound2
Automatic merge from submit-queue

Ignore IsNotFound error

IsNotFound error is fine since that means the object is
deleted already, so we should check err and ignore err
before returning.
2017-04-30 01:49:10 -07:00
Ricky Pai a76ada8d5a generated files 2017-04-28 22:55:47 -07:00
Kubernetes Submit Queue 55f802b72a Merge pull request #44196 from xiangpengzhao/cmd-cleanup
Automatic merge from submit-queue

Delete "hard-coded" default value in flags usage.

**What this PR does / why we need it**:
Some flags of kubernetes components have "hard-coded" default values in their usage info. In fact, [pflag pkg](https://github.com/kubernetes/kubernetes/blob/master/vendor/github.com/spf13/pflag/flag.go#L602-L608) has already added a string `(default value)` automatically in the usage info if the flag is initialized. Then we don't need to hard-code the default value in usage info. After this PR, if we want to update the default value of a flag, we only need to update the flag where it is initialized. `pflag` will update the usage info for us. This will avoid inconsistency.

For example:
Before
```
kubelet -h
...
--node-status-update-frequency duration                   Specifies how often kubelet posts node status to master. Note: be cautious when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller. Default: 10s (default 10s)
...
```

After
```
kubelet -h
...
--node-status-update-frequency duration                   Specifies how often kubelet posts node status to master. Note: be cautious when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller. (default 10s)
...
```

**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**:
This PR doesn't delete some "hard-coded" default values because they are not explicitly initialized. We still need to hard-code them to give users friendly info.

```
--allow-privileged                                        If true, allow containers to request privileged mode. [default=false]
```

**Release note**:

```release-note
None
```
2017-04-28 21:28:09 -07:00
deads2k afc5ae1539 generated 2017-04-28 11:28:37 -04:00
Kubernetes Submit Queue b2d714a7ca Merge pull request #44888 from caesarxuchao/clean-deepcopy-init
Automatic merge from submit-queue

Prepare for move zz_generated_deepcopy.go to k8s.io/api

This is in preparation to move deep copies to with the types to the types repo (see https://github.com/kubernetes/gengo/pull/47#issuecomment-296855818). The init() function is referring the `SchemeBuilder` defined in the register.go in the same packge, so we need to revert the dependency.

This PR depends on https://github.com/kubernetes/gengo/pull/49, otherwise verification will fail.
2017-04-27 18:48:28 -07:00
Chao Xu d0b94538b9 make it possible to move SchemeBuilder with zz_generated.deepcopy.go 2017-04-27 16:57:29 -07:00
Kubernetes Submit Queue a984a7ed09 Merge pull request #44980 from csbell/sync-daemonset
Automatic merge from submit-queue (batch tested with PRs 42740, 44980, 45039, 41627, 45044)

[Federation] Convert Daemonset to use the generic sync controller

To be rebased on master when @perotinus's configmaps PR merges.

Tested integration and e2e.
2017-04-27 13:27:02 -07:00
Christian Bell 15e81959e9 [Federation] Convert Daemonset to use the generic sync controller 2017-04-27 08:07:33 -07:00
FengyunPan 7d4c66c5b5 Cleanup storeToClusterConditionLister
ClusterConditionPredicate() has been deleted,
storeToClusterConditionLister will be unused.
2017-04-27 11:51:26 +08:00
FengyunPan 2077a5ce2e Remove incorrect and unused function
The newClusterClientset() has insteaded of GetClientsetForCluster(),
and GetClientsetForCluster() run wrong. Let's remove it.
2017-04-27 09:49:59 +08:00
zhangxiaoyu-zidif 030c53f585 README.md: Update outdated links 2017-04-27 09:11:18 +08:00
shashidharatd b0f8de7303 Auto generated bazel build file 2017-04-26 22:07:21 +05:30
shashidharatd d2462c79bd Remove unused code in federation service controller 2017-04-26 22:06:09 +05:30
Kubernetes Submit Queue 2d79d53fb2 Merge pull request #41258 from shashidharatd/federation-service-controller-1
Automatic merge from submit-queue (batch tested with PRs 44942, 41258)

[Federation] Use federated informer for service controller and annotations to store lb ingress

**What this PR does / why we need it**:
This is breaking up of the PR #40296 into smaller one. please refer to #41253

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Handles 2 tasks in #41253
Fixes issues in #27623, #35827

**Special notes for your reviewer**:

**Release note**:
```
NONE
```

cc @quinton-hoole @nikhiljindal @kubernetes/sig-federation-pr-reviews
2017-04-26 08:57:38 -07:00
Kubernetes Submit Queue 2d808b5925 Merge pull request #44881 from perotinus/nofedpodstolog
Automatic merge from submit-queue (batch tested with PRs 41287, 41636, 44881, 44826)

[Federation] Only attempt to log information about pods in federation/cluster/log-dump.sh if those pods exist.

Fixes an issue where the script fails, because bash considers an empty array an unbound variable.
**Release note**:
```release-note
NONE
```
2017-04-25 17:56:43 -07:00
Kubernetes Submit Queue d03ca66367 Merge pull request #41636 from luxas/bump_go_18
Automatic merge from submit-queue (batch tested with PRs 41287, 41636, 44881, 44826)

Bump to go1.8 and remove the edge GOROOT

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

Bumps to go1.8; we get:
 - performance improvements
 - build time improvements
 - the possibility to remove the hacky edge-GOROOT for arm and ppc64le that must use go1.8
 - all other awesome features that are included in go1.8: https://golang.org/doc/go1.8

**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/kubernetes/issues/38228

**Special notes for your reviewer**:

@ixdy Please push the image ASAP so we can see if this passes all tests

**Release note**:

```release-note
Upgrade go version to v1.8
```
cc @ixdy @bradfitz @jessfraz @wojtek-t @timothysc @spxtr @thockin @smarterclayton @bprashanth @gmarek
2017-04-25 17:56:40 -07:00
Kubernetes Submit Queue d059c32cdf Merge pull request #44472 from perotinus/annotation_fixes
Automatic merge from submit-queue (batch tested with PRs 44607, 44472, 44482)

[Federation] Fix the comments on FederationNameAnnotation

Follow-up for minor issues raised in #42683

```release-note
NONE
```
2017-04-25 14:47:39 -07:00
Jonathan MacMillan 5336f2de05 [Federation] Convert ConfigMaps to use the generic sync controller. 2017-04-25 14:13:28 -07:00
Kubernetes Submit Queue 81d6fedb0b Merge pull request #44139 from nikhiljindal/delFinalizerDup
Automatic merge from submit-queue (batch tested with PRs 44583, 44139, 44753)

Federation: Removing duplicate finalizer manipulation logic in federation controllers

Ref #40989

Using apimachinery's meta accessor to manipulate objects instead of duplicating that logic in each controller.
Just a cleanup, no behavior change.

cc @kubernetes/sig-federation-pr-reviews
2017-04-25 13:52:38 -07:00
Lucas Käldström f32e6d8a89
Update protobuf 2017-04-25 23:50:31 +03:00