Skip to content

Commit

Permalink
Merge pull request #15 from postech-5soat-grupo-25/kustomize-fase-5
Browse files Browse the repository at this point in the history
adding ingress file and env vars
  • Loading branch information
MatheusBLopes authored Sep 11, 2024
2 parents f4a7ee0 + e75794d commit 69172b5
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
CARGO_TERM_COLOR: always
ECR_RUST_API_REPOSITORY: rust_api
ECR_RUST_API_REPOSITORY: pedido_produto_api
ECR_DJANGO_API_REPOSITORY: django_api
EKS_CLUSTER_NAME: tech-challenge
AWS_REGION: us-east-1
Expand Down
2 changes: 1 addition & 1 deletion kustomize/app-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: rust-app-container
image: 739842188003.dkr.ecr.us-east-1.amazonaws.com/rust_api:latest
image: 891376965147.dkr.ecr.us-east-1.amazonaws.com/pedido_produto_api:latest
ports:
- containerPort: 3000
envFrom:
Expand Down
5 changes: 2 additions & 3 deletions kustomize/app-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: rust-app-nodeport-svc
name: rust-app-cluster-ip-svc
spec:
type: NodePort
type: ClusterIP
selector:
app: rust-app
ports:
- protocol: TCP
port: 3000
targetPort: 3000
nodePort: 31200

---

Expand Down
4 changes: 3 additions & 1 deletion kustomize/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ data:
DB_URL: postgresql://mainuser:mainpassword@tech-challenge-db.cra60s8i0ksr.us-east-1.rds.amazonaws.com:5432/TechChallengeDb
MOCK_PAGAMENTOS_URL: http://a49bcfc17b0814367b7de1fa4f286728-1742838876.us-east-1.elb.amazonaws.com:9000/payment/
API_HOST: aad8d67d34e714d6885106d5c3d06077-1355197257.us-east-1.elb.amazonaws.com:3000
AWS_COGNITO_USER_POOL_ID: us-east-1_YZhnEtbAT
AWS_COGNITO_USER_POOL_ID: us-east-1_YZhnEtbAT
QUEUE_NAME: pagamento-queue
RABBITMQ_URL: amqp://rabbitmq:rabbitmq@rabbitmq-service:5672/%2f
41 changes: 41 additions & 0 deletions kustomize/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tech-challenge-ingress
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/group.name: "my-api-ingress-group"
spec:
rules:
- host: "pagamento.tech-challenge.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: pagamentos-service
port:
number: 80
- host: "usuario-cliente.tech-challenge.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: usuario-cliente-app-cluster-ip-svc
port:
number: 80
- host: "pedido-produto.tech-challenge.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: rust-app-cluster-ip-svc
port:
number: 80

0 comments on commit 69172b5

Please sign in to comment.