Giter Site home page Giter Site logo

k8s-colors's Introduction

README

Running the app locally

docker-compose up -d
docker-compose exec colors rake db:create db:migrate
open http://localhost:3000

Building and pushing the image to remote repository

docker build . -t stabenfeldt/colors:latest
docker push stabenfeldt/colors:latest

Create a GCP cluster

gcloud container clusters create color-cluster --num-nodes=2

Setup PostgreSQL at GCP

Follow instructions in https://cloud.google.com/sql/docs/postgres/connect-kubernetes-engine?authuser=1 Update your config/database.yml and k8s/colors.yml with these values.

Deploy your app

export PROJECT_ID="your-project-id"
./update-vars-and-run.sh
kubectl get pods

	NAME                    READY     STATUS    RESTARTS   AGE
	colors-d9f744dc-8svw5   2/2       Running   0          58m
	colors-d9f744dc-bpwzm   2/2       Running   0          58m

kubectl logs colors-d9f744dc-8svw5 -c colors
	=> Booting Puma
	=> Rails 5.2.0 application starting in development
	=> Run `rails server -h` for more startup options
	Puma starting in single mode...
	* Version 3.11.4 (ruby 2.4.4-p296), codename: Love Song
	* Min threads: 5, max threads: 5
	* Environment: development
	* Listening on tcp://0.0.0.0:3000

Connect to your Rails app

First, check what your external IP is:

kubectl get svc
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE
colors       LoadBalancer   10.55.245.192   35.228.111.217   80:30746/TCP   1h
kubernetes   ClusterIP      10.55.240.1     <none>           443/TCP        1h
curl 35.228.111.217 # => No response! :-/

Why will it not

k8s-colors's People

Contributors

stabenfeldt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.