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

Document nginx controller configuration tweaks #132

Merged
merged 4 commits into from
Jan 19, 2017

Conversation

pedrosland
Copy link
Contributor

@pedrosland pedrosland commented Jan 15, 2017

This PR contains many small tweaks to the nginx controller configuration documentation.

Some of these changes are perhaps personal taste. I am happy to change or to delete entirely.

I have another PR to follow for config map additions but I think this is un-reviewable enough.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 15, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 42.563% when pulling b81a49c on pedrosland:docs/nginx-controller-config-1 into 2eb9ab5 on kubernetes:master.

**Please note the template is tied to the go code. Be sure to no change names in the variable `$cfg`**
**Please note the template is tied to the Go code. Do not change names in the variable `$cfg`.**

To know more about the template syntax please check the [Go template package](https://golang.org/pkg/text/template/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For more information about"


To use custom values in an Ingress rule define this annotations:
**With the default values NGINX will not health check your backends, and whenever the endpoints controller notices a readiness probe failure that pod's IP will be removed from the list of endpoints, causing nginx to also remove it from the upstreams.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence should probably be split up


**Important:**
The upstreams are shared. All Ingress rules using the same service will use the same upstream. This means only one of the rules should define annotations to configure the upstream servers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this existed before, but it would be helpful to expand on "the upstreams".

Name of the secret that contains the usernames and passwords with access to the `path/s` defined in the Ingress Rule.
The secret must be created in the same namespace than the Ingress rule
The name of the secret that contains the usernames and passwords with access to the `path`'s defined in the Ingress Rule.
The secret must be created in the same namespace than the Ingress rule.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to say "as the" instead of "than the" ? Or is this implying ordering?



### Rate limiting

The annotations `ingress.kubernetes.io/limit-connections` and `ingress.kubernetes.io/limit-rps` allows the creation of a limit in the connections that can be opened by a single client IP address. This can be use to mitigate [DDoS Attacks](https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus)
The annotations `ingress.kubernetes.io/limit-connections` and `ingress.kubernetes.io/limit-rps` allows the creation of a limit in the connections that can be opened by a single client IP address. This can be used to mitigate [DDoS Attacks](https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"allow the creation"


Please check the [whitelist](examples/whitelist/README.md) example
*Note:* adding an annotation overrides any global restriction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize Adding


#### Retries in no idempotent methods
#### Retries in non idempotent methods
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add hyphen

The upstreams are shared. All Ingress rules using the same service will use the same upstream. This means only one of the rules should define annotations to configure the upstream servers.
In NGINX, backend server pools are called "[upstreams](http://nginx.org/en/docs/http/ngx_http_upstream_module.html)". Each upstream contains the endpoints for a service. An upstream is created for each service that has Ingress rules defined.

**Important:** All Ingress rules using the same service will use the same upstream. Only one of the Ingress rules should define annotations to configure the upstream servers.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right idea?

@pedrosland
Copy link
Contributor Author

Thanks for the feedback.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 42.543% when pulling 9e94863 on pedrosland:docs/nginx-controller-config-1 into 2eb9ab5 on kubernetes:master.

@@ -9,27 +9,27 @@
* [Rate limiting](#rate-limiting)
* [Secure backends](#secure-backends)
* [Whitelist source range](#whitelist-source-range)
* [Allowed parameters in configuration config map](#allowed-parameters-in-configuration-configmap)
* [Allowed parameters in configuration config map](#allowed-parameters-in-configuration-config-map)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, the text could read "ConfigMap" which is what the k8s docs typically call it.


1. config map: create a stand alone config map, use this if you want a different global configuration
2. annotations: [annotate the ingress](#annotations), use this if you want a specific configuration for the site defined in the Ingress rule
1. [config map](#allowed-parameters-in-configuration-config-map): create a stand alone config map, use this if you want a different global configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as above about ConfigMap.

@@ -110,49 +110,47 @@ Indicates the [HTTP Authentication Type: Basic or Digest Access Authentication](
ingress.kubernetes.io/auth-secret:secretName
```

Name of the secret that contains the usernames and passwords with access to the `path/s` defined in the Ingress Rule.
The secret must be created in the same namespace than the Ingress rule
The name of the secret that contains the usernames and passwords with access to the `path`'s defined in the Ingress Rule.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, I prefer paths to path's.

@@ -110,49 +110,47 @@ Indicates the [HTTP Authentication Type: Basic or Digest Access Authentication](
ingress.kubernetes.io/auth-secret:secretName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, space after :



### External Authentication

To use an existing service that provides authentication the Ingress rule can be annotated with `ingress.kubernetes.io/auth-url` to indicate the URL where the HTTP request should be sent.
Additionally is possible to set `ingress.kubernetes.io/auth-method` to specify the HTTP method to use (GET or POST) and `ingress.kubernetes.io/auth-send-body` to true or false (default).
Additionally it is possible to set `ingress.kubernetes.io/auth-method` to specify the HTTP method to use (GET or POST) and `ingress.kubernetes.io/auth-send-body` to true or false (default).

```
ingress.kubernetes.io/auth-url:"URL to the authentication service"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, space after :


TLSv1 is enabled to allow old clients like:
- [IE 8-10 / Win 7](https://www.ssllabs.com/ssltest/viewClient.html?name=IE&version=8-10&platform=Win%207&key=113)
- [Java 7u25](https://www.ssllabs.com/ssltest/viewClient.html?name=Java&version=7u25&key=26)

If you dont need to support this clients please remove TLSv1
If you dont need to support this clients please remove TLSv1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, 'this clients'


**use-http2:** Enables or disables the [HTTP/2](http://nginx.org/en/docs/http/ngx_http_v2_module.html) support in secure connections
**use-http2:** Enables or disables the [HTTP/2](http://nginx.org/en/docs/http/ngx_http_v2_module.html) support in secure connections.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/the//



**gzip-types:** Sets the MIME types in addition to "text/html" to compress. The special value "*"" matches any MIME type.
Responses with the "text/html" type are always compressed if `use-gzip` is enabled
**use-proxy-protocol:** Enables or disables the use of the [PROXY protocol](https://www.nginx.com/resources/admin-guide/proxy-protocol/) to receive client connection (real IP address) information passed through proxy servers and load balancers such as HAproxy and Amazon Elastic Load Balancer (ELB).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/the use of the/use of the/



**worker-processes:** Sets the number of [worker processes](http://nginx.org/en/docs/ngx_core_module.html#worker_processes). By default "auto" means number of available CPU cores
**worker-processes:** Sets the number of [worker processes](http://nginx.org/en/docs/ngx_core_module.html#worker_processes). By default "auto" means number of available CPU cores.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/By default/The default of

@@ -340,22 +342,23 @@ The next table shows the options, the default value and a description
|use-gzip|"true"|
|use-http2|"true"|
|vts-status-zone-size|10m|
|worker-processes|<number of CPUs>|
|worker-processes|number of CPUs|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe something like "$(nproc)" would be clearer, since it isn't literally being set to 'number of CPUs'.

I'm not sure the best option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about these either. It was on my list to ask about for later.

I have a couple more changes in the pipeline and I don't see a clear way to express:

|ssl-dh-param|value provided by OpenSSL|

Your suggestion would fix this case though and perhaps that is good enough for now? Another idea is to simply write &lt; instead of <.

Some of these values are quoted but others are not. Perhaps we could quote the items to be taken literally or &lt;/&gt; the values that are not?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrosland @euank I think we can leave this change for a different PR

@euank
Copy link
Contributor

euank commented Jan 17, 2017

I left some nits, but overall looks much cleaner, thanks a ton! ✏️ ✏️ ✏️

@pedrosland
Copy link
Contributor Author

@euank Thanks for the feedback. I've changed all of these except for this which I'm not sure about. Perhaps we should discuss this and leave it for another PR.

@aledbf aledbf self-assigned this Jan 19, 2017
@aledbf
Copy link
Member

aledbf commented Jan 19, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2017
@aledbf aledbf merged commit fbcedc0 into kubernetes:master Jan 19, 2017
@aledbf
Copy link
Member

aledbf commented Jan 19, 2017

@pedrosland thanks!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.8%) to 43.285% when pulling 292375e on pedrosland:docs/nginx-controller-config-1 into 2eb9ab5 on kubernetes:master.

haoqing0110 pushed a commit to stolostron/management-ingress that referenced this pull request Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants