Skip to content

Commit

Permalink
Update default ports (#214)
Browse files Browse the repository at this point in the history
 - 56789: Default stats port (Previously 1936)
 - 56790: Default exporter port. Also the port used by operator to expose its own metrics.
 - 56791: HTTP port used with ACME HTTP challenge (Previously 56789)
  • Loading branch information
tamalsaha committed Jun 19, 2017
1 parent dc4afe2 commit f059bfa
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/annotations.go
Expand Up @@ -23,7 +23,7 @@ const (
StatsPort = EngressKey + "/" + "stats-port"
StatsSecret = EngressKey + "/" + "stats-secret-name"
StatsServiceName = EngressKey + "/" + "stats-service-name"
DefaultStatsPort = 1936
DefaultStatsPort = 56789

LBTypeHostPort = "HostPort"
LBTypeNodePort = "NodePort"
Expand Down
3 changes: 2 additions & 1 deletion api/monitor.go
Expand Up @@ -4,6 +4,7 @@ import "fmt"

const (
AgentCoreosPrometheus = "coreos-prometheus-operator"
DefaultExporterPort = 56790

MonitoringAgent = EngressKey + "/monitoring-agent" // COREOS_PROMETHEUS
PrometheusExporterPort = EngressKey + "/prometheus-exporter-port" // Kube NS where service monitors will be created
Expand Down Expand Up @@ -62,7 +63,7 @@ func (r Ingress) MonitorSpec() (*MonitorSpec, error) {
return nil, err
}
if prom.ExporterPort == 0 {
prom.ExporterPort = 56789
prom.ExporterPort = DefaultExporterPort
}

prom.Interval = getString(r.Annotations, ServiceMonitorScrapeInterval)
Expand Down
2 changes: 1 addition & 1 deletion chart/voyager/templates/deployment.yaml
Expand Up @@ -27,6 +27,6 @@ spec:
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
name: voyager
ports:
- containerPort: 8080
- containerPort: 56790
name: http
protocol: TCP
2 changes: 1 addition & 1 deletion chart/voyager/templates/svc.yaml
Expand Up @@ -10,7 +10,7 @@ metadata:
spec:
ports:
- name: http
port: 8080
port: 56790
targetPort: http
selector:
app: {{ template "name" . }}
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/README.md
Expand Up @@ -26,7 +26,7 @@ Now Create Your Ingress/Certificated.

#### Configuration Options
```
--address string Address to listen on for web interface and telemetry. (default ":8080")
--address string Address to listen on for web interface and telemetry. (default ":56790")
--analytics Send analytical event to Google Analytics (default true)
-c, --cloud-provider string Name of cloud provider
--haproxy-image string haproxy image name to be run (default "appscode/haproxy:1.7.6-3.0.0")
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/ingress/README.md
Expand Up @@ -130,7 +130,7 @@ Below is the full list of supported annotation keys:
| ingress.appscode.com/annotations-pod | map | x | `Optional`. Annotations applied to pods used to run HAProxy |
| ingress.appscode.com/keep-source-ip | bool | false | `Optional`. If set, preserves source IP for `LoadBalancer` type ingresses. The actual configuration generated depends on the underlying cloud provider. For gce, gke, azure: Adds annotation `service.beta.kubernetes.io/external-traffic: OnlyLocal` to services used to expose HAProxy. For aws, enforces the use of the PROXY protocol. |
| ingress.appscode.com/stats | bool | false | `Optional`. If set, HAProxy stats will be exposed |
| ingress.appscode.com/stats-port | integer | 1936 | `Optional`. Port used to expose HAProxy stats |
| ingress.appscode.com/stats-port | integer | 56789 | `Optional`. Port used to expose HAProxy stats |
| ingress.appscode.com/stats-secret-name | string | x | `Optional`. Secret used to provide username & password to secure HAProxy stats endpoint. Secret must contain keys `username` and `password` |
| ingress.appscode.com/ip | | | Removed since 1.5.6. Use `ingress.appscode.com/load-balaner-ip` |
| ingress.appscode.com/persist | | | Removed since 1.5.6. |
Expand Down
6 changes: 3 additions & 3 deletions docs/user-guide/ingress/stats-and-metrics.md
Expand Up @@ -5,7 +5,7 @@ To expose HAProxy stats, please use the following annotations:
| Keys | Value | Default | Description |
|--------|-----------|----------|-------------|
| ingress.appscode.com/stats | bool | false | `Optional`. If set, HAProxy stats will be exposed |
| ingress.appscode.com/stats-port | integer | 1936 | `Optional`. Port used to expose HAProxy stats |
| ingress.appscode.com/stats-port | integer | 56789 | `Optional`. Port used to expose HAProxy stats |
| ingress.appscode.com/stats-secret-name | string | x | `Optional`. Secret used to provide username & password to secure HAProxy stats endpoint. Secret must contain keys `username` and `password` |

Please note that stats port is not exposed to the internet via the service running in front of HAProxy pods.
Expand All @@ -20,7 +20,7 @@ Voyager operator exposes Prometheus ready metrics via the following endpoints on
To change the port, use `--address` flag on Voyager opreator.

## Using [CoreOS Prometheus Operator](https://coreos.com/operators/prometheus/docs/latest/)
Voyager operator can create [service monitors](https://coreos.com/operators/prometheus/docs/latest/user-guides/running-exporters.html#create-a-matching-servicemonitor) for HAProxy pods. If enabled, a side-car exporter pod is run with HAProxy to expose Prometheus ready metrics via the following endpoints on port `:56789`:
Voyager operator can create [service monitors](https://coreos.com/operators/prometheus/docs/latest/user-guides/running-exporters.html#create-a-matching-servicemonitor) for HAProxy pods. If enabled, a side-car exporter pod is run with HAProxy to expose Prometheus ready metrics via the following endpoints on port `:56790`:

- `/extensions/v1beta1/namespaces/:ns/ingresses/:name/pods/:ip/metrics` : Scrape this endpoint to monitor HAProxy running for a Kubernetes ingress
- `/voyager.appscode.com/v1beta1/namespaces/:ns/ingresses/:name/metrics`: Scrape this endpoint to monitor HAProxy running for an AppsCode extended ingress
Expand All @@ -30,7 +30,7 @@ To enable this feature, please use the following annotations:
| Keys | Value | Default | Description |
|--------|-----------|----------|-------------|
| ingress.appscode.com/monitoring-agent | string | | `Required`. Indicates the monitoring agent used. Only valid value currently is 'coreos-prometheus-operator' |
| ingress.appscode.com/prometheus-exporter-port| integer | 56789 | `Optional`. Indicates the port used by exporter side-car to expose Prometheus metrics endpoint. If the default port 56789 is used to expose traffic, change it to an unused port. |
| ingress.appscode.com/prometheus-exporter-port| integer | 56790 | `Optional`. Indicates the port used by exporter side-car to expose Prometheus metrics endpoint. If the default port 56790 is used to expose traffic, change it to an unused port. |
| ingress.appscode.com/service-monitor-labels | map | | `Required`. Indicates labels applied to service monitor. |
| ingress.appscode.com/service-monitor-namespace| string | | `Required`. Indicates namespace where service monitors are created. This must be the same namespace of the Prometheus instance. |
| ingress.appscode.com/service-monitor-endpoint-scrape-interval | string | | `Optional`. Indicates the srace interval for HAProxy exporter endpoint
Expand Down
4 changes: 2 additions & 2 deletions hack/deploy/deployments.yaml
Expand Up @@ -23,7 +23,7 @@ spec:
- --v=3
image: appscode/voyager:$TAG
ports:
- containerPort: 8080
- containerPort: 56790
name: http
protocol: TCP
---
Expand All @@ -37,7 +37,7 @@ metadata:
spec:
ports:
- name: http
port: 8080
port: 56790
targetPort: http
selector:
app: voyager-operator
3 changes: 2 additions & 1 deletion run.go
Expand Up @@ -9,6 +9,7 @@ import (
hpe "github.com/appscode/haproxy_exporter/exporter"
"github.com/appscode/log"
"github.com/appscode/pat"
"github.com/appscode/voyager/api"
acs "github.com/appscode/voyager/client/clientset"
_ "github.com/appscode/voyager/client/clientset/fake"
"github.com/appscode/voyager/pkg/analytics"
Expand All @@ -29,7 +30,7 @@ var (
ingressClass string
enableAnalytics bool = true

address string = ":8080"
address string = fmt.Sprintf(":%d", api.DefaultExporterPort)
haProxyServerMetricFields string = hpe.ServerMetrics.String()
haProxyTimeout time.Duration = 5 * time.Second

Expand Down

0 comments on commit f059bfa

Please sign in to comment.