Commit Graph

95 Commits

Author SHA1 Message Date
Stavros Kontopoulos da5e7fd7b3
Bump cert-manager and use their clientset (#15703)
* use cert-manager clientset

* fix

* fix gengo incomp

* lint

* fix remaining lint issues

* Revert "fix remaining lint issues"

This reverts commit 82b465cfa15b54c33d8cd08c6e1b4c79e252ee77.

* Revert "lint"

This reverts commit 0334fc2591ce80ddaed8d61f54cfb74cdf905835.

* vendor
2025-01-21 01:27:09 +00:00
Stavros Kontopoulos 8cf5aba69d
Set controller reconcillers to the correct number in tests (#15290)
* Maybe fix controller ha

* fixes
2024-06-03 17:54:22 +00:00
Stavros Kontopoulos 6ccb82f47c
Integrate net-certmanager in Serving (#15066)
* integrate net-certmanager in Serving

* Revert "disable kourier-tls (#15053)"

This reverts commit 8bda840b1a.

* fix imports

* add netcert conformance tests

* fix vendor

* add vendor networking test files

* some fixes + rebase

* fixes

* add crd check

* sym link

* fix vendor

* move reconciler

* fix style

* empty

* move to pkg/client
2024-04-25 19:36:46 +00:00
Dave Protasowski e47ffe3ed3
drop vendor licenses (#15050) 2024-03-28 17:01:05 +00:00
Reto Lehmann 0bae8a2722
implement cluster-local-domain-tls in serving (#14610)
* use Knative certificates for Serving encryption

* Make namespace the owner of the Queue-Proxy certificate

* Lint error fixes

* Minor fixes

* cherry-pick https://github.com/knative/serving/pull/14706

* keep existing secret in upgrade/downgrade tests

* Rebase and update to upstream/main

* Review improvements

* Update net-istio

* Use a revision tracker to reconcile on KCerts
2024-01-25 21:38:40 +00:00
Stavros Kontopoulos fc166ac8b4
Consolidate webhooks (#14082)
* consolidate webhooks

* pass the queue name update

* merge types, clean up webhook configs

* remove unused
2023-07-07 21:02:41 +00:00
Reto Lehmann 41e421294b
Get certificate reconciler from `networking` instead of `control-protocol` (#14072) 2023-06-06 16:43:28 +00:00
Nader Ziada fd1b9ed17f
Set filtered factory label in controller main + Upgrade to latest dependencies (#13442)
* set filter label in controller main

* pick up new dependencies

* add label to secret
2022-11-08 15:22:18 +00:00
Matt Moore ed3515cb04
Fix: Raise the reconciliation timeout from 10 to 30s. (#13323)
* Fix: Raise the reconciliation timeout from 10 to 30s.

This was actually something I had asked for a fairly long time ago, which I had wanted to move into `genreconciler` to encourage folks to move "long" work off of the main reconciliation thread.  `10s` was sort of pulled out of thin air, and seemed like a good idea at the time!  However, this arbitrary choice has come back to bite me!

Investigating a rash of timeouts in the sigstore policy-controller webhook, I noticed that a great deal of requests were timing out at `10s` despite the webhook having a `25s` `timeoutSeconds`.

Breaking this down by resource kind, I found that the only resources timing out at `9-10s` were ALL deployments, where replicasets and pods had some timeouts, but almost all were at the `25s` mark.

So basically when Knative reconciles Deployments, it is setting a `10s` deadline on its outbound API requests, including Deployment updates, which pass this deadline on to downstream requests such as webhooks.

My reasoning for advocating for `30s` is not arbitrary, it is based on this being the maximum value that a webhook can have for its `timeoutSeconds` field:
https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#timeouts

This means that Knative wouldn't be artificially lowering the webhook timeout on any webhooks configured on the resources it is managing directly.

* Use the global variable

* Add flag for timeout
2022-09-25 23:20:57 +00:00
Dave Protasowski 017b9d0393
Don't included git info in our containers (#13130)
build info (vcs.revision) is now embedded in the go binary with go1.18

see: https://github.com/knative/pkg/pull/2548
2022-07-18 18:54:59 +00:00
Kenjiro Nakayama 58cce54404
Support config to deploy internal certificates automatically (#13005)
* Add certificate reconciler for internal certs

* Fix cert path

* Temporary use local networking repo

* Support internal-encryption configuration

* Use const for cert name

* Fix lint

* rm blank line

* Drop unused variable

* Use one line style

* Use one line code

* Update net-kourier nightly

bumping knative.dev/net-kourier d758682...b9b1e8b:
  > b9b1e8b Use `internal-encryption` to deploy internal certificates automatically (# 855)
  > 427434c bump kind and k8s versions in kind-e2e tests (# 859)

Signed-off-by: Knative Automation <automation@knative.team>

* Verify SecretPKKey as well

* Do not drop activator always in the path

* Comment about ctrl-ca suffix

Co-authored-by: Knative Automation <automation@knative.team>
2022-06-30 22:48:31 +00:00
Dave Protasowski 44464973c6
fix owner files after merging scaling + serving working groups (#12960) 2022-05-20 21:51:59 +00:00
Evan Anderson 238f232a34
Integrate nscert controller into the main controller (#12174)
* Consolidate serving-nscert controller into main controller.

* Fix up e2e tests

* Remove wildcard cert stuff from generate-yamls and install.

* Fix lint.

* Address nak3 feedback; remove a no-longer-needed utility program

* Clean up the rest of SERVING_NSCERT_YAML (which was an empty file).

* Remove the rest of SERVING_NSCERT_YAML
2021-10-28 17:27:51 -07:00
Evan Anderson 6396164e80
Update OWNERS_ALIASES to match autogen in community (#11103)
* Update OWNERS_ALIASES to match autogen in community

* Fixup missing/mis-named groups
2021-04-08 10:47:50 -07:00
Matt Moore 584d41b172
Enable HA by default (#8602)
* Enable HA by default

* Centralize the bucket/replica information for running the HA testing.

Add a test to ensure the count of the controller's reconciler stays in sync with the actual controller binary.
2020-07-13 14:59:18 -07:00
mjaow 526e09ed3c keep same code style with other controllers (#5316) 2019-08-28 12:42:41 -07:00
Matt Moore d9242efc72 Add refs links to enable better changeset resolution. (#5175) 2019-08-16 10:21:16 -07:00
mattmoor-sockpuppet ed6c061515 golang format tools (#5096)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign @mattmoor
2019-08-08 07:56:56 -07:00
Tara Gu a6a69f05dd Refactor garbage collection from configuration reconciler (#4876) 2019-08-07 14:41:56 -07:00
Matt Moore 303602bd6b Migrate serving to use the knative.dev/serving import path (#4521)
* Manual changes for knative.dev/serving migration

* This commit is entirely scripted via:

```
sed -i 's@github.com/knative/serving@knative.dev/serving@g' $(find -name '*.go' | xargs grep github.com/knative/serving | cut -d':' -f 1 | uniq)
sed -i 's@github.com/knative/serving@knative.dev/serving@g' $(find -name '*.yaml' | xargs grep github.com/knative/serving | cut -d':' -f 1 | uniq)
./hack/update-codegen.sh
```
2019-07-12 11:44:43 -07:00
Matt Moore 50cdf8762d Migrate to knative.dev/pkg (#4546)
These changes done via:
```
sed -i 's@"github.com/knative/pkg@"knative.dev/pkg@g' $(find -name '*.go' | grep -v vendor | xargs grep github.com/knative/pkg | cut -d':' -f 1)
```

`Gopkg.toml`:
 - github.com/knative/pkg -> knative.dev/pkg
 - release-0.7 -> master

`./hack/update-codegen.sh`:
 - github.com/knative/pkg -> knative.dev/pkg

```
./hack/update-deps.sh
./hack/update-codegen.sh
```
2019-06-26 16:10:06 -07:00
Matt Moore 391482bffc Use the injection stuff with codegen (#4233) 2019-06-07 19:46:41 -07:00
Matt Moore 298aeeab4a Remove a bunch more build stuff that we no longer need. (#4189) 2019-05-30 13:12:31 -07:00
Sergey Yedrikov 44d904514c compile-time assert numControllers == len(controllersArray) (#3924)
* compile-time assert numControllers == len(controllersArray)

* Incorporated review feedback from @grantr
2019-05-29 02:19:30 -07:00
Matt Moore 89ba6ccf11 This pulls in the changes from knative/pkg#425 (#4163)
* This pulls in the changes from knative/pkg#425

* Have the queue-proxy use metrics.Domain()
2019-05-28 16:56:30 -07:00
Zhimin Xiang cbd1614f0d Hook up Certificate and ClusterIngressTLS within Route controller (#3902)
* Hook up Certificate and ClusterIngressTLS into Route controller

* add unit tests

* fix failed e2e test

* use autoTLS feature flag to control autoTLS

* Update pkg/reconciler/route/resources/names/names.go

Co-Authored-By: ZhiminXiang <zhiminx@google.com>

* fix typo

* fix unit test

* remove certificates from routestatus

* only consider non-wildcard in the code

* fix unit test

* fix typos

* copy secret per ClusterIngress

* address comment

* mark URLs to HTTPS when certificate is ready

* address comment
2019-05-06 17:51:36 -07:00
Sergey Yedrikov 50981d4c3d Fix for https://github.com/knative/serving/issues/3913 (#3914)
[BUG] controller and networking/istio fall off main() on shutdown signal
2019-04-29 04:46:31 -07:00
Markus Thömmes 7104e95b7f Normalize Fatal(f) logging calls in main files. (#3866)
* Normalize Fatal(f) logging calls in main files.

* One more occurrence.
2019-04-24 07:08:29 -07:00
Matt Moore ee57bc225e Remove the version directory from our reconcilers. (#3840)
We had done this with an ignorance of how CRD versioning would work.  We now know this to be unnecessary and it's more typing.

This change is the result of the following commands:
```
sed -i 's@pkg/reconciler/v1alpha1@pkg/reconciler@g' $(find -name '*.go' | xargs grep 'pkg/reconciler/v1alpha1' | cut -d':' -f 1 | uniq)
git mv pkg/reconciler/v1alpha1/* pkg/reconciler/
for x in $(find pkg/reconciler -name '*.yaml'); do rm $x; ln -s -r config/$(basename $x) $x; done
```

I've also edited the paths in `hack/update-codegen.sh`.
2019-04-20 16:22:27 -07:00
Mustafa Demirhan 64b0d6cbae Flush metrics before controller and sidecar processes end. (#3823) 2019-04-18 23:04:26 -07:00
Matt Moore c2c8c0fc00 This implements "BYO Revision name". (#3562)
* This implements "BYO Revision name".

With this change, in any context where a user might specify a
`RevisionTemplateSpec`, they may now provide their own Revision name:

```yaml
kind: Configuration
metadata:
  name: config
spec:
  revisionTemplate:
    metadata:
      name: config-foo # Must have config- prefix.
    spec:
      ...
```

The intent of this is to enable GitOps scenarios which cannot be covered
well by our generated names today.  With this in the context of Service,
a new Revision may be staged via something like:

```yaml
kind: Service
metadata:
  name: svc
spec:
  release:
    revisions: [svc-2019-03-27, svc-2019-03-28]
    percent: 1
    metadata:
      name: svc-2019-03-28
    spec:
      ...
```

In the above example, once `svc-2019-03-28` is `Ready` it will
automatically begin receiving 1% of traffic.

The restrictions on BYO name are as follows:
 * The name must change (or be removed) any time the body of the
  `revisionTemplate` changes.
 * The name must be prefixed by the name of the enclosing Service
  or Configuration with a trailing `-`.
 * The name must be unique across the namespace (the above is intended
  to help with this, and preserve some of the self-documenting nature
  of the prefix, but it doesn't guarantee collision avoidance).

* Relax the collision validation to allow spec equivalence.

This change is inspired by a use case that arose in a slack
conversation around `git revert` with GitOps.

The example is the following is committed:

```yaml
spec:
  template:
    metadata:
      name: mattmoor-foo
    spec:
      A
```

Then the following update is committed:

```yaml
spec:
  template:
    metadata:
      name: mattmoor-bar
    spec:
      B
```

Then a problem is discovered with the above and a `git revert`
is done to the prior state:

```yaml
spec:
  template:
    metadata:
      name: mattmoor-foo
    spec:
      A
```

In the original model, this case would be rejected by the Service
controller due to the generation mismatch between the existing
`mattmoor-foo` and the latest generation of the underlying
Configuration.

* Move away from abusing apis.Immutable for BYO name validation.

This replaces the current abuse to `apis.Immutable` for checking
certain properties of BYO Revision name in the webhook.  It replaces
them with the context-based approach we are moving towards to more
holistically replace `apis.Immutable` with `apis.Validate`.

* Incorporate review feedback from @vagababov

Fix some lint issues.

Moves to the shared context stuff in knative/pkg

Fix cmp.Diff orientation.

* Disallow BYO name in conjunction with generateName in the parent.

* Conflicting revision names should be fatal.

* SafeDiff to ShortDiff
2019-04-17 14:41:26 -07:00
Gregory Haynes 0203187d5c Run separate clusteringress controller (#2445)
In order to allow pluggable clusteringress we run our (istio) cotroller
separately as a user may prefer to only run a different controller.

Related-to: #2322
2019-04-15 10:09:00 -07:00
Victor Agababov ae3acd4024 ServerlessService Controller (#3555)
* New Serverless Service Controller initial impl

* remove the metrics port as discussed

* proper schema registration

* group change re-done

* Negative table tests. Some

* add more tests

* final coverage

* address the comments
2019-04-03 17:51:56 -07:00
Matt Moore ab9ef7afdb Reduces the boilerplate of our controller binaries. (#3503)
* Reduces the boilerplate of our controller binaries.

* Remove pointless assignment.
2019-03-23 21:58:48 -07:00
Matt Moore 327f49460a Add labels to our OWNERS files by area. (#3440)
This also cleans up a few ACLs (e.g. queue/activator -> networking, and no more VPA in third party).
2019-03-17 11:32:45 -07:00
Zhimin Xiang 6cf726c5af Initial framework of reconciling Istio Gateway based on ClusterIngressTLS (#3189)
* initial version of reconciling Istio Gateway for ClusterIngressTLS

* fix lint

* a part of unit test fix

* fix the unit test

* fix typo

* address comments

* fix typos

* address comment

* add more test case

* use only one gateway in the test because the order of two gateways is uncertain, which causes unit test flaky

* remove mutex from clusteringress and use optimistic concurrency strategy

* refactor the reconcileGateways for future reuse
2019-03-16 09:40:45 -07:00
zxxa b4f6c71a61 Distinguish config-logging (#3322)
* Distinguish config-logging

* use env value get configmap name

* update code for CI test
2019-03-15 11:29:44 -07:00
mattmoor-sockpuppet c5d1235592 golang format tools (#3197)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
2019-02-13 07:58:43 -08:00
zxxa b1891781d0 Use knative/pkg instead of knative/serving/pkg (#3187) 2019-02-12 18:52:42 -08:00
zxxa 3d137ac726 User can specify the namespace in yaml for knative-serving (#2708)
* User can specify the namespace in yaml for knative-serving

* use getter method for namespaces

* add default namespaces for test

* panic if the SYSTEM_NAMESPACE environment variable isn't set

This makes `pkg/system` panic if `SYSTEM_NAMESPACE` is not set.  For tests, it exposes a simple library you can link to set this variable to a suitable namespace.

* update namespace in crd_checks.go

* change test ns knative-serving to knative-testing

* use environment value set the autoscaler namespaces

* queue get env from system.Namespace

* update the test case to match the new environment value
2019-01-18 06:33:32 -08:00
Markus Thömmes 917696f5cc Add version check to all control-plane binaries. (#2906)
* Add version check to all control-plane binaries.

* Fix conflicts.
2019-01-17 23:06:32 -08:00
Dan Gerdesmeier f9624140a5 Clean up logging in controller main files (#2913)
* Clean up logging in controller main files

There is a lot of inconsistent use of the Zap logging functionality
throughout the project. This change moves all of the controller main
functions to use the Zap With() syntax when errors are present. This
fixes a bug in output for logging calls that forgot the "w" at the end of
the logging output level, and changes sprintf formatted error messages
to the use context options of Zap.

This change targets just these files to limit conflicts generated by a
larger single commit.

Previous log line without "w" or "f":
{"level":"info","msg":"Previous message.{error 25 0  Example Error}"}
Previous log line with "f":
{"level":"info","msg":"Previous message: Example Error"}
New log line with "w":
{"level":"info","msg":"New Message","error":"Example Error"}

* Update cmd/autoscaler/main.go

* Update cmd/controller/main.go

* Update test/controller/main.go
2019-01-15 12:18:31 -08:00
Mustafa Demirhan 46dd680739 Export reconciler metrics. (#2742) 2018-12-17 19:11:34 -08:00
Matt Moore 44490285f8 Improve the performance of bulk service creation by 60%. (#2608)
This draws inspiration largely from https://github.com/knative/pkg/pull/173, which prompted me to measure and investigate.  You can see some more detailed timings in that thread.

As we've grown the number of reconciler processes in our controller image, the QPS limits with which we talk to the API server have remained the same.  The meant that it took ~3 min to deploy 50 services, and ~6 min to deploy 100.

This change simply bumps those limits to `{number of reconciler processes} x {default value}` to approximate the limits we'd have if we ran each controller process as a separate Pod.

After applying this change we see a ~60% improvement, it takes ~70 seconds to deploy 50 services, and ~2:30 min to deploy 100.

> Note that it is unlikely that this same improvement will apply to less bursty deployments, but the improvement is substantial for bursty deployments.
2018-12-01 20:05:24 -08:00
Yanwei Guo 059bf5f8c1 Add GitHub commit ID to logs label (#2371)
* introduce a lib in pkg to read file from kodata and use it to read commit id and tag it to logs label

* introudce a lib called changeset instead of ko

* nits fix

* update knative/pkg

* remove serving/pkg/changeset

* rerun update-deps
2018-11-08 18:27:43 -08:00
akyyy 1e49f2361e Clean up duplicate logLevelKey and component field (#2423)
* Update dependencies

* rename loglevelkey to component so it can be used for both logging and metrics
2018-11-07 15:52:37 -08:00
lichuqiang a74ada3820 Update route reconciler to create ClusterIngress instead of VirtualService (#2243)
* remove old service func

* reconcile route into ClusterIngress

* update route test case
2018-10-25 08:25:32 -07:00
lichuqiang db2efd803b reconcile ClusterIngress into VirtualService (#2189)
* update test dependency

* helper funcs to construct virtualservice

* reconcile ClusterIngress into VirtualService

* enable ingress reconciler in controller

* add route namespace label
2018-10-19 09:16:29 -07:00
Matt Moore 2db070089d Label Configurations with Routes via a separate Reconciler (#2167)
* Disable labeling.

This is a precursor to moving this into a separate reconciliation process.

* Add a "labeler" Reconciler.

This Reconciler is responsible for applying Route labels to Configuration.

Fixes: https://github.com/knative/serving/issues/1129

* Incorporate review feedback from nghia and vincent.
2018-10-08 07:29:25 -07:00
Matt Moore 4977338879 Remove VPA (#2163)
This removes the VPA integration from the Revision controller to simplify things.

In the KPA architecture, the VPA doesn't belong here anyways, and before it is added back I'd like e2e tests making sure it actually WAI so that changes don't break it or the code will just rot.

Fixes: https://github.com/knative/serving/issues/1876
2018-10-05 11:04:24 -07:00