-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #530 from aledbf/event-on-ssl-error
Fix link to custom nginx configuration
- Loading branch information
Showing
4 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
examples/customization/custom-configuration/nginx/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
Using a [ConfigMap](https://kubernetes.io/docs/user-guide/configmap/) is possible to customize the NGINX configuration | ||
|
||
For example, if we want to change the timeouts we need to create a ConfigMap: | ||
|
||
``` | ||
$ cat nginx-load-balancer-conf.yaml | ||
apiVersion: v1 | ||
data: | ||
proxy-connect-timeout: "10" | ||
proxy-read-timeout: "120" | ||
proxy-send-timeout: "120" | ||
kind: ConfigMap | ||
metadata: | ||
name: nginx-load-balancer-conf | ||
``` | ||
|
||
``` | ||
$ kubectl create -f nginx-load-balancer-conf.yaml | ||
``` | ||
|
||
Please check the example `nginx-custom-configuration.yaml` | ||
|
||
If the Configmap it is updated, NGINX will be reloaded with the new configuration. |
56 changes: 56 additions & 0 deletions
56
examples/customization/custom-configuration/nginx/nginx-custom-configuration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-ingress-controller | ||
labels: | ||
k8s-app: nginx-ingress-controller | ||
namespace: kube-system | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: nginx-ingress-controller | ||
annotations: | ||
prometheus.io/port: '10254' | ||
prometheus.io/scrape: 'true' | ||
spec: | ||
# hostNetwork makes it possible to use ipv6 and to preserve the source IP correctly regardless of docker configuration | ||
# however, it is not a hard dependency of the nginx-ingress-controller itself and it may cause issues if port 10254 already is taken on the host | ||
# that said, since hostPort is broken on CNI (https://github.com/kubernetes/kubernetes/issues/31307) we have to use hostNetwork where CNI is used | ||
# like with kubeadm | ||
# hostNetwork: true | ||
terminationGracePeriodSeconds: 60 | ||
containers: | ||
- image: gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.3 | ||
name: nginx-ingress-controller | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 10254 | ||
scheme: HTTP | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 10254 | ||
scheme: HTTP | ||
initialDelaySeconds: 10 | ||
timeoutSeconds: 1 | ||
ports: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
- containerPort: 443 | ||
hostPort: 443 | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
args: | ||
- /nginx-ingress-controller | ||
- --default-backend-service=$(POD_NAMESPACE)/default-http-backend | ||
- --configmap=$(POD_NAMESPACE)/nginx-custom-configuration |
8 changes: 8 additions & 0 deletions
8
examples/customization/custom-configuration/nginx/nginx-load-balancer-conf.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
data: | ||
proxy-connect-timeout: "10" | ||
proxy-read-timeout: "120" | ||
proxy-send-timeout: "120" | ||
kind: ConfigMap | ||
metadata: | ||
name: nginx-custom-configuration |