Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only support SSL dynamic mode #4356

Merged
merged 1 commit into from
Aug 15, 2019

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Jul 25, 2019

What this PR does / why we need it:

Implements changes from KEP #4351

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:

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 25, 2019
@aledbf aledbf force-pushed the only-dynamic-mode branch 2 times, most recently from b7d1189 to 077dbae Compare July 25, 2019 19:30
@aledbf
Copy link
Member Author

aledbf commented Jul 25, 2019

/test pull-ingress-nginx-test

@codecov-io
Copy link

codecov-io commented Jul 25, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@333d9fd). Click here to learn what that means.
The diff coverage is 53.91%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4356   +/-   ##
=========================================
  Coverage          ?   60.61%           
=========================================
  Files             ?       87           
  Lines             ?     7018           
  Branches          ?        0           
=========================================
  Hits              ?     4254           
  Misses            ?     2314           
  Partials          ?      450
Impacted Files Coverage Δ
internal/ingress/controller/config/config.go 98.56% <ø> (ø)
internal/ingress/types.go 0% <ø> (ø)
cmd/nginx/main.go 6.89% <0%> (ø)
internal/ingress/types_equals.go 22.3% <0%> (ø)
internal/ingress/sslcert.go 0% <0%> (ø)
internal/ingress/controller/checker.go 35.71% <100%> (ø)
cmd/nginx/flags.go 89.41% <100%> (ø)
internal/ingress/metric/collectors/controller.go 83.73% <100%> (ø)
internal/ingress/controller/store/backend_ssl.go 51.76% <21.42%> (ø)
internal/ingress/controller/controller.go 48.78% <30%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 333d9fd...80bd481. Read the comment docs.

@aledbf aledbf force-pushed the only-dynamic-mode branch 3 times, most recently from 87101d9 to a6148d2 Compare August 10, 2019 20:54
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 11, 2019
@aledbf aledbf force-pushed the only-dynamic-mode branch 3 times, most recently from 7706f0c to 008c2ec Compare August 11, 2019 06:42
@aledbf
Copy link
Member Author

aledbf commented Aug 11, 2019

@ElvinEfendi ready for another review

@aledbf
Copy link
Member Author

aledbf commented Aug 11, 2019

There is a reload that should not be required

--- /etc/nginx/nginx.conf	2019-08-11 16:14:51.018308289 +0000
+++ /tmp/new-nginx-cfg314775797	2019-08-11 16:14:54.354379138 +0000
@@ -1,5 +1,5 @@
 
-# Configuration checksum: 1642531233630393092
+# Configuration checksum: 1884626229457741760
 
 # setup custom paths that do not require root access
 pid /tmp/nginx.pid;
@@ -429,7 +429,7 @@
 			
 			rewrite_by_lua_block {
 				lua_ingress.rewrite({
-					force_ssl_redirect = false,
+					force_ssl_redirect = true,
 					use_port_in_redirects = false,
 				})
 				balancer.rewrite()
@@ -453,6 +453,10 @@
 				plugins.run()
 			}
 			
+			if ($scheme = https) {
+				more_set_headers                        "Strict-Transport-Security: max-age=15724800; includeSubDomains";
+			}
+

this happens a tls section is configured in the ingress or the secret is deleted

@aledbf aledbf force-pushed the only-dynamic-mode branch 2 times, most recently from 8ca77dd to f248b34 Compare August 12, 2019 20:05
@aledbf
Copy link
Member Author

aledbf commented Aug 12, 2019

/retest

@aledbf aledbf changed the title WIP Only support SSL dynamic mode Only support SSL dynamic mode Aug 12, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 12, 2019
@aledbf
Copy link
Member Author

aledbf commented Aug 12, 2019

/test pull-ingress-nginx-e2e-1-15

@aledbf aledbf force-pushed the only-dynamic-mode branch 3 times, most recently from 0c42062 to d2dd5d3 Compare August 13, 2019 18:08
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2019
@aledbf
Copy link
Member Author

aledbf commented Aug 13, 2019

/test pull-ingress-nginx-test

@aledbf
Copy link
Member Author

aledbf commented Aug 13, 2019

/retest

@ElvinEfendi
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 14, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@aledbf
Copy link
Member Author

aledbf commented Aug 14, 2019

/retest

1 similar comment
@aledbf
Copy link
Member Author

aledbf commented Aug 14, 2019

/retest

@oweise
Copy link

oweise commented Sep 1, 2020

This is actually a breaking change as it prevents existing instances from starting if they are configured with flag "--enable-dynamic-certificates".

Result is:
`-------------------------------------------------------------------------------
NGINX Ingress controller
Release: v0.34.1
Build: v20200715-ingress-nginx-2.11.0-8-gda5fa45e2
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.19.1


unknown flag: --enable-dynamic-certificates
`

@aledbf
Copy link
Member Author

aledbf commented Sep 1, 2020

@oweise you don't need the flag anymore. Only dynamic certificates are supported

Edit: the flag was removed in 0.31 9c6873a#diff-e64fced222d6b682ce87183241ee6022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants