Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions infra/k8s/apps/spot-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: spot-gateway
image: spot-registry.localhost:5111/spot-gateway:latest
image: 322546275072.dkr.ecr.ap-northeast-2.amazonaws.com/spot-gateway:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand All @@ -35,8 +35,8 @@ spec:
readOnly: true
resources:
requests:
memory: "512Mi"
cpu: "500m"
memory: "256Mi"
cpu: "75m"
limits:
memory: "1Gi"
cpu: "800m"
Expand Down
15 changes: 10 additions & 5 deletions infra/k8s/apps/spot-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: spot-ingress
name: aws-ingress
namespace: spot
annotations:
kubernetes.io/ingress.class: nginx
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip # IP 모드
alb.ingress.kubernetes.io/healthcheck-path: /actuator/health
alb.ingress.kubernetes.io/success-codes: "200" # 헬스 체크 성공 코드
alb.ingress.kubernetes.io/load-balancer-name: spot-dev-alb # tf위한 이름 고정
spec:
ingressClassName: nginx
ingressClassName: alb
rules:
- host: spot.localhost
# spot
- host: spotorder.org
http:
paths:
- path: /
Expand All @@ -20,7 +25,7 @@ spec:
number: 80

# kafka
- host: kafka.localhost
- host: kafka.spotorder.org
http:
paths:
- path: /
Expand Down
6 changes: 3 additions & 3 deletions infra/k8s/apps/spot-order.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: spot-order
image: spot-registry.localhost:5111/spot-order:latest
image: 322546275072.dkr.ecr.ap-northeast-2.amazonaws.com/spot-order
imagePullPolicy: Always
ports:
- containerPort: 8082
Expand All @@ -35,8 +35,8 @@ spec:
readOnly: true
resources:
requests:
memory: "512Mi"
cpu: "500m"
memory: "256Mi"
cpu: "75m"
limits:
memory: "1Gi"
cpu: "800m"
Expand Down
6 changes: 3 additions & 3 deletions infra/k8s/apps/spot-payment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: spot-payment
image: spot-registry.localhost:5111/spot-payment:latest
image: 322546275072.dkr.ecr.ap-northeast-2.amazonaws.com/spot-payment
imagePullPolicy: Always
ports:
- containerPort: 8084
Expand All @@ -35,8 +35,8 @@ spec:
readOnly: true
resources:
requests:
memory: "512Mi"
cpu: "500m"
memory: "256Mi"
cpu: "75m"
limits:
memory: "1Gi"
cpu: "800m"
Expand Down
6 changes: 3 additions & 3 deletions infra/k8s/apps/spot-store.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: spot-store
image: spot-registry.localhost:5111/spot-store:latest
image: 322546275072.dkr.ecr.ap-northeast-2.amazonaws.com/spot-store
imagePullPolicy: Always
ports:
- containerPort: 8083
Expand All @@ -35,8 +35,8 @@ spec:
readOnly: true
resources:
requests:
memory: "512Mi"
cpu: "500m"
memory: "256Mi"
cpu: "75m"
limits:
memory: "1Gi"
cpu: "800m"
Expand Down
6 changes: 3 additions & 3 deletions infra/k8s/apps/spot-user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: spot-user
image: spot-registry.localhost:5111/spot-user:latest
image: 322546275072.dkr.ecr.ap-northeast-2.amazonaws.com/spot-user
imagePullPolicy: Always
ports:
- containerPort: 8081
Expand All @@ -35,8 +35,8 @@ spec:
readOnly: true
resources:
requests:
memory: "512Mi"
cpu: "500m"
memory: "256Mi"
cpu: "75m"
limits:
memory: "1Gi"
cpu: "800m"
Expand Down
12 changes: 1 addition & 11 deletions infra/k8s/base/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: spot-common-config
name: spot-app-config
namespace: spot
data:
SPRING_DATASOURCE_URL: "jdbc:postgresql://postgres:5432/myapp_db"
Expand All @@ -10,13 +10,3 @@ data:
SPRING_DATA_REDIS_PORT: "6379"
KAFKA_BOOTSTRAP_SERVERS: "kafka:9092"
---
apiVersion: v1
kind: Secret
metadata:
name: monitoring-secrets
namespace: monitoring
type: Opaque
stringData:
GF_SECURITY_ADMIN_USER: "spot"
GF_SECURITY_ADMIN_PASSWORD: "spot-grafana"
---
2 changes: 1 addition & 1 deletion infra/k8s/base/kafka/allow-kafka-ui-netpol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-kafka-ui-to-connect
namespace: spot
namespace: kafka
spec:
podSelector:
matchLabels:
Expand Down
8 changes: 4 additions & 4 deletions infra/k8s/base/kafka/connectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: kafka.strimzi.io/v1
kind: KafkaConnector
metadata:
name: order-outbox-connector
namespace: spot
namespace: kafka
labels:
# 이전에 만든 KafkaConnect 리소스 이름(spot-connect)과 반드시 일치해야 함
strimzi.io/cluster: spot-connect
Expand All @@ -14,7 +14,7 @@ spec:
database.port: "5432"
database.user: "${env:SPRING_DATASOURCE_USERNAME}"
database.password: "${env:SPRING_DATASOURCE_PASSWORD}"
database.dbname: "${env:DB_NAME}"
database.dbname: "spotdb"
topic.prefix: "order_outbox_cdc"
plugin.name: "pgoutput"
slot.name: "order_outbox_slot"
Expand Down Expand Up @@ -47,7 +47,7 @@ apiVersion: kafka.strimzi.io/v1
kind: KafkaConnector
metadata:
name: payment-outbox-connector
namespace: spot
namespace: kafka
labels:
strimzi.io/cluster: spot-connect
spec:
Expand All @@ -58,7 +58,7 @@ spec:
database.port: "5432"
database.user: "${env:SPRING_DATASOURCE_USERNAME}"
database.password: "${env:SPRING_DATASOURCE_PASSWORD}"
database.dbname: "${env:DB_NAME}"
database.dbname: "spotdb"
topic.prefix: "payment_outbox_cdc"
plugin.name: "pgoutput"
slot.name: "payment_outbox_slot"
Expand Down
22 changes: 12 additions & 10 deletions infra/k8s/base/kafka/kafka-connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@ apiVersion: kafka.strimzi.io/v1
kind: KafkaConnect
metadata:
name: spot-connect
namespace: spot
namespace: kafka
annotations:
strimzi.io/use-connector-resources: "true"
spec:
version: 4.0.0
replicas: 2
replicas: 1
bootstrapServers: spot-cluster-kafka-bootstrap:9092
image: spot-registry.localhost:5111/spot-connect-custom:latest

