pulumi / pulumi/examples

gcp-ts-k8s-ruby-on-rails-postgresql example app not working

Open
#776 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.6k
Forks
894
Avg merge
12h 19m
Merged PRs (30d)
39

Description

The TODO app container appears to be invalid. I followed the README and successfully created the cluster and deployed the app, but the container is crash looping.

I connected to the cluster to debug by running

pulumi stack output kubeConfig > kubeconfig

and then running

KUBECONFIG=$PWD/kubeconfig kubectl logs -l app=rails-app

I saw the following logs:

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
* CREATING DATABASE (first time only):
* MIGRATING DATABASE (if needed):
* RUNNING...
/myapp/start: line 10: bin/rails: No such file or directory
/myapp/start: line 12: bin/rails: No such file or directory

It appears that the start script is not working. Changing it to

#!/bin/bash

# Spawn the Rails App.
echo "* SPAWNING RAILS:"
rails new . -f
rails s -p 3000 -b '0.0.0.0' &

# Wait for it to come up, and then ensure the database is created and migrated.
sleep 5
echo "* CREATING DATABASE (first time only):"
rails db:create
echo "* MIGRATING DATABASE (if needed):"
rails db:migrate

echo "* RUNNING..."
wait

got the server to start and stopped the container from crash looping, but when I navigate to the page, I'm seeing DB connection errors: ActiveRecord::ConnectionNotEstablished No connection pool with 'primary' found.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the example's README and the container's start script, then reproduce the deployment using the shown pulumi stack output kubeConfig and kubectl logs commands. Trace both the missing bin/rails failure and the PostgreSQL connection error; done means the container stays running and the Rails app connects to its database.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, kubernetes, postgresql, rails, ruby, shell
Domain
backend, cloud, databases, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.