From c72ac4d8d746668d491585e00ea0cfaa059d80ef Mon Sep 17 00:00:00 2001 From: Henri Kovanen Date: Mon, 27 Feb 2023 15:19:16 +0200 Subject: [PATCH] feat: Add support for loadBalancerIP in service configuration (#198 * feat: Add support for loadBalancerIP in service configuration * refactor: use an array in service.loadBalancer values --- helm-charts/azure-api-management-gateway/README.md | 1 + .../azure-api-management-gateway/templates/service.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/helm-charts/azure-api-management-gateway/README.md b/helm-charts/azure-api-management-gateway/README.md index 5258399..b3aa378 100644 --- a/helm-charts/azure-api-management-gateway/README.md +++ b/helm-charts/azure-api-management-gateway/README.md @@ -110,6 +110,7 @@ their default values. | `observability.statsD.tagFormat` | Defines the [tagging format](https://github.com/prometheus/statsd_exporter#tagging-extensions) in StatsD metrics as per the official docs. Value can be `none`, `librato`, `dogStatsD`, `influxDB`. Learn more in [our documentation](https://docs.microsoft.com/azure/api-management/how-to-configure-local-metrics-logs#configure-the-self-hosted-gateway-to-emit-metrics). | N/A | | `service.type` | Type of Kubernetes service to use to expose to serve traffic | `ClusterIP` | | `service.annotations` | Annotations to add to the Kubernetes service | `{}` | +| `service.loadBalancer.ip` | Attach a pre-existing static IP to a `LoadBalancer` type service. Learn more in the [Kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer). | | | `service.ports.http` | Port for HTTP traffic on service for other pods to talk to | `8080` | | `service.ports.https` | Port for HTTPs traffic on service for other pods to talk to | `8081` | | `service.ports.instance.synchronization` | Port used for internal discovery of gateway instances to synchronize across all of them, ie for rate limiting. | `4290` | diff --git a/helm-charts/azure-api-management-gateway/templates/service.yaml b/helm-charts/azure-api-management-gateway/templates/service.yaml index 91ddfeb..8918b99 100644 --- a/helm-charts/azure-api-management-gateway/templates/service.yaml +++ b/helm-charts/azure-api-management-gateway/templates/service.yaml @@ -10,6 +10,9 @@ metadata: {{- end }} spec: type: {{ .Values.service.type }} +{{- if (.Values.service.loadBalancer).ip }} + loadBalancerIP: {{ .Values.service.loadBalancer.ip }} +{{- end }} ports: - port: {{ .Values.service.ports.http }} targetPort: http