ch4/planpalto-helm/templates/ingress.yaml

38 lines
1.7 KiB
YAML

{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: planpal
namespace: {{ include "planpal.namespace" . }}
annotations:
argocd.argoproj.io/sync-wave: "3"
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80},{"HTTPS":443}]'
alb.ingress.kubernetes.io/certificate-arn: {{ .Values.ingress.certArn }}
alb.ingress.kubernetes.io/healthcheck-path: {{ .Values.ingress.healthcheckPath }}
# ALB per release: group.name defaults to the release name, so each install
# gets its own load balancer. Set the same ingress.groupName on two releases
# to make them share one ALB instead.
alb.ingress.kubernetes.io/group.name: {{ .Values.ingress.groupName | default .Release.Name }}
{{- if .Values.ingress.externalDNS }}
# external-dns creates the Route53 record for this host from the rule below.
# This annotation is only needed when the record name differs from the host.
external-dns.alb.ingress.kubernetes.io/hostname: {{ .Values.ingress.host }}
{{- end }}
# ponytail: HTTP:80 and HTTPS:443 both open, no forced redirect. Add the
# ssl-redirect annotation later to push 80 -> 443.
spec:
ingressClassName: {{ .Values.ingress.className }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /api/v1
pathType: Prefix
backend: { service: { name: backend, port: { number: {{ .Values.apps.backend.service.port }} } } }
- path: /
pathType: Prefix
backend: { service: { name: frontend, port: { number: {{ .Values.apps.frontend.service.port }} } } }
{{- end }}