Refactor health checks and wait until NGINX process ends
This commit is contained in:
parent
c85450c1e7
commit
c2935ca35c
15 changed files with 126 additions and 69 deletions
1
Makefile
1
Makefile
|
@ -108,6 +108,7 @@ container: clean-container .container-$(ARCH)
|
||||||
mkdir -p $(TEMP_DIR)/rootfs
|
mkdir -p $(TEMP_DIR)/rootfs
|
||||||
cp bin/$(ARCH)/nginx-ingress-controller $(TEMP_DIR)/rootfs/nginx-ingress-controller
|
cp bin/$(ARCH)/nginx-ingress-controller $(TEMP_DIR)/rootfs/nginx-ingress-controller
|
||||||
cp bin/$(ARCH)/dbg $(TEMP_DIR)/rootfs/dbg
|
cp bin/$(ARCH)/dbg $(TEMP_DIR)/rootfs/dbg
|
||||||
|
cp bin/$(ARCH)/wait-shutdown $(TEMP_DIR)/rootfs/wait-shutdown
|
||||||
|
|
||||||
cp -RP ./* $(TEMP_DIR)
|
cp -RP ./* $(TEMP_DIR)
|
||||||
$(SED_I) "s|BASEIMAGE|$(BASEIMAGE)|g" $(DOCKERFILE)
|
$(SED_I) "s|BASEIMAGE|$(BASEIMAGE)|g" $(DOCKERFILE)
|
||||||
|
|
|
@ -60,3 +60,12 @@ go build \
|
||||||
-X ${PKG}/version.COMMIT=${GIT_COMMIT} \
|
-X ${PKG}/version.COMMIT=${GIT_COMMIT} \
|
||||||
-X ${PKG}/version.REPO=${REPO_INFO}" \
|
-X ${PKG}/version.REPO=${REPO_INFO}" \
|
||||||
-o "bin/${ARCH}/dbg" "${PKG}/cmd/dbg"
|
-o "bin/${ARCH}/dbg" "${PKG}/cmd/dbg"
|
||||||
|
|
||||||
|
|
||||||
|
go build \
|
||||||
|
"${GOBUILD_FLAGS}" \
|
||||||
|
-ldflags "-s -w \
|
||||||
|
-X ${PKG}/version.RELEASE=${TAG} \
|
||||||
|
-X ${PKG}/version.COMMIT=${GIT_COMMIT} \
|
||||||
|
-X ${PKG}/version.REPO=${REPO_INFO}" \
|
||||||
|
-o "bin/${ARCH}/wait-shutdown" "${PKG}/cmd/waitshutdown"
|
||||||
|
|
|
@ -131,7 +131,7 @@ func main() {
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
|
||||||
if conf.EnableProfiling {
|
if conf.EnableProfiling {
|
||||||
registerProfiler(mux)
|
go registerProfiler()
|
||||||
}
|
}
|
||||||
|
|
||||||
registerHealthz(ngx, mux)
|
registerHealthz(ngx, mux)
|
||||||
|
@ -265,7 +265,9 @@ func registerMetrics(reg *prometheus.Registry, mux *http.ServeMux) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerProfiler(mux *http.ServeMux) {
|
func registerProfiler() {
|
||||||
|
mux := http.NewServeMux()
|
||||||
|
|
||||||
mux.HandleFunc("/debug/pprof/", pprof.Index)
|
mux.HandleFunc("/debug/pprof/", pprof.Index)
|
||||||
mux.HandleFunc("/debug/pprof/heap", pprof.Index)
|
mux.HandleFunc("/debug/pprof/heap", pprof.Index)
|
||||||
mux.HandleFunc("/debug/pprof/mutex", pprof.Index)
|
mux.HandleFunc("/debug/pprof/mutex", pprof.Index)
|
||||||
|
@ -276,6 +278,12 @@ func registerProfiler(mux *http.ServeMux) {
|
||||||
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
||||||
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
||||||
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
||||||
|
|
||||||
|
server := &http.Server{
|
||||||
|
Addr: fmt.Sprintf(":10255"),
|
||||||
|
Handler: mux,
|
||||||
|
}
|
||||||
|
klog.Fatal(server.ListenAndServe())
|
||||||
}
|
}
|
||||||
|
|
||||||
func startHTTPServer(port int, mux *http.ServeMux) {
|
func startHTTPServer(port int, mux *http.ServeMux) {
|
||||||
|
|
43
cmd/waitshutdown/main.go
Normal file
43
cmd/waitshutdown/main.go
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
Copyright 2019 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"k8s.io/ingress-nginx/internal/nginx"
|
||||||
|
"k8s.io/klog"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
err := exec.Command("bash", "-c", "pkill -SIGTERM -f nginx-ingress-controller").Run()
|
||||||
|
if err != nil {
|
||||||
|
klog.Errorf("unexpected error terminating ingress controller: %v", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// wait for the NGINX process to terminate
|
||||||
|
timer := time.NewTicker(time.Second * 1)
|
||||||
|
for range timer.C {
|
||||||
|
if !nginx.IsRunning() {
|
||||||
|
timer.Stop()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,7 +25,6 @@ import (
|
||||||
|
|
||||||
"github.com/ncabatoff/process-exporter/proc"
|
"github.com/ncabatoff/process-exporter/proc"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"k8s.io/klog"
|
|
||||||
|
|
||||||
"k8s.io/ingress-nginx/internal/nginx"
|
"k8s.io/ingress-nginx/internal/nginx"
|
||||||
)
|
)
|
||||||
|
@ -37,41 +36,48 @@ func (n NGINXController) Name() string {
|
||||||
|
|
||||||
// Check returns if the nginx healthz endpoint is returning ok (status code 200)
|
// Check returns if the nginx healthz endpoint is returning ok (status code 200)
|
||||||
func (n *NGINXController) Check(_ *http.Request) error {
|
func (n *NGINXController) Check(_ *http.Request) error {
|
||||||
statusCode, _, err := nginx.NewGetStatusRequest(nginx.HealthPath)
|
if n.isShuttingDown {
|
||||||
if err != nil {
|
return fmt.Errorf("the ingress controller is shutting down")
|
||||||
klog.Errorf("healthcheck error: %v", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if statusCode != 200 {
|
|
||||||
klog.Errorf("healthcheck error: %v", statusCode)
|
|
||||||
return fmt.Errorf("ingress controller is not healthy")
|
|
||||||
}
|
|
||||||
|
|
||||||
statusCode, _, err = nginx.NewGetStatusRequest("/is-dynamic-lb-initialized")
|
|
||||||
if err != nil {
|
|
||||||
klog.Errorf("healthcheck error: %v", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if statusCode != 200 {
|
|
||||||
klog.Errorf("healthcheck error: %v", statusCode)
|
|
||||||
return fmt.Errorf("dynamic load balancer not started")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the nginx master process is running
|
// check the nginx master process is running
|
||||||
fs, err := proc.NewFS("/proc", false)
|
fs, err := proc.NewFS("/proc", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "unexpected error reading /proc directory")
|
return errors.Wrap(err, "reading /proc directory")
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := ioutil.ReadFile(nginx.PID)
|
f, err := ioutil.ReadFile(nginx.PID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "unexpected error reading %v", nginx.PID)
|
return errors.Wrapf(err, "reading %v", nginx.PID)
|
||||||
}
|
}
|
||||||
|
|
||||||
pid, err := strconv.Atoi(strings.TrimRight(string(f), "\r\n"))
|
pid, err := strconv.Atoi(strings.TrimRight(string(f), "\r\n"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "unexpected error reading the nginx PID from %v", nginx.PID)
|
return errors.Wrapf(err, "reading NGINX PID from file %v", nginx.PID)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = fs.NewProc(pid)
|
_, err = fs.NewProc(pid)
|
||||||
return err
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "checking for NGINX process with PID %v", pid)
|
||||||
|
}
|
||||||
|
|
||||||
|
statusCode, _, err := nginx.NewGetStatusRequest(nginx.HealthPath)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "checking if NGINX is running")
|
||||||
|
}
|
||||||
|
|
||||||
|
if statusCode != 200 {
|
||||||
|
return fmt.Errorf("ingress controller is not healthy (%v)", statusCode)
|
||||||
|
}
|
||||||
|
|
||||||
|
statusCode, _, err = nginx.NewGetStatusRequest("/is-dynamic-lb-initialized")
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "checking if the dynamic load balancer started")
|
||||||
|
}
|
||||||
|
|
||||||
|
if statusCode != 200 {
|
||||||
|
return fmt.Errorf("dynamic load balancer not started")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,12 +35,11 @@ import (
|
||||||
func TestNginxCheck(t *testing.T) {
|
func TestNginxCheck(t *testing.T) {
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
|
||||||
listener, err := net.Listen("unix", nginx.StatusSocket)
|
listener, err := net.Listen("tcp", fmt.Sprintf(":%v", nginx.StatusPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("crating unix listener: %s", err)
|
t.Fatalf("crating tcp listener: %s", err)
|
||||||
}
|
}
|
||||||
defer listener.Close()
|
defer listener.Close()
|
||||||
defer os.Remove(nginx.StatusSocket)
|
|
||||||
|
|
||||||
server := &httptest.Server{
|
server := &httptest.Server{
|
||||||
Listener: listener,
|
Listener: listener,
|
||||||
|
|
|
@ -796,8 +796,8 @@ type TemplateConfig struct {
|
||||||
EnableMetrics bool
|
EnableMetrics bool
|
||||||
|
|
||||||
PID string
|
PID string
|
||||||
StatusSocket string
|
|
||||||
StatusPath string
|
StatusPath string
|
||||||
|
StatusPort int
|
||||||
StreamSocket string
|
StreamSocket string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ import (
|
||||||
"k8s.io/ingress-nginx/internal/ingress/annotations/proxy"
|
"k8s.io/ingress-nginx/internal/ingress/annotations/proxy"
|
||||||
ngx_config "k8s.io/ingress-nginx/internal/ingress/controller/config"
|
ngx_config "k8s.io/ingress-nginx/internal/ingress/controller/config"
|
||||||
"k8s.io/ingress-nginx/internal/k8s"
|
"k8s.io/ingress-nginx/internal/k8s"
|
||||||
|
"k8s.io/ingress-nginx/internal/nginx"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -268,6 +269,8 @@ func (n *NGINXController) getStreamServices(configmapName string, proto apiv1.Pr
|
||||||
n.cfg.ListenPorts.SSLProxy,
|
n.cfg.ListenPorts.SSLProxy,
|
||||||
n.cfg.ListenPorts.Health,
|
n.cfg.ListenPorts.Health,
|
||||||
n.cfg.ListenPorts.Default,
|
n.cfg.ListenPorts.Default,
|
||||||
|
10255, // profiling port
|
||||||
|
nginx.StatusPort,
|
||||||
}
|
}
|
||||||
reserverdPorts := sets.NewInt(rp...)
|
reserverdPorts := sets.NewInt(rp...)
|
||||||
// svcRef format: <(str)namespace>/<(str)service>:<(intstr)port>[:<("PROXY")decode>:<("PROXY")encode>]
|
// svcRef format: <(str)namespace>/<(str)service>:<(intstr)port>[:<("PROXY")decode>:<("PROXY")encode>]
|
||||||
|
|
|
@ -605,8 +605,8 @@ func (n NGINXController) generateTemplate(cfg ngx_config.Configuration, ingressC
|
||||||
|
|
||||||
HealthzURI: nginx.HealthPath,
|
HealthzURI: nginx.HealthPath,
|
||||||
PID: nginx.PID,
|
PID: nginx.PID,
|
||||||
StatusSocket: nginx.StatusSocket,
|
|
||||||
StatusPath: nginx.StatusPath,
|
StatusPath: nginx.StatusPath,
|
||||||
|
StatusPort: nginx.StatusPort,
|
||||||
StreamSocket: nginx.StreamSocket,
|
StreamSocket: nginx.StreamSocket,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
|
@ -148,16 +149,15 @@ func TestIsDynamicConfigurationEnough(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConfigureDynamically(t *testing.T) {
|
func TestConfigureDynamically(t *testing.T) {
|
||||||
listener, err := net.Listen("unix", nginx.StatusSocket)
|
listener, err := net.Listen("tcp", fmt.Sprintf(":%v", nginx.StatusPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("crating unix listener: %s", err)
|
t.Fatalf("crating unix listener: %s", err)
|
||||||
}
|
}
|
||||||
defer listener.Close()
|
defer listener.Close()
|
||||||
defer os.Remove(nginx.StatusSocket)
|
|
||||||
|
|
||||||
streamListener, err := net.Listen("unix", nginx.StreamSocket)
|
streamListener, err := net.Listen("unix", nginx.StreamSocket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("crating unix listener: %s", err)
|
t.Fatalf("crating unix listener: %s", err)
|
||||||
}
|
}
|
||||||
defer streamListener.Close()
|
defer streamListener.Close()
|
||||||
defer os.Remove(nginx.StreamSocket)
|
defer os.Remove(nginx.StreamSocket)
|
||||||
|
@ -319,12 +319,11 @@ func TestConfigureDynamically(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConfigureCertificates(t *testing.T) {
|
func TestConfigureCertificates(t *testing.T) {
|
||||||
listener, err := net.Listen("unix", nginx.StatusSocket)
|
listener, err := net.Listen("tcp", fmt.Sprintf(":%v", nginx.StatusPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("crating unix listener: %s", err)
|
t.Fatalf("crating unix listener: %s", err)
|
||||||
}
|
}
|
||||||
defer listener.Close()
|
defer listener.Close()
|
||||||
defer os.Remove(nginx.StatusSocket)
|
|
||||||
|
|
||||||
streamListener, err := net.Listen("unix", nginx.StreamSocket)
|
streamListener, err := net.Listen("unix", nginx.StreamSocket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -97,7 +96,7 @@ func TestStatusCollector(t *testing.T) {
|
||||||
|
|
||||||
for _, c := range cases {
|
for _, c := range cases {
|
||||||
t.Run(c.name, func(t *testing.T) {
|
t.Run(c.name, func(t *testing.T) {
|
||||||
listener, err := net.Listen("unix", nginx.StatusSocket)
|
listener, err := net.Listen("tcp", fmt.Sprintf(":%v", nginx.StatusPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("crating unix listener: %s", err)
|
t.Fatalf("crating unix listener: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -145,7 +144,6 @@ func TestStatusCollector(t *testing.T) {
|
||||||
cm.Stop()
|
cm.Stop()
|
||||||
|
|
||||||
listener.Close()
|
listener.Close()
|
||||||
os.Remove(nginx.StatusSocket)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
ps "github.com/mitchellh/go-ps"
|
ps "github.com/mitchellh/go-ps"
|
||||||
"github.com/tv42/httpunix"
|
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -38,8 +37,8 @@ var TemplatePath = "/etc/nginx/template/nginx.tmpl"
|
||||||
// PID defines the location of the pid file used by NGINX
|
// PID defines the location of the pid file used by NGINX
|
||||||
var PID = "/tmp/nginx.pid"
|
var PID = "/tmp/nginx.pid"
|
||||||
|
|
||||||
// StatusSocket defines the location of the unix socket used by NGINX for the status server
|
// StatusPort port used by NGINX for the status server
|
||||||
var StatusSocket = "/tmp/nginx-status-server.sock"
|
var StatusPort = 10256
|
||||||
|
|
||||||
// HealthPath defines the path used to define the health check location in NGINX
|
// HealthPath defines the path used to define the health check location in NGINX
|
||||||
var HealthPath = "/healthz"
|
var HealthPath = "/healthz"
|
||||||
|
@ -56,17 +55,12 @@ var StreamSocket = "/tmp/ingress-stream.sock"
|
||||||
|
|
||||||
var statusLocation = "nginx-status"
|
var statusLocation = "nginx-status"
|
||||||
|
|
||||||
var httpClient *http.Client
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
httpClient = buildUnixSocketClient(HealthCheckTimeout)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewGetStatusRequest creates a new GET request to the internal NGINX status server
|
// NewGetStatusRequest creates a new GET request to the internal NGINX status server
|
||||||
func NewGetStatusRequest(path string) (int, []byte, error) {
|
func NewGetStatusRequest(path string) (int, []byte, error) {
|
||||||
url := fmt.Sprintf("%v://%v%v", httpunix.Scheme, statusLocation, path)
|
url := fmt.Sprintf("http://127.0.0.1:%v%v", StatusPort, path)
|
||||||
|
|
||||||
res, err := httpClient.Get(url)
|
client := http.Client{}
|
||||||
|
res, err := client.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
}
|
}
|
||||||
|
@ -82,14 +76,15 @@ func NewGetStatusRequest(path string) (int, []byte, error) {
|
||||||
|
|
||||||
// NewPostStatusRequest creates a new POST request to the internal NGINX status server
|
// NewPostStatusRequest creates a new POST request to the internal NGINX status server
|
||||||
func NewPostStatusRequest(path, contentType string, data interface{}) (int, []byte, error) {
|
func NewPostStatusRequest(path, contentType string, data interface{}) (int, []byte, error) {
|
||||||
url := fmt.Sprintf("%v://%v%v", httpunix.Scheme, statusLocation, path)
|
url := fmt.Sprintf("http://127.0.0.1:%v%v", StatusPort, path)
|
||||||
|
|
||||||
buf, err := json.Marshal(data)
|
buf, err := json.Marshal(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := httpClient.Post(url, contentType, bytes.NewReader(buf))
|
client := http.Client{}
|
||||||
|
res, err := client.Post(url, contentType, bytes.NewReader(buf))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
}
|
}
|
||||||
|
@ -142,19 +137,6 @@ func readFileToString(path string) (string, error) {
|
||||||
return string(contents), nil
|
return string(contents), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildUnixSocketClient(timeout time.Duration) *http.Client {
|
|
||||||
u := &httpunix.Transport{
|
|
||||||
DialTimeout: 1 * time.Second,
|
|
||||||
RequestTimeout: timeout,
|
|
||||||
ResponseHeaderTimeout: timeout,
|
|
||||||
}
|
|
||||||
u.RegisterLocation(statusLocation, StatusSocket)
|
|
||||||
|
|
||||||
return &http.Client{
|
|
||||||
Transport: u,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Version return details about NGINX
|
// Version return details about NGINX
|
||||||
func Version() string {
|
func Version() string {
|
||||||
flag := "-v"
|
flag := "-v"
|
||||||
|
|
|
@ -558,7 +558,7 @@ http {
|
||||||
|
|
||||||
# default server, used for NGINX healthcheck and access to nginx stats
|
# default server, used for NGINX healthcheck and access to nginx stats
|
||||||
server {
|
server {
|
||||||
listen unix:{{ .StatusSocket }};
|
listen 127.0.0.1:{{ .StatusPort }};
|
||||||
set $proxy_upstream_name "internal";
|
set $proxy_upstream_name "internal";
|
||||||
|
|
||||||
keepalive_timeout 0;
|
keepalive_timeout 0;
|
||||||
|
|
|
@ -22,5 +22,14 @@ spec:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 1
|
||||||
|
initialDelaySeconds: 1
|
||||||
|
periodSeconds: 2
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 1
|
||||||
|
initialDelaySeconds: 1
|
||||||
|
periodSeconds: 2
|
||||||
|
lifecycle:
|
||||||
|
preStop:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /wait-shutdown
|
||||||
|
|
|
@ -199,7 +199,7 @@ var _ = framework.IngressNginxDescribe("Dynamic Configuration", func() {
|
||||||
|
|
||||||
It("sets controllerPodsCount in Lua general configuration", func() {
|
It("sets controllerPodsCount in Lua general configuration", func() {
|
||||||
// https://github.com/curl/curl/issues/936
|
// https://github.com/curl/curl/issues/936
|
||||||
curlCmd := fmt.Sprintf("curl --fail --silent --unix-socket %v http://localhost/configuration/general", nginx.StatusSocket)
|
curlCmd := fmt.Sprintf("curl --fail --silent http://localhost:%v/configuration/general", nginx.StatusPort)
|
||||||
|
|
||||||
output, err := f.ExecIngressPod(curlCmd)
|
output, err := f.ExecIngressPod(curlCmd)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
Loading…
Reference in a new issue