Skip to content

Commit

Permalink
feat(kubernetes): finished manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
neilscallywag committed Apr 22, 2024
1 parent f7b7810 commit f8fc383
Show file tree
Hide file tree
Showing 23 changed files with 655 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/complex/process-chunks/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ CONTENT_SERVICE_ADDRESS=contents-service:50051
RABBITMQ_SERVER=rabbitmq
RABBITMQ_USERNAME=user
RABBITMQ_PASSWORD=password
OPENAI_API_KEYS= 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
OPENAI_API_KEYS=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
# ,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,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,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,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,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,
2 changes: 2 additions & 0 deletions deployment/docker/docker-compose.submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ services:

upload-notes:
image: paolorafael/upload-notes:1.0
env_file:
- ../../backend/complex/upload-notes/.env
depends_on:
rabbitmq:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: handle-temporary-contents
namespace: eduhelper
spec:
replicas: 2
selector:
matchLabels:
app: handle-temporary-contents
template:
metadata:
labels:
app: handle-temporary-contents
spec:
containers:
- name: handle-temporary-contents
image: 397789365835.dkr.ecr.ap-southeast-1.amazonaws.com/esd-eduhelper-eks-ecr-production:handle-temporary-contents
imagePullPolicy: Always
ports:
- containerPort: 50051
env:
- name: GRPC_SERVER_ADDRESS
value: "0.0.0.0:50051"
- name: CONTENT_SERVICE_HOST
value: "contents"
- name: CONTENT_SERVICE_PORT
value: "50051"
- name: NOTES_SERVICE_HOST
value: "notes"
- name: NOTES_SERVICE_PORT
value: "50052"
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:50051"]
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:50051"]
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: handle-temporary-contents
namespace: eduhelper
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: handle-temporary-contents
minReplicas: 1
maxReplicas: 6
behavior:
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
periodSeconds: 15
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 100
periodSeconds: 15
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: handle-temporary-contents
namespace: eduhelper
spec:
selector:
app: handle-temporary-contents
ports:
- protocol: TCP
port: 50051
targetPort: 50051
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: make-payment
namespace: eduhelper
spec:
replicas: 2
selector:
matchLabels:
app: make-payment
template:
metadata:
labels:
app: make-payment
spec:
containers:
- name: make-payment
image: 397789365835.dkr.ecr.ap-southeast-1.amazonaws.com/esd-eduhelper-eks-ecr-production:make-payment
imagePullPolicy: Always
ports:
- containerPort: 50051
env:
- name: GRPC_SERVER_ADDRESS
value: "0.0.0.0:50051"
- name: SUBSCRIPTION_SERVICE_HOST
value: "subscriptions"
- name: SUBSCRIPTION_SERVICE_PORT
value: "50051"
- name: PAYMENT_SERVICE_HOST
value: "payment"
- name: PAYMENT_SERVICE_PORT
value: "50051"
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:50051"]
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:50051"]
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: make-payment
namespace: eduhelper
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: make-payment
minReplicas: 1
maxReplicas: 6
behavior:
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
periodSeconds: 15
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 100
periodSeconds: 15
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: make-payment
namespace: eduhelper
spec:
selector:
app: make-payment
ports:
- protocol: TCP
port: 50051
targetPort: 50051
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: save-notes
namespace: eduhelper
spec:
replicas: 2
selector:
matchLabels:
app: save-notes
template:
metadata:
labels:
app: save-notes
spec:
containers:
- name: save-notes
image: 397789365835.dkr.ecr.ap-southeast-1.amazonaws.com/esd-eduhelper-eks-ecr-production:save-notes
imagePullPolicy: Always
ports:
- containerPort: 50051
env:
- name: CONTENT_SERVICE_ADDRESS
value: "contents:50051"
- name: RABBITMQ_SERVER
valueFrom:
secretKeyRef:
key: RABBITMQ_HOST
name: eks-secrets
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
key: RABBITMQ_USERNAME
name: eks-secrets
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
key: RABBITMQ_PASSWORD
name: eks-secrets
- name: OPENAI_API_KEYS
valueFrom:
secretKeyRef:
key: OPENAI_API_KEYS
name: eks-secrets
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: save-notes
namespace: eduhelper
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: save-notes
minReplicas: 1
maxReplicas: 6
behavior:
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
periodSeconds: 15
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 100
periodSeconds: 15
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: save-notes
namespace: eduhelper
spec:
selector:
app: save-notes
ports:
- protocol: TCP
port: 50051
targetPort: 50051
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: save-notes
namespace: eduhelper
spec:
replicas: 2
selector:
matchLabels:
app: save-notes
template:
metadata:
labels:
app: save-notes
spec:
containers:
- name: save-notes
image: 397789365835.dkr.ecr.ap-southeast-1.amazonaws.com/esd-eduhelper-eks-ecr-production:save-notes
imagePullPolicy: Always
ports:
- containerPort: 50051
env:
- name: ENVIRONMENT_MODE
value: "development"
- name: USER_STORAGE_SERVICE_HOST
value: "user-storage"
- name: USER_STORAGE_SERVICE_PORT
value: "50051"
- name: NOTES_SERVICE_HOST
value: "notes"
- name: NOTES_SERVICE_PORT
value: "50052"
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:50051"]
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:50051"]
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: save-notes
namespace: eduhelper
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: save-notes
minReplicas: 1
maxReplicas: 6
behavior:
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
periodSeconds: 15
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 100
periodSeconds: 15
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
Loading

0 comments on commit f8fc383

Please sign in to comment.