Skip to content

Commit

Permalink
build: change to e2-small deployment, remove nodeport and increase de…
Browse files Browse the repository at this point in the history
…ployment sizes
  • Loading branch information
maxitect committed Nov 25, 2024
1 parent 11242e6 commit ce31780
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
run: |
if ! gcloud container clusters describe $GKE_CLUSTER --zone $GKE_ZONE; then
gcloud container clusters create $GKE_CLUSTER \
--machine-type=e2-micro \
--num-nodes=3 \
--machine-type=e2-small \
--num-nodes=1 \
--zone=$GKE_ZONE
fi
Expand Down Expand Up @@ -83,6 +83,6 @@ jobs:
- name: Deploy API and Services
run: |
sed "s/:IMAGE_TAG/:$GITHUB_SHA/" kubernetes/api-deployment.yaml | kubectl apply -f -
kubectl apply -f kubernetes/api-service.yaml
kubectl apply -f kubernetes/api-deployment.yaml
kubectl wait --for=condition=available deployment/pokelike-api --timeout=180s
10 changes: 5 additions & 5 deletions kubernetes/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ spec:
spec:
containers:
- name: pokelike-api
image: europe-west2-docker.pkg.dev/poke-like-api/pokelike-artifacts/pokelike-artifacts:latest
image: europe-west2-docker.pkg.dev/poke-like-api/pokelike-artifacts/pokelike-artifacts:IMAGE_TAG
ports:
- containerPort: 8080
resources:
requests:
cpu: "10m"
memory: "64Mi"
limits:
cpu: "25m"
cpu: "50m"
memory: "128Mi"
limits:
cpu: "100m"
memory: "256Mi"
env:
- name: ASPNETCORE_URLS
value: "http://+:8080"
Expand Down
1 change: 0 additions & 1 deletion kubernetes/api-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: Service
metadata:
name: pokelike-api
spec:
type: NodePort
ports:
- port: 80
targetPort: 8080
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/postgres-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ spec:
- containerPort: 5432
resources:
requests:
cpu: "25m"
memory: "64Mi"
limits:
cpu: "50m"
memory: "128Mi"
limits:
cpu: "100m"
memory: "256Mi"
env:
- name: POSTGRES_DB
value: PokeLikeDb
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/postgres-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: 64Mi
storage: 256Mi

0 comments on commit ce31780

Please sign in to comment.