Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRY the Dockerfile, clear up the commands so all can be run from roo… #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
FROM ruby:2.3.1
RUN mkdir /lobsters
WORKDIR /lobsters
ADD Gemfile /lobsters/Gemfile
ADD Gemfile.lock /lobsters/Gemfile.lock
ADD Gemfile /lobsters/Gemfile && Gemfile.lock /lobsters/Gemfile.lock
RUN apt-get update && apt-get install nodejs -y
RUN bundle install
ADD . /lobsters
Expand Down
4 changes: 2 additions & 2 deletions docs/create-docker-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git clone https://github.com/kelseyhightower/lobsters.git
```

```
cp Dockerfile lobsters
cp lobsters-on-kubernetes/Dockerfile lobsters/
```

```
Expand All @@ -21,7 +21,7 @@ docker push kelseyhightower/lobsters:2.0.0
## kelseyhightower/lobsters:2.0.1

```
cp custom.css lobsters/app/assets/stylesheets/local
cp lobsters-on-kubernetes/custom.css lobsters/app/assets/stylesheets/local
```

```
Expand Down
4 changes: 2 additions & 2 deletions docs/create-lobsters-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Create lobsters Service

```
kubectl create -f services/lobsters.yaml
kubectl create -f lobsters-on-kubernetes/services/lobsters.yaml
```

```
Expand All @@ -13,5 +13,5 @@ gcloud compute firewall-rules create lobsters --allow tcp:3000
## Create lobsters Deployment

```
kubectl create -f deployments/lobsters.yaml
kubectl create -f lobsters-on-kubernetes//deployments/lobsters.yaml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to have two slashes here?

```
37 changes: 14 additions & 23 deletions docs/create-mysql-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,51 @@
## Create Google Persistent Disk

```
gcloud compute disks create mysql
```
$ gcloud compute disks create mysql

```
NAME ZONE SIZE_GB TYPE STATUS
mysql us-west1-b 500 pd-standard READY
```

## Create mysql PersistentVolume

```
kubectl create -f pv/mysql.yaml
```
```
persistentvolume "mysql" created
$ kubectl create -f lobsters-on-kubernetes/pv/mysql.yaml

=> persistentvolume "mysql" created
```

## Create mysql PersistentVolumeClaim

```
kubectl create -f pvc/mysql.yaml
```
```
persistentvolumeclaim "mysql" created
$ kubectl create -f lobsters-on-kubernetes/pvc/mysql.yaml

=> persistentvolumeclaim "mysql" created
```

## Create mysql Secrets

```
kubectl create secret generic lobsters \
$ kubectl create secret generic lobsters \
--from-literal=root-password=l0bst3rs \
--from-literal=mysql-password=lobsters \
--from-literal='database-url=mysql2://lobsters:lobsters@mysql:3306/lobsters'
```

```
secret "lobsters" created
=> secret "lobsters" created
```

## Create mysql Deployment

```
kubectl create -f deployments/mysql.yaml
```
```
deployment "mysql" created
$ kubectl create -f lobsters-on-kubernetes/deployments/mysql.yaml

=> deployment "mysql" created
```

## Create mysql Service

```
kubectl create -f services/mysql.yaml
```
$ kubectl create -f lobsters-on-kubernetes/services/mysql.yaml

```
service "mysql" created
=> service "mysql" created
```
4 changes: 2 additions & 2 deletions docs/run-database-migrations.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Run Database Migrations

```
kubectl create -f jobs/lobsters-db-schema-load.yaml
kubectl create -f lobsters-on-kubernetes/jobs/lobsters-db-schema-load.yaml
```

```
kubectl create -f jobs/lobsters-db-seed.yaml
kubectl create -f lobsters-on-kubernetes/jobs/lobsters-db-seed.yaml
```