Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposes metrics ports on pods in order to enable GCP Managed Prometheus #2712

Merged
merged 9 commits into from
Sep 1, 2022
2 changes: 2 additions & 0 deletions install/helm/agones/templates/service/allocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ spec:
- name: {{ .Values.agones.allocator.service.grpc.portName }}
containerPort: {{ .Values.agones.allocator.service.grpc.targetPort }}
{{- end }}
- name: {{ .Values.agones.allocator.serviceMetrics.http.portName }}
containerPort: {{ .Values.agones.allocator.serviceMetrics.http.port }}
{{- if eq .Values.agones.allocator.disableTLS false }}
volumeMounts:
- mountPath: /home/allocator/tls
Expand Down
10 changes: 7 additions & 3 deletions site/content/en/docs/Guides/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ We plan to support multiple exporters in the future via environment variables an

If you are running a [Prometheus](https://prometheus.io/) instance you just need to ensure that metrics and kubernetes service discovery are enabled. (helm chart values `agones.metrics.prometheusEnabled` and `agones.metrics.prometheusServiceDiscovery`). This will automatically add annotations required by Prometheus to discover Agones metrics and start collecting them. (see [example](https://github.com/prometheus/prometheus/tree/main/documentation/examples/kubernetes-rabbitmq))

{{% feature publishVersion="1.26.0" %}}
If your Prometheus metrics collection agent requires that you scrape from the pods directly(such as with Google Cloud Managed Prometheus), then the metrics ports for the controller and allocator will both be named `http` and exposed on `8080`. In the case of the allocator, the port name and number can be overriden with the `agones.allocator.serviceMetrics.http.portName` and `agones.allocator.serviceMetrics.http.port` helm chart values.
austin-space marked this conversation as resolved.
Show resolved Hide resolved
{{% /feature %}}

### Prometheus Operator

If you have [Prometheus operator](https://github.com/coreos/prometheus-operator) installed in your cluster, just enable ServiceMonitor installation in values:
Expand Down Expand Up @@ -141,7 +145,7 @@ gcloud container node-pools create agones-metrics --cluster=... --zone=... \
By default we will disable the push gateway (we don't need it for Agones) and other exporters.

The helm chart supports
[nodeSelector](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector),
[nodeSelector](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector),
[affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) and [toleration](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/), you can use them to schedule Prometheus deployments on an isolated node(s) to have an homogeneous game servers workload.

This will install a Prometheus Server in your current cluster with [Persistent Volume Claim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) (Deactivated for Minikube and Kind) for storing and querying time series, it will automatically start collecting metrics from Agones Controller.
Expand Down Expand Up @@ -172,8 +176,8 @@ First we will install [Agones dashboard](#grafana-dashboards) as [config maps](h
kubectl apply -f ./build/grafana/
```

Now we can install the
[Grafana Community Kubernetes Helm Charts](https://grafana.github.io/helm-charts/) from
Now we can install the
[Grafana Community Kubernetes Helm Charts](https://grafana.github.io/helm-charts/) from
their repository. (Replace `<your-admin-password>` with the admin password of your choice)

```bash
Expand Down