image: 322546275072.dkr.ecr.ap-northeast-2.amazonaws.com/spot-kafka-connect:3.4.0
groupId: spot-connect-group
configStorageTopic: connect_configs
offsetStorageTopic: connect_offsets
statusStorageTopic: connect_status



config:
config.storage.replication.factor: 3
offset.storage.replication.factor: 3
status.storage.replication.factor: 3

config.storage.replication.factor: 1
offset.storage.replication.factor: 1
status.storage.replication.factor: 1


key.converter: org.apache.kafka.connect.json.JsonConverter
value.converter: org.apache.kafka.connect.json.JsonConverter
Expand Down Expand Up @@ -57,8 +59,8 @@ spec:

resources:
requests:
cpu: "500m"
memory: "512Mi"
cpu: "200m"
memory: "128Mi"
limits:
cpu: "1000m"
memory: "1Gi"
6 changes: 3 additions & 3 deletions infra/k8s/base/kafka/kafka-nodepool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: kafka.strimzi.io/v1
kind: KafkaNodePool
metadata:
name: kafka-nodes
namespace: spot
namespace: kafka
labels:
strimzi.io/cluster: spot-cluster
spec:
replicas: 3
replicas: 1
roles:
- broker
- controller
Expand All @@ -19,7 +19,7 @@ spec:
deleteClaim: true
resources:
requests:
memory: 512Mi
memory: 128Mi
cpu: 250m
limits:
memory: 1Gi
Expand Down
4 changes: 2 additions & 2 deletions infra/k8s/base/kafka/kafka-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-ui
namespace: spot
namespace: kafka
spec:
replicas: 1
selector:
Expand All @@ -20,7 +20,7 @@ spec:
- containerPort: 8080
resources:
requests:
memory: "384Mi"
memory: "75Mi"
cpu: "100m"
env:
- name: KAFKA_CLUSTERS_0_NAME
Expand Down
13 changes: 7 additions & 6 deletions infra/k8s/base/kafka/kafka.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: kafka.strimzi.io/v1
kind: Kafka
metadata:
name: spot-cluster
namespace: spot
namespace: kafka
spec:
kafka:
version: 4.0.0
Expand All @@ -18,13 +18,14 @@ spec:
tls: false
config:
process.roles: "broker,controller"
offsets.topic.replication.factor: 3
transaction.state.log.replication.factor: 3
transaction.state.log.min.isr: 2
default.replication.factor: 3
min.insync.replicas: 2
offsets.topic.replication.factor: 1
transaction.state.log.replication.factor: 1
transaction.state.log.min.isr: 1
default.replication.factor: 1
min.insync.replicas: 1
auto.create.topics.enable: "true"
num.partitions: 3
entityOperator:
topicOperator: {}
userOperator: {}

1 change: 1 addition & 0 deletions infra/k8s/base/monitoring/grafana/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
resources:
requests:
storage: 1Gi
storageClassName: gp3
---
apiVersion: apps/v1
kind: Deployment
Expand Down
1 change: 1 addition & 0 deletions infra/k8s/base/monitoring/loki/loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
resources:
requests:
storage: 2Gi
storageClassName: gp3
---
apiVersion: apps/v1
kind: Deployment
Expand Down
12 changes: 8 additions & 4 deletions infra/k8s/base/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
resources:
requests:
storage: 1Gi
storageClassName: gp3
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -41,20 +42,23 @@ spec:
secretKeyRef:
name: spot-secrets
key: SPRING_DATASOURCE_PASSWORD
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
resources:
requests:
memory: "256Mi"
cpu: "250m"
memory: 256Mi
cpu: 100m
limits:
memory: "512Mi"
cpu: "500m"
memory: 512Mi
cpu: 500m
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc

---
apiVersion: v1
kind: Service
Expand Down
10 changes: 10 additions & 0 deletions infra/k8s/base/storageclass-gp3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp3
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
parameters:
type: gp3
fsType: ext4
Loading