From 4fe3462a82703291486eb20e26cb5b61b3f17d04 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Tue, 2 Aug 2016 21:47:44 -0400 Subject: [PATCH] Change healthz port to avoid conflicts when running using hostNetwork --- controllers/nginx/README.md | 7 +++++++ .../custom-configuration/rc-custom-configuration.yaml | 2 +- .../nginx/examples/custom-errors/rc-custom-errors.yaml | 2 +- .../nginx/examples/custom-template/custom-template.yaml | 2 +- controllers/nginx/examples/daemonset/as-daemonset.yaml | 2 +- controllers/nginx/examples/default/rc-default.yaml | 2 +- controllers/nginx/examples/full/rc-full.yaml | 2 +- controllers/nginx/examples/proxy-protocol/nginx-rc.yaml | 2 +- .../nginx/examples/sysctl/change-proc-values-rc.yaml | 2 +- controllers/nginx/examples/tcp/rc-tcp.yaml | 2 +- controllers/nginx/examples/tls/rc-ssl.yaml | 2 +- controllers/nginx/examples/udp/rc-udp.yaml | 2 +- controllers/nginx/main.go | 2 +- controllers/nginx/rc.yaml | 2 +- 14 files changed, 20 insertions(+), 13 deletions(-) diff --git a/controllers/nginx/README.md b/controllers/nginx/README.md index c7a9cf5ff..ac39f4ccd 100644 --- a/controllers/nginx/README.md +++ b/controllers/nginx/README.md @@ -19,6 +19,7 @@ This is a nginx Ingress controller that uses [ConfigMap](https://github.com/kube * [NGINX customization](configuration.md) * [NGINX status page](#nginx-status-page) * [Disabling NGINX ingress controller](#disabling-nginx-ingress-controller) +* [Local cluster](#local-cluster) * [Debug & Troubleshooting](#troubleshooting) * [Limitations](#limitations) * [NGINX Notes](#nginx-notes) @@ -343,6 +344,12 @@ To extract the information in JSON format the module provides a custom URL: `/ng Setting the annotation `kubernetes.io/ingress.class` to any value other than "nginx" or the empty string, will force the NGINX Ingress controller to ignore your Ingress. Do this if you wish to use one of the other Ingress controllers at the same time as the NGINX controller. +### Local cluster + +Using [`hack/local-up-cluster.sh`](https://github.com/kubernetes/kubernetes/blob/master/hack/local-up-cluster.sh) is possible to start a local kubernetes cluster consisting of a master and a single node. Please read [running-locally.md](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/running-locally.md) for more details. + +Use of `hostNetwork: true` in the ingress controller is required to falls back at localhost:8080 for the apiserver if every other client creation check fails (eg: service account not present, kubeconfig doesn't exist, no master env vars...) + ### Debug & Troubleshooting diff --git a/controllers/nginx/examples/custom-configuration/rc-custom-configuration.yaml b/controllers/nginx/examples/custom-configuration/rc-custom-configuration.yaml index 156314718..e7820cf53 100644 --- a/controllers/nginx/examples/custom-configuration/rc-custom-configuration.yaml +++ b/controllers/nginx/examples/custom-configuration/rc-custom-configuration.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/custom-errors/rc-custom-errors.yaml b/controllers/nginx/examples/custom-errors/rc-custom-errors.yaml index 7d3fb7075..0206efd0d 100644 --- a/controllers/nginx/examples/custom-errors/rc-custom-errors.yaml +++ b/controllers/nginx/examples/custom-errors/rc-custom-errors.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/custom-template/custom-template.yaml b/controllers/nginx/examples/custom-template/custom-template.yaml index d56a43d83..552dccb00 100644 --- a/controllers/nginx/examples/custom-template/custom-template.yaml +++ b/controllers/nginx/examples/custom-template/custom-template.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/daemonset/as-daemonset.yaml b/controllers/nginx/examples/daemonset/as-daemonset.yaml index b2f080f6d..7c65a8344 100644 --- a/controllers/nginx/examples/daemonset/as-daemonset.yaml +++ b/controllers/nginx/examples/daemonset/as-daemonset.yaml @@ -16,7 +16,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/default/rc-default.yaml b/controllers/nginx/examples/default/rc-default.yaml index 63222e5a0..f27fe8295 100644 --- a/controllers/nginx/examples/default/rc-default.yaml +++ b/controllers/nginx/examples/default/rc-default.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/full/rc-full.yaml b/controllers/nginx/examples/full/rc-full.yaml index feaf2bd09..e36ec539a 100644 --- a/controllers/nginx/examples/full/rc-full.yaml +++ b/controllers/nginx/examples/full/rc-full.yaml @@ -27,7 +27,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/proxy-protocol/nginx-rc.yaml b/controllers/nginx/examples/proxy-protocol/nginx-rc.yaml index d5c1e1156..04591556f 100644 --- a/controllers/nginx/examples/proxy-protocol/nginx-rc.yaml +++ b/controllers/nginx/examples/proxy-protocol/nginx-rc.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/sysctl/change-proc-values-rc.yaml b/controllers/nginx/examples/sysctl/change-proc-values-rc.yaml index 557bb6027..5b5671401 100644 --- a/controllers/nginx/examples/sysctl/change-proc-values-rc.yaml +++ b/controllers/nginx/examples/sysctl/change-proc-values-rc.yaml @@ -95,7 +95,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/tcp/rc-tcp.yaml b/controllers/nginx/examples/tcp/rc-tcp.yaml index 2aae0a96d..2185590fb 100644 --- a/controllers/nginx/examples/tcp/rc-tcp.yaml +++ b/controllers/nginx/examples/tcp/rc-tcp.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/tls/rc-ssl.yaml b/controllers/nginx/examples/tls/rc-ssl.yaml index 63222e5a0..f27fe8295 100644 --- a/controllers/nginx/examples/tls/rc-ssl.yaml +++ b/controllers/nginx/examples/tls/rc-ssl.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/examples/udp/rc-udp.yaml b/controllers/nginx/examples/udp/rc-udp.yaml index 38bfbabc2..5d1df5456 100644 --- a/controllers/nginx/examples/udp/rc-udp.yaml +++ b/controllers/nginx/examples/udp/rc-udp.yaml @@ -22,7 +22,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 diff --git a/controllers/nginx/main.go b/controllers/nginx/main.go index 1278a4a75..fa08e1fac 100644 --- a/controllers/nginx/main.go +++ b/controllers/nginx/main.go @@ -38,7 +38,7 @@ import ( ) const ( - healthPort = 10249 + healthPort = 10254 ) var ( diff --git a/controllers/nginx/rc.yaml b/controllers/nginx/rc.yaml index 3d449b0c4..083933414 100644 --- a/controllers/nginx/rc.yaml +++ b/controllers/nginx/rc.yaml @@ -74,7 +74,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 10249 + port: 10254 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5