Commit graph

6527 commits

Author SHA1 Message Date
Jintao Zhang
498892514d
Downgrade nginx to v1.19 (#7639)
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2021-09-15 11:08:11 -07:00
Renato Britto Araujo
0dbaadf608
Add e2e tests for secure cookie annotations (#7575) (#7619)
Co-authored-by: Agoretti <andremotta96@gmail.com>

Co-authored-by: Agoretti <andremotta96@gmail.com>
2021-09-12 13:10:07 -07:00
Jennifer Kirsch
ff2b743a94
Only build nginx-errors for linux/amd64 (#7625)
* Fix wrong image location used in nginx-errors example config

* Only build nginx-errors for linux/amd64
2021-09-12 10:08:06 -07:00
Ricardo Katz
cda59ccc9c
Add new flag to watch ingressclass by name instead of spec (#7609) 2021-09-10 10:14:01 -07:00
Ricardo Katz
89eee0deba
Change the cloudbuild timeout 2021-09-09 09:17:26 -03:00
Ricardo Katz
903446f326
Rename cloudbuild.yml to cloudbuild.yaml 2021-09-09 09:00:31 -03:00
Jennifer Kirsch
c9a00fbc73
Fix old tag of custom error pages used in example (#7460)
* Fix old tag of custom error pages used in example

* Move nginx-errors to k8s registry

Since the setup for the custom-error-messages was really different from
the other images that are build using cloudbuild, I changed it to "fit
in better"

* Use Go version 1.17 for custom-error-pages

Since Go >= 1.16 required the use of modules, I also initialized the module using the name k8s.io/ingress-nginx/custom-error-pages
2021-09-09 04:38:11 -07:00
Kundan Kumar
7be4015e13
Added command to get Nginx versionq! (#7577) 2021-09-09 03:30:11 -07:00
Bhumij Gupta
8b3a6f0252
Helm notes outputs non nil value for ingress.class annotation (#7611)
Signed-off-by: bhumijgupta <bhumijgupta@gmail.com>
2021-09-08 02:17:20 -07:00
Renan Gonçalves
48601bcd0e
Allow the usage of Services as Upstream on a global level (#7469)
It is possible to change this behavior on an ingress level, which works
well when you only have a few of them. When running several dozen
ingress and with a high change rate of running pods it makes it easier
to define this configuration on a global level.

This change is completely backwards compatible, only adding the
possibility of defining a new key in the configmap.
2021-09-07 12:47:15 -07:00
fatedier
82e1fc8cac
getEndpoints uses service target port directly if it's a number and mismatch with port name in endpoint (#7393) 2021-09-07 11:15:16 -07:00
FBLGit
a714fb69db
This PR: (#7514)
<!--- Provide a general summary of your changes in the Title above --->
<!--- Why is this change required? What problem does it solve? -->

Introduces the CLI command flag `--disable-full-test`

By default, it doesn't alter the current behavior of the tests performed by the admission controller.
With or Without the flag, a full checkOverlap is actioned, without any alteration
and the object `pcfg` is created with the whole set of ingreses.

If the flag is set to true, it does manipulate the size of `pcfg` up to the content of $this single ingress.

This is achieved by overriding pcfg content by just the last slice that got recently appended to the object `ings`
```
	if n.cfg.DisableFullValidationTest {
		_, _, pcfg = n.getConfiguration(ings[len(ings)-1:])
	}
```

The following steps of generateTemplate and testTemplate are significally reduced to a signle scenario
```
    content, err := n.generateTemplate(cfg, *pcfg)
    ...
    err = n.testTemplate(content)
```

This flag doesn't avoid the proper testing of collisions, neither bad syntaxis within the rendered
configuration of the ingress.

But it does eliminate a scenario, which I wasn't able to produce, where by for some reason even proper rendering
and valid values, without collisions of host/path may end into an invalid nginx.conf

The reasoning for this Feature is:
- Test duration increases by the number of ingresses in the cluster.
- File size grows to very important numbers 150-200Mb on clusters with just 2000~ ingresses.
- Tests in that scenario, takes approximately 20s using the last 0.48.1 improvements
- Produces a considerable memory consumption, as well as CPU, compute, that affects directly the containers
  that serve traffic.

Since the flag is trully optional, and by default is disabled I fell as a good thing to have that can definitively
help on large-scale scenarios that still want to have a reasonable set of tests in place at a lower cost.

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
Tested with the build kit the following scenarios on a cluster with 1000~ ingresses:
- With Flag Disabled or Flag, not present (current status as per 0.48.1)

collision scenario (wrong snippet content):
`kubectl apply -f ../collision-syntax.yaml  0.18s user 0.05s system 3% cpu 6.639 total`

collisions scenario (duplicated host):
`kubectl apply -f ../collision-host.yaml  0.17s user 0.05s system 3% cpu 6.245 total`

create/update:
`kubectl apply -f ing-215.yaml  0.16s user 0.05s system 3% cpu 5.845 total`

- With Flag Enabled (true):
collision scenario (wrong snippet content):
`kubectl apply -f ../collision.yaml  0.18s user 0.02s system 57% cpu 0.347 total`

collision scenario (duplicated host):
`kubectl apply -f ../collision.yaml  0.21s user 0.06s system 85% cpu 0.318 total`

create/update:
`kubectl apply -f ing-973.yaml  0.17s user 0.03s system 72% cpu 0.271 total`

As part of the test, I did verified that the created nginx for the test was of a smaller size, and that it didnt affect negatively the final nginx.conf (of a much larger side) where this was merged by the next steps in place after the validation. I couldn't observe any other change in the behaviour and so far the routine looks simple and non harmful.

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I've read the [CONTRIBUTION](https://github.com/kubernetes/ingress-nginx/blob/main/CONTRIBUTING.md) guide
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

For the test part, I would need to understand the placement and test case that this would require, I wasn't able to see an existing scenario for this
2021-09-07 10:53:16 -07:00
Maxim
af5f40a0eb
Trigger syncIngress on Service addition/deletion #7346 (#7374)
Normally Ingress sinchronization for Services is triggered when
corresponding Service's Endpoints are added, deleted or modified.
Services of type ExternalName, however, do not have any endpoints
and hence do not trigger Ingress synchronization as only Update
events are being watched. This commit makes sure that Update and
Delete Service events also enqueue a syncIngress task.
2021-09-07 10:47:16 -07:00
Emily L Shepherd
3c86f838d4
Sync Hostname and IP address from service to ingress status (#7464)
* Change statusSync.runningAddresses() return type

Previously, this method returning a string slice containing the resolved
IP addresses / FQDNs to sync onto the Ingress. It was then converted
just before use into a slice of LoadBalancerIngresses.

This commit changes this logic so that this method generates
LoadBalancerIngress objects directly, and returns these. This has two
main benefits:
- Future work in syncing _both_ hostname and IP, or any other fields
  that may be used in future (eg Ports), is now supported.
- There is less need to rely on net.ParseIP() to determine if a value is
  an IP address or Hostname, as this can be correctly assigned at
  generation time based on where each value came from.

* Sync both IP and Hostname to Ingress Status

Previously, if the IP address was set on a PublishService's
LoadBalancerIngress entries, only that would be synced. Hostname was
only synced as a fallback when the IP address was missing.

Now, both fields are checked independantly and both are synced if
present.
2021-09-07 10:41:16 -07:00
Elvin Efendi
33061b8cdf
put modsecurity e2e tests into their own packages (#7560) 2021-09-07 10:35:22 -07:00
Ray
cf9ae96d72
Additional AuthTLS assertions and doc change to demonstrate auth-tls-secret enables the other AuthTLS annotations (#7202)
* Fix indentation of nested list in AuthTLS annotations

Also, put `<annotation>`: <description text>` on a single line in
Markdown markup, which will match what gets rendered eventually.

On the other hand, for the line on auth-tls-secret (This annotation
expects the Secret name in the form "namespace/secretName"), its
Markdown markup suggests that the author wanted the line to start on its
own line, but currently this gets rendered on the same line. It's nice
for this to be on its own line, since it's kind of a "note" about the
annotation syntax. Format/indent the markup appropriately so that it
shows up on its line.

* Fix indentation of nested list in CORS annotations

Also, put `<annotation>`: <description text>` on a single line in
Markdown markup, which will match what gets rendered eventually.

On the other hand, for lines noting the allowed characters (This is a
multi-valued field...), its Markdown markup suggests that the author
wanted the line to start on its own line, but currently this gets
rendered on the same line. It's nice for this to be on its own line,
since it's kind of a "note" about the annotation syntax. Format/indent
the markup appropriately so that it shows up on its line.

* Replace f.HTTPTestClientWithTLSConfig() in AuthTLS E2E, the odd one out for requests without client certs

* Demonstrate and document that auth-tls-secret enables the other AuthTLS annotations like verify client, depth

* Split E2E for auth-tls-error-page and *-pass-certificate-to-upstream
2021-09-07 10:35:16 -07:00
Yuhao Zhang
e7791941ba
fix cli flag typo in faq (#7606) 2021-09-07 09:11:16 -07:00
pierre-yves
f182b317ba
fix charts README.md to give additional detail on prometheus metrics … (#7601)
* fix charts README.md to give additional detail on prometheus metrics configuration

* charts readme.md remove blank line
2021-09-07 06:47:15 -07:00
KuberDriver
da29c7712a
Update e2e test runner image (#7596)
* Update to the base nginx image

* Revert "Update to the base nginx image"

This reverts commit ad43c1d060.

* Update test runner image

* correcting the sha and version of e2e test runner images
2021-09-06 16:21:16 -07:00
KuberDriver
7d577d9761
Update cloudbuild timeout (#7604)
* Update to the base nginx image

* Revert "Update to the base nginx image"

This reverts commit ad43c1d060.

* Updated cloudbuild to increase build timeout value
2021-09-06 11:44:28 -07:00
Tony Li
f27deed2e8
remove timestamp when requeuing Element (#7440)
Signed-off-by: xiayu.lyt <xiayu.lyt@alibaba-inc.com>
2021-09-06 10:12:28 -07:00
Long Wu Yuan
9f9122c381
fix 7591 (#7598) 2021-09-05 11:22:28 -07:00
KuberDriver
90c065d508
Update to the base nginx image (#7597)
* Update to the base nginx image

* update template.go

* update template_test.go
2021-09-05 04:50:28 -07:00
Long Wu Yuan
4eeb1dfb56
improve faq for migration to ingress api v1 (#7540) 2021-09-04 20:45:20 -07:00
Ricardo Katz
b7c973dcec
Merge pull request #7594 from rikatz/remove-alpine-extrathings
Remove addgroup directive from alpine building
2021-09-04 02:14:58 -03:00
Ricardo Katz
4ce0227268 Remove addgroup directive from alpine building 2021-09-04 02:12:50 -03:00
Ricardo Katz
77bc323285
Merge pull request #7592 from rikatz/change-buildx
Change builder in a new attempt to make it run
2021-09-04 01:11:30 -03:00
Ricardo Katz
dd3b0c9fc2 Change builder in a new attempt to make it run 2021-09-04 01:06:51 -03:00
Ricardo Katz
39f087c012
Changing gcb builder (#7584) 2021-09-02 12:15:46 -07:00
Ricardo Katz
cb8ebcb880
update alpine and remove buildx restriction (#7583) 2021-09-02 11:59:39 -07:00
Fred Thomsen
61c596bea6
Add doc ref for preserve-trailing-slash annotation (#7561)
Fixes issue #7555
2021-09-02 09:54:58 -07:00
Ricardo Katz
4601bd9699
Default KinD manifest to watch ingresses without class (#7581) 2021-09-02 08:04:58 -07:00
Aivars Sterns
9dda37c130
add same tcp and udp ports to internal load balancer (#7511) 2021-09-02 00:54:09 -07:00
Vincent LE GOFF
f2e743f561
feat: add session-cookie-secure annotation (#7399) 2021-09-01 15:23:40 -07:00
Dechao Qiu
8a1a5e93c7
Fix YAML indentation issue (#7556)
`http-snippet:|` does not work for kubernetes 1.21.4, it requires extra space: ``http-snippet: |`
2021-08-31 07:45:38 -07:00
Elvin Efendi
8951b7e22a
Revert "Update base nginx" (#7558)
* Revert "Update base nginx (#7552)"

This reverts commit c6bc9870f1.

* keep alpine bump
2021-08-28 07:38:52 -07:00
Elvin Efendi
c6bc9870f1
Update base nginx (#7552)
* upgrade alpine

* use nginx 1.19.9 and corresponding patches from openresty

* include openresty CVE-2021-23017 patch too
2021-08-27 07:20:05 -07:00
Maksim Nabokikh
4c4013904a
Add a flag to specify address to bind the healthz server (#7541)
* Add a flag to specify address to bind the healthz server

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Add healthz host to the helm chart

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Apply suggestions from code review

Co-authored-by: Ricardo Katz <rikatz@users.noreply.github.com>

Co-authored-by: Ricardo Katz <rikatz@users.noreply.github.com>
2021-08-26 05:13:23 -07:00
Pål Kristensen
66c2a716da
Document the keep-alive 0 effect on http/2 requests (#7503) 2021-08-25 17:53:23 -07:00
Tsachi Nimni
37fbcc0bd9
Update docs for new ingress api in cluster version >=1.19 (#7264)
* Update docs to support Ingress in cluster version 1.19 or greater

* Update docs

* Update basic-usage.md

* Update basic-usage.md
2021-08-25 17:51:23 -07:00
Marcos Nery
638a93835a
Improving e2e tests for non-service backends #7544 (#7545)
* Adding test cases for backend with nil service

Signed-off-by: Marcos <marcosnery.comp@gmail.com>
Co-authored-by: Renato Araujo <renatobritto@protonmail.com>
Co-authored-by: André Goretti <andremotta96@gmail.com>
Co-authored-by: Kalebe Lopes <calbkalebe@gmail.com>

* Add e2e test for backend nil service and add nil safeguard (#7344)

Co-authored-by: Renato Araujo <renatobritto@protonmail.com>
Co-authored-by: André Goretti <andremotta96@gmail.com>
Co-authored-by: Kalebe Lopes <calbkalebe@gmail.com>

* changing portuguese names to english in order to maintain the pattern

* updating boilerplate header

* adding second test case to also test valid path

Co-authored-by: Ricardo Katz <rikatz@users.noreply.github.com>

* Updating boilerplate

* fixing boilerplate

Signed-off-by: MarcosN <marcosnery.comp@gmail.com>
Co-authored-by: André Goretti <andremotta96@gmail.com>
Co-authored-by: Gabriel Albino <enggabrielalbino@gmail.com>

* Improving template test for cases where a nil backend service is included

Signed-off-by: MarcosN <marcosnery.comp@gmail.com>
Co-authored-by: André Goretti <andremotta96@gmail.com>
Co-authored-by: Gabriel Albino <enggabrielalbino@gmail.com>

Co-authored-by: Renato Araujo <renatobritto@protonmail.com>
Co-authored-by: André Goretti <andremotta96@gmail.com>
Co-authored-by: Kalebe Lopes <calbkalebe@gmail.com>
Co-authored-by: Ricardo Katz <rikatz@users.noreply.github.com>
Co-authored-by: Gabriel Albino <enggabrielalbino@gmail.com>
2021-08-25 17:45:23 -07:00
Long Wu Yuan
f5fe7615ac
improve docs for release - added step to edit README for support matrix (#7537) 2021-08-24 19:00:40 -07:00
Neha Lohia
b5679e620b
add known issues in changelog.md for release v1.0.0 (#7536)
* release v1.0.0

Signed-off-by: Neha Lohia <nehapithadiya444@gmail.com>

* add the known issues no in changelog.md for release v1.0.0

Signed-off-by: Neha Lohia <nehapithadiya444@gmail.com>
2021-08-24 09:31:14 -07:00
Neha Lohia
f207702c30
release v1.0.0 (#7535)
Signed-off-by: Neha Lohia <nehapithadiya444@gmail.com>
2021-08-24 08:31:14 -07:00
Ricardo Katz
041eb167c7
update tag to v1.0.0
update tag to v1.0.0
2021-08-24 09:19:03 -03:00
Neha Lohia
f3af7e6bf5
update tag to v1.0.0 2021-08-24 17:47:11 +05:30
wasker
3fb312ee2c
End-to-end tests for canary affinity (#7529) 2021-08-24 05:05:14 -07:00
Sandip Bhattacharya
f84006d62f
docs: Clarify default-backend behavior (#7489)
Clarify default-backend behaviour for services with multiple ports.

Also minor fixes for typos and language consistency.
2021-08-24 04:59:13 -07:00
Long Wu Yuan
1510c06045
docs for migration to apiVersion networking.k8s.io/v1 (#7524) 2021-08-24 04:57:13 -07:00
wenhuwang
6593cb244b
fix ingress-nginx panic when the certificate format is wrong. (#7443)
* fix ingress-nginx panic when the certificate format is wrong.

Signed-off-by: wang_wenhu <976400757@qq.com>

* Add unit test.

Signed-off-by: wang_wenhu <976400757@qq.com>

* Update controller_test.go
2021-08-23 18:58:14 -07:00