robjuz / helm-charts

https://robjuz.github.io/helm-charts/index.yaml
34 stars 30 forks source link

Nominatim Chart: Add service annotations for type LoadBalancer #25

Closed TheBaus closed 1 year ago

TheBaus commented 1 year ago

The current service.yaml template does not allow annotations to be specified when using:

  service:
    type: LoadBalancer

Consider allowing annotations under the service template, this will allow users who run this in cloud environments to specify annotations to control their load balancers.

An example values file with the aws load balancer controller on EKS:

   service:
    type: LoadBalancer
    port: 8080
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
      service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"
      service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
      service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol: tcp
      service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: traffic-port
      service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
      service.beta.kubernetes.io/aws-load-balancer-internal: "true"
      service.beta.kubernetes.io/aws-load-balancer-name: "nominatim-nlb"
      external-dns.alpha.kubernetes.io/hostname: "nominatim.example.com"

An example service.yaml template that allows the above:

apiVersion: v1
kind: Service
metadata:
  name: {{ include "nominatim.fullname" . }}
  labels:
    {{- include "nominatim.labels" . | nindent 4 }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: http
      protocol: TCP
      name: http
  selector:
    {{- include "nominatim.selectorLabels" . | nindent 4 }}
robjuz commented 1 year ago

@TheBaus I just released 3.1.0 version of the chart. You can now add service annotations

TheBaus commented 1 year ago

Excellent, thank you so much @robjuz