Commit Graph

1097 Commits

Author SHA1 Message Date
Ignacio (Nacho) Cano 27fe4e1910
Promoting Binding to v1beta1 (#1483)
* binding to v1beta1

* improving coverage
2020-07-14 08:34:19 -07:00
Victor Agababov ac02cac99b
Preallocate sets in pkg (#1485) 2020-07-14 00:09:18 -07:00
Matt Moore 906cdfd465
Remove ha.ExtractDeployment dependency. (#1484)
This was part of the review feedback, but it inadvertently introduced a dependency that redefined a flag causing the duck to crash loop.

This copies the function instead of pulling in the dependency.
2020-07-13 23:52:18 -07:00
Matt Moore 5f4f82f095
Add a new "chaosduck" e2e test tool for leaderelection. (#1333)
* Add a new "chaosduck" e2e test tool for leaderelection.

This adds a new main package under knative.dev/pkg/leaderelection/chaosduck, which
decodes the leases in the system namespace to establish the set of components and
their leader pod names and kills a leader pod for each component on a certain period.

* Incorporate feedback from vagababov

* super nit
2020-07-13 15:41:18 -07:00
Matt Moore a81727701f
Enable leader election by default. (#1476)
* Enable HA by default.

This consolidates the core of sharedmain around the new leaderelection logic, which will now be **enabled by default**.

This can now be disabled with `--disable-ha` or by passing `sharedmain.WithHADisabled(ctx)` to `sharedmain.MainWithConfig`.

* vagababov comments, build failure

* Open an issue for enabledComponents removal.

* Move the configmap watcher startup.

This race was uncovered by the chaos duck on knative/serving!  When we have enabled a feature flag, e.g. multi-container, and the webhook pods are restarted, there is a brief window where the webhook is up and healthy before the configmaps have synchronized and the new webhook pod realizes the feature is enabled.

* Drop the import alias
2020-07-13 12:43:18 -07:00
Matt Moore 100f2ab0a9
[master] Auto-update dependencies (#1480)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-07-13 09:34:18 -07:00
Matt Moore be5186c170
[master] golang format tools (#1479)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -name '*.pb.go' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-07-13 09:24:18 -07:00
Victor Agababov b09a159e12
Add BucketSet type which implements consistent bucketing (#1477)
* Add BucketSet type which implements consistent bucketing

BucketSet permits mapping keys to buckets in a consistent manner, permitting us to use this type
in the HA applications. BucketSet implements the Bucket interface so it can be used in reconciler/leaderelection
pieces and has an additional method which returns the owner for the key. This is necessary in autoscaler
where requests need to be forwarded to an appropriate autoscaler.

* git mod stuff

* fixes

* nit

* two types for two thigns

* more tests
2020-07-12 20:16:12 -07:00
Alvaro Aleman 22502028e3
Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07:00
Victor Agababov 44f55abf7a
Fun with lambdas etc (#1475)
* Fun with funcs and tests

* duplicates
2020-07-10 12:29:37 -07:00
Matt Moore a0cb3d6895
Make HA test helpers deal with sets. (#1474)
* Make HA test helpers deal with sets.

The previous helpers dealt with singleton leaders, change them to accomodate bucketing.

* vagababov feedback

* Add logging that was useful downstream debugging.
2020-07-10 09:35:19 -07:00
Kenjiro Nakayama 5c448193a9
Use TraceContextB3Egress for spoof client (#1447)
Serving's TestShouldHaveHeadersSet expects `x-b3-spanid` and
`x-b3-traceid` from client, but it was removed by 5658d93fb0.

Due to this, non-Istio ingress like Kourier and Contour started failing the conformance test:

https://testgrid.knative.dev/serving#kourier-stable&include-filter-by-regex=TestShouldHaveHeadersSet
https://testgrid.knative.dev/serving#contour-latest&include-filter-by-regex=TestShouldHaveHeadersSet

So this patch changes to use TraceContextB3Egress for spoof client.
2020-07-10 07:13:19 -07:00
Weston Haught 43f4f824e3
use quotes for checksum strings (#1472) 2020-07-09 17:33:19 -07:00
Nghia Tran f54a56a843
Update release instruction. (#1471)
* Update release instruction.

* Update RELEASING.md

Co-authored-by: Matt Moore <mattmoor@vmware.com>

* Add new step to update doc.

* Update RELEASING.md

Co-authored-by: Matt Moore <mattmoor@vmware.com>

* Update RELEASING.md

Co-authored-by: Matt Moore <mattmoor@vmware.com>

Co-authored-by: Matt Moore <mattmoor@vmware.com>
2020-07-09 15:29:07 -07:00
Victor Agababov 5bb487efae
Add example to the docs of stable selection (#1473)
This helps with docs having examples of usage
2020-07-09 13:09:55 -07:00
Victor Agababov 5358179e74
Move the hashing from the serving (#1469)
* Move the hashing from the serving

* comment

* docs

* change api to accept set
2020-07-08 10:14:47 -07:00
Nghia Tran 0a8314b444
Back to tracking master branch of floating deps (#1468) 2020-07-07 12:03:44 -07:00
Scott Nichols f397d1a271
Propagate SkipStatusUpdates to reconciler from NewReconciler (#1466) 2020-07-01 22:59:42 -07:00
Weston Haught cd84a3ec16
Update generated reconciler code with a switch (#1457)
* Update generated reconciler code with a switch

* flip

* update-codegen

* dont want to warn on equal
2020-07-01 21:31:41 -07:00
Chao Dai 5d27c7e584
Remove yt3liu from OWNERS file (#1460) 2020-07-01 21:06:41 -07:00
Scott Nichols fe2735421e
make it so codegen owners can approve prs that change codegen (#1465) 2020-07-01 13:43:42 -07:00
Nghia Tran 84f30d5d9c
Update OWNERS_ALIASES to match new TOC members (#1459)
* Update OWNERS_ALIASES to match new TOC members

* Add our vaikas back.
2020-07-01 13:33:42 -07:00
Nghia Tran 2c1a029eb9
Pin knative.dev/test-infra to release-0.16 (#1458) 2020-06-30 10:00:34 -07:00
Markus Thömmes a92c682188
Add an option to skip automated status updates in a reconciler. (#1456)
* Add an option to skip automated status updates in a reconciler.

This option is necessary to be able to create reconcilers like Serving's labeler, that is purely adding labels to resources. If that fails, the new automated observed generation handling changes the status and that gets written to the API currently, which is not desired.

* Flip the bool.
2020-06-30 08:02:29 -07:00
Dave Protasowski 65f13c6f68
bump k8s min version to 1.16.0 (#1455)
* bump k8s min version to 1.16.0

* update tests
2020-06-30 07:50:30 -07:00
Matt Moore 1a1ff4771f
[master] Auto-update dependencies (#1454)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-06-30 07:30:29 -07:00
Dave Protasowski e16ecb840d
use coordination.Leases exclusively for leader election (#1439)
* use coordination.Leases exclusively for leader election

Prior locks were for K8s version <1.16

* fix error message
2020-06-29 12:57:29 -07:00
Francesco Guardiani caecfb7585
Removed zipkin hardcoded values (#1448)
* Removed zipkin hardcoded values

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Applied suggestions

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Applied suggestions

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-06-29 10:08:29 -07:00
Victor Agababov fe0740d31f
Some cleanups around LE (#1452)
* Some cleanups around LE

- make funcs and types not expected to be used outside private (we can always make them public, should the need arise)
- add some more checks in tests
- fix some strings

* streamline

* hide new

* review

* more
2020-06-27 12:23:28 -07:00
Matt Moore 27389b2fa0
Enable use of StatefulSet in sharedmain. (#1451)
This change allows for (just webhook for now) controllers going through sharedmain to opt into Yanwei's logic by setting several environment variables.

I was able to pull this change in downstream and change the webhook to use a StatefulSet with the following environment:
```
+        # These settings are used for statefulset-based
+        # leader selection.
+        - name: CONTROLLER_ORDINAL
+          valueFrom:
+            fieldRef:
+              fieldPath: metadata.name
+        - name: STATEFUL_SERVICE_NAME
+          value: "webhook"
```

Running the above with 10 replicas and 10 buckets worked as intended (keys were evenly distributed across the replicas).
2020-06-27 09:29:28 -07:00
Weston Haught bce16cf786
remove krshapedlogic tag, this is default now (#1442) 2020-06-26 11:28:28 -07:00
Yanwei Guo f1ee372577
Introduce a StatefulSet type elector builder (#1438)
* do not record for empty metric config

* Revert "do not record for empty metric config"

This reverts commit 539a5e4dbb.

* introduce statefulset builder

* change comment

* address victors comment and capsulation

* make exported func

* Update leaderelection/ordinal_test.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* Update leaderelection/ordinal_test.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* address comment

* format

* address comment from matt

Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-06-25 19:26:28 -07:00
Victor Agababov eb05e8dd5b
Various cleanups (#1446)
Thanks @markusthoemmes for the tool :)
2020-06-24 14:04:28 -07:00
Markus Thömmes 09d5e09da8
Assorted linting fixes. (#1443) 2020-06-24 12:11:27 -07:00
Dave Protasowski c99955c477
use apiextensions v1 apis for migrator (#1445) 2020-06-24 11:28:27 -07:00
Dave Protasowski 5be32bbb99
Return TypeMeta as part of the admission response (#1444) 2020-06-24 08:54:27 -07:00
Chi Zhang e0a0d63a9e
Ingore files under benchmark folder (#1441) 2020-06-23 13:46:27 -07:00
Adam Harwayne 5658d93fb0
Add tracecontextb3 HTTPFormats (#1429)
* Add a b3tracecontext.HTTPFormat.

It will utilize either B3 or TraceContext propagation formats coming in (preferring TraceContext) and while sending both.

* hack/update-deps.sh

* PR comments.

* Move to HTTPFormatSequence.

* Remove the struct.

* Allow distinct ingress and egress formats.
2020-06-23 10:35:27 -07:00
Weston Haught aa30bc3ac0
expect resoruces are krshaped by default (#1430) 2020-06-23 10:21:27 -07:00
Murphylu1993 fb0320d928
fix typo (#1436) 2020-06-22 19:45:26 -07:00
peterfeifanchen 291e6d9f55
Fix gcs ListChildrenFiles and ListDirectChildren (#1431)
* Fix gcs ListChildrenFiles and ListDirectChildren

Previous right trim and "/" addition prevented the discovery of
top-level directories under the bucket.

* Resolve review comments
2020-06-22 15:32:26 -07:00
Victor Agababov 76b65072de
Improve manual watcher a bit (#1435)
- remove redundant checks (iterating nil/empty slice works)
- fix comments
- remove duplicate test
- map scale size fix.
2020-06-22 14:39:26 -07:00
Weston Haught 602857dcc5
add self to aliases and add reviewers to OWNERS (#1409)
* add self to aliases and add reviewers to OWNERS

* fix typo
2020-06-22 12:30:27 -07:00
Dave Protasowski 02c28cd5ff
Return TypeMeta as part of the conversion response (#1433)
This is a requirement when adopting CRD v1 APIs
2020-06-22 08:29:27 -07:00
Chi Zhang f0da4c9b6e
add --delete option for the perf-tests tool (#1432) 2020-06-22 08:06:26 -07:00
Matthias Wessendorf 98f8a949a1
adding constant for annotation (#1424)
* 💄 adding constant for label

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Update apis/duck/register.go

Co-authored-by: Antoine Cotten <hello@acotten.com>

* Update apis/duck/register.go

Co-authored-by: Antoine Cotten <hello@acotten.com>

Co-authored-by: Antoine Cotten <hello@acotten.com>
2020-06-22 06:58:26 -07:00
Matt Moore 5e60b6f863
Implement the fourth wave of per-reconciler leaderelection. (#1304)
With this, all downstream `// +genreconciler` reconcilers will become leader-aware and expose a model for the typed reconcilers they wrap to themselves become leader-aware.

Detailed design: https://docs.google.com/document/d/1i_QHjQO2T3SNv49xjZLWlivcc0UvZN1Tbw2NKxThkyM/edit#
Issue: https://github.com/knative/pkg/issues/1181
2020-06-21 18:58:26 -07:00
Weston Haught bfb5907813
Fix gen-reconciler stub - remove TODOs (#1425)
* fix examples

* keep for non krshaped

* fix codegen
2020-06-19 14:43:25 -07:00
Matt Moore b6a13e2894
Implement the third wave of per-reconciler leaderelection. (#1303)
This lets downstream components enable leaderelection on `WebhookMain*`-based components.

Detailed design: https://docs.google.com/document/d/1i_QHjQO2T3SNv49xjZLWlivcc0UvZN1Tbw2NKxThkyM/edit#
Issue: https://github.com/knative/pkg/issues/1181
2020-06-19 11:26:25 -07:00
Matt Moore bfc0cee945
Implement the second wave of per-reconciler leaderelection (#1302)
* Implement the second wave of per-reconciler leaderelection.

Detailed design: https://docs.google.com/document/d/1i_QHjQO2T3SNv49xjZLWlivcc0UvZN1Tbw2NKxThkyM/edit#
Issue: https://github.com/knative/pkg/issues/1181

* incorporate vagababov feedback

* Improve controller.go coverage
2020-06-19 09:47:25 -07:00