Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
chore: adiciona configuração do ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
jefersonhuan committed Oct 1, 2024
1 parent 3be4be6 commit 0ad24ca
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 93 deletions.
75 changes: 0 additions & 75 deletions database/seed/00.sql

This file was deleted.

6 changes: 0 additions & 6 deletions database/seed/reset.sql

This file was deleted.

17 changes: 7 additions & 10 deletions deploy/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
app: tech-challenge
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: tech-challenge
Expand All @@ -16,28 +16,25 @@ spec:
spec:
containers:
- name: tech-challenge-container
image: ghcr.io/pangolin-do-golang/tech-challenge:7c14309
image: 872515278821.dkr.ecr.us-east-1.amazonaws.com/dev-tech-challange:v1.0.8
ports:
- containerPort: 8080

env:
- name: DB_USERNAME
value: postgres.jhwmlvbsmtyluoccjabw
value: "tech_challenge_user"

- name: DB_HOST
value: aws-0-sa-east-1.pooler.supabase.com
value: "terraform-20240930234611514100000001.czk8emokqsrn.us-east-1.rds.amazonaws.com"

- name: DB_NAME
value: postgres
value: tech_challenge

- name: DB_PORT
value: "6543"
value: "5432"

- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-password-secret
key: db-password
value: bXlzZWN1cmVwYXNzd29yZA==

livenessProbe:
httpGet:
Expand Down
11 changes: 11 additions & 0 deletions deploy/k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tech-challenge-ingress
spec:
ingressClassName: external-ingress
defaultBackend:
service:
name: tech-challenge-service
port:
number: 8080
2 changes: 1 addition & 1 deletion deploy/k8s/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ spec:
app: tech-challenge
ports:
- protocol: TCP
port: 80
port: 8080
targetPort: 8080
2 changes: 1 addition & 1 deletion internal/adapters/rest/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (rs RestServer) Serve() {
handler.RegisterCartHandlers(r, rs.cartService)
handler.RegisterCustomerHandlers(r, rs.customerService)
handler.RegisterSwaggerHandlers(r)
err := r.Run()
err := r.Run("0.0.0.0:8080")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 0ad24ca

Please sign in to comment.