Use authbind to bind privileged ports
This commit is contained in:
parent
e2f5d9066e
commit
b148f113ae
14 changed files with 48 additions and 69 deletions
|
|
@ -77,7 +77,7 @@ func NewController(pod, namespace, class string) *Controller {
|
|||
prometheus.GaugeOpts{
|
||||
Namespace: PrometheusNamespace,
|
||||
Name: "config_last_reload_successful",
|
||||
Help: "Whether the last configuration reload attemp was successful",
|
||||
Help: "Whether the last configuration reload attempt was successful",
|
||||
ConstLabels: constLabels,
|
||||
}),
|
||||
configSuccessTime: prometheus.NewGauge(
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
func TestControllerCounters(t *testing.T) {
|
||||
const metadata = `
|
||||
# HELP nginx_ingress_controller_config_last_reload_successful Whether the last configuration reload attemp was successful
|
||||
# HELP nginx_ingress_controller_config_last_reload_successful Whether the last configuration reload attempt was successful
|
||||
# TYPE nginx_ingress_controller_config_last_reload_successful gauge
|
||||
# HELP nginx_ingress_controller_success Cumulative number of Ingress controller reload operations
|
||||
# TYPE nginx_ingress_controller_success counter
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
|
@ -95,7 +96,13 @@ var (
|
|||
// NewSocketCollector creates a new SocketCollector instance using
|
||||
// the ingresss watch namespace and class used by the controller
|
||||
func NewSocketCollector(pod, namespace, class string) (*SocketCollector, error) {
|
||||
listener, err := net.Listen("unix", "/tmp/prometheus-nginx.socket")
|
||||
socket := "/tmp/prometheus-nginx.socket"
|
||||
listener, err := net.Listen("unix", socket)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = os.Chmod(socket, 0777)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue