Skip to content

Commit

Permalink
add annotation to configure ALB ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
cnorthwood committed Oct 11, 2024
1 parent adb6bb3 commit dc64a24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cdk/app/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ def _expose_v0_api(self, host: str, app_service: Service):
ingress = Ingress(self, "LocalOfficeSearchApiV0Ingress", class_name="alb")
ingress.add_host_rule(host, "/api/v0/", IngressBackend.from_service(app_service))

ingress.metadata.add_annotation("alb.ingress.kubernetes.io/scheme", "internet-facing")
ingress.metadata.add_annotation("alb.ingress.kubernetes.io/healthcheck-path", "/status")
ingress.metadata.add_annotation("alb.ingress.kubernetes.io/actions.ssl-redirect", json.dumps({"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}))
ingress.metadata.add_annotation("alb.ingress.kubernetes.io/ssl-policy", "ELBSecurityPolicy-TLS-1-2-2017-01")
ingress.metadata.add_annotation("alb.ingress.kubernetes.io/tags", f"Environment={self._labels['env']},Product=corporate_site,Component=local_office_search_api,TechnicalOwner=contentplatform@citizensadvice.org.uk")

def _configure_autoscaler(self, deployment: Deployment):
HorizontalPodAutoscaler(
self,
Expand Down

0 comments on commit dc64a24

Please sign in to comment.