Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 917 Bytes

README.md

File metadata and controls

42 lines (30 loc) · 917 Bytes

Flask Hello World on Kubernetes via Helm

Build

  • Set an environment variable with your GCP Project ID:
export GOOGLE_CLOUD_PROJECT=<PROJECT_ID>
gcloud builds submit --tag=gcr.io/${GOOGLE_CLOUD_PROJECT}/flask-helloworld src/

Run Locally

docker run -p 8080:8080 -e PORT=8080 --rm gcr.io/${GOOGLE_CLOUD_PROJECT}/flask-helloworld

Test

pytest src/tests/

Note: you may need to install pytest using pip install pytest.

Deploy

Helm

  • Complete the Build step
  • Install/ Upgrade a release
helm upgrade --install dev ./helm/ --set gcpProjectId="${GOOGLE_CLOUD_PROJECT}" --debug

Cloud Build

gcloud builds submit --config=cloudbuild.yaml --substitutions=_CLOUDSDK_COMPUTE_ZONE="<CLUSTER-ZONE>",_CLOUDSDK_CONTAINER_CLUSTER="<CLUSTER-NAME>"

Note: Make sure your cloud build service account have all the required permissions.