Skip to content

Commit

Permalink
fix(aws-eks-tutorial): use alb ingress instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-acosta committed Mar 3, 2024
1 parent d932300 commit 028d809
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 102 deletions.
1 change: 1 addition & 0 deletions aws-eks-tutorial/components/certificate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ module "certificate" {

domain_name = var.domain_name
zone_id = var.zone_id
validation_method = "DNS"
wait_for_validation = false
}
47 changes: 47 additions & 0 deletions aws-eks-tutorial/components/helm-chart/templates/api_alb.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "common.fullname" . }}-api
namespace: {{ .Release.Namespace }}
labels:
{{- include "common.apiLabels" . | nindent 4 }}
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]'
{{- /*
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/certificate-arn: {{ .Values.api.nlbs.public_domain_certificate }}
alb.ingress.kubernetes.io/aws-load-balancer-ssl-ports: https
*/}}
alb.ingress.kubernetes.io/healthcheck-path: /livez
external-dns.alpha.kubernetes.io/hostname: {{ .Values.api.nlbs.public_domain }}
spec:
ingressClassName: alb
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "common.fullname" . }}-api
port:
name: http
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.fullname" . }}-api
namespace: {{ .Release.Namespace }}
labels:
{{- include "common.apiLabels" . | nindent 4 }}
spec:
selector:
{{- include "common.apiSelectorLabels" . | nindent 4 }}
type: ClusterIP
ports:
- name: http
port: 8080
targetPort: http

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- name: http
containerPort: 8080
hostPort: 8080
readinessProbe: null
livenessProbe: null
containerPort: {{ .Values.api.port }}
protocol: TCP
readinessProbe:
httpGet:
path: {{ .Values.api.readiness_probe}}
port: http
livenessProbe:
httpGet:
path: {{ .Values.api.liveness_probe}}
port: http
resources:
limits:
cpu: 100m
Expand Down
27 changes: 0 additions & 27 deletions aws-eks-tutorial/components/helm-chart/templates/api_ingress.tpl

This file was deleted.

31 changes: 0 additions & 31 deletions aws-eks-tutorial/components/helm-chart/templates/api_nlbs.tpl

This file was deleted.

16 changes: 0 additions & 16 deletions aws-eks-tutorial/components/helm-chart/templates/api_service.tpl

This file was deleted.

13 changes: 4 additions & 9 deletions aws-eks-tutorial/components/helm-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
---
env:
DATABASE_URL: ""
AUTH_MODE: ""
LOGICAL_PUBLISHER_HOST: ""
PG_PROXY_PASSWORD: ""

image:
repository: ""
Expand All @@ -15,13 +11,12 @@ serviceAccount:

api:
port: 8080

ingresses:
public_domain: api.INSTALL_PUBLIC_DOMAIN
readinessProbe: /readyz
livenessProbe: /livez

nlbs:
public_domain: nlb.INSTALL_PUBLIC_DOMAIN
public_domain_certificate: nbl.PUBLIC_DOMAIN_CERTIFICATE
public_domain: ""
public_domain_certificate: ""

autoscaling:
minReplicas: 1
Expand Down

0 comments on commit 028d809

Please sign in to comment.