-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jack Luar <[email protected]>
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |