• This repository has been archived on 23/Mar/2023
  • Stars
    star
    314
  • Rank 128,385 (Top 3 %)
  • Language
    Ruby
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[ABANDONED] Easy Rails on Kubernetes approach for Digital Ocean and a classic Rails stack: Puma, Redis, Sidekiq, Postgres, Action Cable, Webpacker. Helm 3 in production and docker-compose + dip (https://github.com/bibendi/dip) in development. Issues and PRs welcome.

Le Wagon x Digital Ocean Rails-on-Kubernetes demo

🚧 This setup is a work in progress 🚧

An attempt at creating a standardized Docker/Kubernetes-Helm/GitHub Actions setup for use with Rails projects. A version of this setup (that is little bit further ahead) is now used in production for services available to Le Wagon teachers, students, and alumni.

Demo application

A standard Action Cable chat application (Rails 6 + Stimulus) that uses twitter-text gem to extract free-formed URLs out of text and generate Open Graph previews for links. The dependency was chosen consciously, as it requires an external system library to function (libidn11), which makes it a perfect case for Docker.

It requires Sidekiq, Redis, and PostgreSQL to run, which represents the standard deployment stack of production Rails apps.

The demo application at https://demo.lewagon.co

Goals

  • Create a sensible approach to running fairly complex Rails projects in development with Docker
  • Generate reproducible and customizable configuration for production
  • Store everything related to deployments in the same repo as application code. Rely on GitHub one-way encrtypred secrets to store sensitive data like database connection strings.
  • Cater to a "classic Rails stack": Rails, Puma, Sidekiq, Redis, PostgreSQL, Webpacker, Action Cable
  • Allow for only a certain amount of complexity: enough to fit inside a head of a single full-stack developer who may end up maintaining the projects.
  • Hide ugly details of Kubernetes management by relying on 1 environment/1 cluster approach and letting Digital Ocean manage the master node.
  • Deploy with git push origin master or a PR merge on GitHub
  • Use any external Postgres database
  • Provide the easy migration from "Heroku way of doing things", once the application is past the MVP and needs to scale for a reasonable cost.

Current status

By constantly migrating legacy applications to this setup and starting new ones with the same setup in mind we make sure that all common production bugs will be squashed before we can fully automate the generation of charts and configuration.

Running locally

We use dip by Misha Merkushin at Evil Martians to achieve a "classic CLI" feel while working with Docker under the hood.

  • gem install dip
  • dip provision to build all necessary images and setup the local DB
  • dip up -d to run all services in the background: app, rails, sidekiq, webpacker (runs webpack-dev-server for JS live reload), postgres, redis. Go to localhost:3000 🎉
  • dip rails c to visit console.
  • dip down to stop the music and go home.

If you need to change project dependencies—run dip bundle and/or dip yarn after any changes to Gemfile or package.json.

Check out dip.yml for other common shortcuts.

Alternatively, you can launch dip rails s, dip sidekiq, and dip webpacker in respective tabs. This will allow for easier debugging with byebug (no need to attach to running Docker processes).

Many-tabs workflow

Running in production

  • Provision a cluster from Digital Ocean Managed Kubernetes, install Nginx Ingress Controller, create DNS A record, set up jetstack/certmanager for SSL. Expect futher explanation of those steps once the setup is out of internal testing.
  • Install Helm 3 on your machine. Run make upgrade-dev from project repo to deploy the release into the cluster.
  • Once you verified that the deployment from local machine works — feel free to fork the repo and set up the following secrets:

Secrets to be set

⚠️ You don't have to use Quay as Docker image backend, in that case you can alter Makefile push commands to your own image hosting provider.

  • After you're done—a push to master will trigger a GitHub Action for deployment. See deploy.yaml for details.

🙏 Suggestions and PRs are welcome!

More Repositories

1

dotfiles

Default configuration for Le Wagon's students
Shell
18,480
star
2

setup

Setup instructions for Le Wagon's students on their first day of Web Development Bootcamp
Ruby
17,095
star
3

data-setup

Setup instructions for Le Wagon's students on their first day of Data Science Bootcamp
Ruby
1,769
star
4

rails-templates

Jump start your Rails development with Le Wagon best practices
Ruby
644
star
5

wait-on-check-action

This action can be used to halt any workflow until required checks for a given ref (e.g., in a sibling workflow) pass successfully.
Ruby
312
star
6

data-kit

Devenez Data-Scientist sur Le Wagon On Demand
Jupyter Notebook
204
star
7

rails-stylesheets

Stylesheets starting kit @LeWagon
SCSS
173
star
8

foot_traffic

[NOT MAINTAINED] Pure Ruby DSL for Chrome scripting based on Ferrum. No Selenium required. Works from any script. Simulate web app usage scenarios in production or locally.
Ruby
133
star
9

html-css-challenges

HTML / CSS challenges @LeWagon
CSS
110
star
10

bootstrap-boilerplate

A nice Bootstrap HTML boilerplate using official Bootstrap CDN to start coding right away!
HTML
109
star
11

awesome-navbars

navbar HTML/SCSS templates for Le Wagon's students
HTML
60
star
12

react-boilerplate

JavaScript
48
star
13

webpack-boilerplate

JavaScript
43
star
14

ruby-101

42
star
15

google-place-autocomplete

Exemple of Google Place Autocomplete Javascript API
HTML
40
star
16

ruby-101-challenges

Le Wagon Ruby Workshop
Ruby
38
star
17

wagon_rails

[DEPRECATED] Please use this 👉
Ruby
37
star
18

data-templates

Curated templates for data analysis / science
Jupyter Notebook
36
star
19

goodbye-jquery

IE lost the Browser war, time to move on. Thank you for your service jQuery 🙏
27
star
20

middleman-template

A Middleman template following @lewagon's best practices
Ruby
26
star
21

layouts-101

HTML
22
star
22

google-maps-autocomplete

Demo of Google Maps Autocomplete
Ruby
19
star
23

flats-boilerplate

17
star
24

rails-google-maps

Demo app integrating gmaps on a Flat model for Le Wagon's students.
Ruby
16
star
25

middleman-boilerplate

Middleman Boilerplate for @LeWagon Bootcamp
CSS
16
star
26

data-analytics-sprint

Jupyter Notebook
15
star
27

frontend-advanced-boilerplate

Advanced Middleman boilerplate for Le Wagon fullstack students
Ruby
14
star
28

www-sinatra

Old version of www.lewagon.com - Retired on Oct 22nd, 2015
CSS
13
star
29

rails-kickoff

[DEPRECATED] See lewagon/rails-templates 👉
12
star
30

surfcamp

Code & Surf Camp - Septembre 2014 - France
CSS
12
star
31

nightmare-boilerplate

JavaScript
11
star
32

seatrain

[ABANDONED] Developer-friendly DevOps/GitOps boilerplate generator for Rails applications. Sets up local Docker dev environment and generates Helm chart to deploy to Digital Ocean Kubernetes. No admin black-belt required!
Ruby
10
star
33

wagon-chat-api

Wagon chat API for challenge @LeWagon
Ruby
9
star
34

redux-boilerplate

JavaScript
9
star
35

nbresult

Testing Library for Jupyter Notebooks
Python
8
star
36

ux-ui-lectures

8
star
37

install-rails

🇫🇷 Installer Rails 5 (OSX => natif, Windows => Cloud 9)
8
star
38

product-design

7
star
39

data-engineering-setup

Ruby
7
star
40

quay-github-actions-dispatch

A missing *secure* link between Quay.io build triggers and Github Action's repository_dispatch events
Go
7
star
41

ui-components

[DEPRECATED] Replaced by Le Wagon UI Kit
HTML
6
star
42

taxi-fare-interface

JavaScript
6
star
43

omniauth-kitt

OAuth Strategy for Kitt
Ruby
6
star
44

garage-api

API for React+Redux Garage (repair shop) and cars 🚗
Ruby
6
star
45

components-demo

HTML
6
star
46

recommendation-graphdb

Python
6
star
47

python-scraping-workshop

Jupyter Notebook
6
star
48

xbar

Ruby
5
star
49

recipes

Stable website to be scraped by @lewagon students
Ruby
5
star
50

chat-redux

JavaScript
5
star
51

google-maps-markers-static

Static example of Google Maps markers (with infowindows)
HTML
5
star
52

rails-garden-manager

Ruby
5
star
53

redux-router-boilerplate

React + Redux + Router boilerplate
JavaScript
5
star
54

wagon-hunt

Ruby
5
star
55

google-maps-snazzy-themes

Snazzy Maps theme for Gmaps
5
star
56

opengraph

Moved to
Ruby
5
star
57

tips

Sharing tips with your classmates and future alumni
5
star
58

dictionary-api

Ruby
5
star
59

conduct

Le Wagon's code of conduct for the Alumni Slack & Events
4
star
60

static-airbnb-redux

JavaScript
4
star
61

pg_bucket_import

[ABANDONED]
Ruby
4
star
62

python-101

Python
4
star
63

dribbble-cards

HTML
4
star
64

fullstack-images

Images for Le Wagon fullstack challenges
4
star
65

rails-watch-list

Ruby
4
star
66

amsterdam-drive-in

Le Wagon Amsterdam - Drive-in (students project)
HTML
4
star
67

install-middleman

🇫🇷 Comment installer Middleman sur Mac ou Windows
3
star
68

wikinimous

Simple anonymous Wiki with Rails
Ruby
3
star
69

chat-rails-redux

Ruby
3
star
70

blog-redux

JavaScript
3
star
71

matplotlib

Matplotlib examples for Le Wagon's Data Science bootcamp
Jupyter Notebook
3
star
72

html-demo

HTML
3
star
73

html-css-sprint

Simple HTML/CSS Boilerplate for Le Wagon's course
HTML
3
star
74

jekyll-boilerplate

The simplest Jekyll boilerplate possible with Bootstrap + FontAwesome CDN
Shell
3
star
75

git-101-boilerplate

Simple boilerplate to show how to use git with Github on @lewagon setup day.
HTML
3
star
76

amsterdam

Le Wagon Amsterdam - BSSA
CSS
3
star
77

react-giphy

JavaScript
3
star
78

alfred-coworker

Automatically check-in people on Cobot as they connect to the Unifi Wifi
Ruby
3
star
79

cetetejecode-videos

Code présenté pendant les vidéos du MOOC
CSS
2
star
80

active-record-advanced

Ruby
2
star
81

animation-challenges

CSS and jQuery animation challenges for on-demand
CSS
2
star
82

trello-dashboard

Starter code for a JavaScript Trello Dashboard
CSS
2
star
83

rails-base-chrome-imagemagick

Shell
2
star
84

product-design-figma

2
star
85

rails-blog

Ruby
2
star
86

bookstore

Ruby
2
star
87

garage-redux

JavaScript
2
star
88

restaurants_ajaxified_with_stimulus

Ruby
2
star
89

gosu-pong

Ruby
2
star
90

stylus

Styl.us middleman project @LeWagon
HTML
2
star
91

ml-api

Python
2
star
92

watchlist

Sampe rails app demonstrating Devise, S3, Mandrill & Sidekiq usage
Ruby
2
star
93

ecommerce-template

HTML
2
star
94

jekyll-iceme

Exemple of using Jekyll. Check out the branches for steps
CSS
2
star
95

react-flats

JavaScript
2
star
96

taxi-fare-deep

Packaged neural network-based predictor for the Kaggle's NY Taxi Fare challenge
Jupyter Notebook
2
star
97

krails

[ABANDONED]
Ruby
2
star
98

fullstack-challenges-04-Rails-watch-list-specs

Ruby
2
star
99

intro-to-data-science-env

Setup environment for Introduction to Data Science challenges
Python
2
star
100

taxi-fare

Python
1
star