Skip to content

Commit

Permalink
add initial gke scaffold
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Luar <[email protected]>
  • Loading branch information
luarss committed Jan 6, 2025
1 parent 27ffb1a commit 9736e28
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ creds.json
temp_test_run_data.json
**/llm_tests_output.txt
**/error_log.txt

# deployment (Kompose files)
*-service.yaml
*-deployment.yaml
27 changes: 27 additions & 0 deletions deploy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: init

init:
@echo "Initializing project..."

format:
@echo "Formatting code..."

check:
@echo "Checking code..."

convert:
@echo "Converting docker-compose to kubernetes..."
@kompose convert -f ../docker-compose.yml

gke-up:
@echo "Deploying to kubernetes..."
@kubectl apply -f .

gke-down:
@echo "Undeploying from kubernetes..."
@kubectl delete -f .

status:
@echo "Checking status of kubernetes deployment..."
@kubectl get pods -o json
@kubectl get services -o json
42 changes: 42 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Deployment using Google Kubernetes Engine (GKE)

Why GKE? This is to maintain a cloud-agnostic Kubernetes solution
which can be easily migrated to other services if needed.

## Prerequisites

0. Install `gcloud` CLI [(guide)](https://cloud.google.com/sdk/docs/install) and
`kompose` CLI for converting `docker-compose.yml` to Kubernetes manifests
[(guide)](https://kompose.io/installation/).

Once installed, verify that these binaries are available:

```
kompose --version
gcloud --version
```

1. Authenticate GCP environment.

```bash
gcloud auth login
gcloud config set project _PROJECT_ID_
```

## Kubernetes configuration

The infrastructure consists of two nodes, as follows:
- Backend: n1-standard-32
- Frontend: n1-standard-16
- other components...

Refer to the Makefile for GKE deployment commands. This is specifically placed
in this folder to avoid confusion with the instructions in the root directory,
which creates a local deployment.

```bash
make convert
make gke-up
make gke-down
make status
```

0 comments on commit 9736e28

Please sign in to comment.