Skip to content

Commit

Permalink
Add some best practices.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolftimmermans committed Jan 24, 2018
1 parent 3d4ec19 commit 1bbb94b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Build and deploy apps to Kubernetes engine

## Prerequisites

1. A working Docker installation – https://store.docker.com/editions/community/docker-ce-desktop-mac
2. Google Cloud SDK `gcloud`https://cloud.google.com/sdk/docs/quickstart-macos

## Installing

### Option 1 – prebuilt
Expand All @@ -9,3 +14,29 @@
### Option 2 – from source
1. Make sure you have a working `go` installation
2. `go install github.com/voormedia/kd`


## Best practices for deploying

### Step 1 – adjust your app

* Configure the app to run with an application server (e.g. with `puma` for Rails).
* Make your app log to stdout/stderr instead of log files. Preferably in Google cloud compatible JSON.

### Step 2 – write a Dockerfile

* Make sure your image is small. Use a two-step build process. Use `.dockerignore` to exclude unused files.
* See https://github.com/voormedia/docker-base-images/tree/master/_examples for examples.

### Step 3 – configure deployment

* Run `kd init` and input the project details.
* Review the generated configuration and adjust where necessary.

### Step 4 – configure cloud services

* Create a PostgreSQL user and database if necessary. Use the same naming conventions as generated by `kd` in step 2. Create a secret from the service account key.

### Step 5 – deploy

* Use `kd deploy` to deploy to a target.

0 comments on commit 1bbb94b

Please sign in to comment.