Skip to content

Commit 80ec6a2

Browse files
author
Matthew
committed
ref(postgres): rename deployment target to postgres
1 parent 9f722d3 commit 80ec6a2

8 files changed

Lines changed: 28 additions & 86 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ script:
1616
- make test
1717
deploy:
1818
provider: script
19-
script: _scripts/ci/deploy.sh
19+
script: contrib/ci/deploy.sh
2020
on:
2121
branch: master

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include includes.mk
44
# Some uses for short name:
55
# - Docker image name
66
# - Kubernetes service, rc, pod, secret, volume names
7-
SHORT_NAME := database
7+
SHORT_NAME := postgres
88

99
BUILD_TAG ?= git-$(shell git rev-parse --short HEAD)
1010

@@ -14,8 +14,8 @@ DEIS_REGISTRY ?= ${DEV_REGISTRY}
1414
IMAGE_PREFIX ?= deis/
1515

1616
# Kubernetes-specific information for RC, Service, and Image.
17-
RC := manifests/deis-${SHORT_NAME}-rc.tmp.yaml
18-
SVC := manifests/deis-${SHORT_NAME}-service.yaml
17+
RC := contrib/kubernetes/manifests/${SHORT_NAME}-rc.tmp.yaml
18+
SVC := contrib/kubernetes/manifests/${SHORT_NAME}-service.yaml
1919
IMAGE := ${DEIS_REGISTRY}/${IMAGE_PREFIX}${SHORT_NAME}:${BUILD_TAG}
2020

2121
all:
@@ -46,13 +46,13 @@ kube-rc: check-kubectl
4646
kubectl create -f ${RC}
4747

4848
kube-clean: check-kubectl
49-
kubectl delete rc deis-example
49+
kubectl delete rc ${SHORT_NAME}
5050

5151
test: check-docker
52-
./_scripts/ci/test.sh ${IMAGE}
52+
contrib/ci/test.sh ${IMAGE}
5353

5454
update-manifests:
55-
sed 's#\(image:\) .*#\1 $(IMAGE)#' manifests/deis-database-rc.yaml \
56-
> manifests/deis-database-rc.tmp.yaml
55+
sed 's#\(image:\) .*#\1 $(IMAGE)#' contrib/kubernetes/manifests/${SHORT_NAME}-rc.yaml \
56+
> ${RC}
5757

5858
.PHONY: all build kube-up kube-down deploy

README.md

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Deis Database
1+
# Postgres
22

33
A PostgreSQL database for use in the [Deis](http://deis.io) open source PaaS.
44

@@ -12,81 +12,31 @@ Please add any [issues](https://github.com/deis/postgres/issues) you find with t
1212

1313
## Deploying
1414

15-
In order to run this component in Kubernetes, a few prerequisites are needed:
16-
17-
- An AWS account with S3 enabled
18-
- An external etcd cluster
19-
- your own kubernetes cluster
20-
21-
In Deis, these services are provided to you automatically through [the store](http://docs.deis.io/en/latest/understanding_deis/components/#store)
22-
and [etcd](https://github.com/technosophos/etcd) components.
23-
2415
To build a dev release of this image, you will also need your own registry, but DockerHub or
2516
[Quay](https://quay.io/) will do fine here. To build, run:
2617

2718
```bash
28-
$ make build
29-
$ docker build -t deis/postgres:v0.0.1 rootfs
30-
$ docker push deis/postgres:v0.0.1
19+
$ export DEIS_REGISTRY=myregistry.com:5000
20+
$ make docker-build docker-push
3121
```
3222

3323
This will compile the Docker image and push it to your registry.
3424

35-
Then, you'll need to modify the kubernetes manifests to point to your S3 account and your etcd
36-
cluster. Open up the replication controller manifest and change the values:
37-
38-
```
39-
$ git diff
40-
diff --git a/manifests/postgres-rc.json b/manifests/postgres-rc.json
41-
index a5cbb23..70d3bc2 100644
42-
--- a/manifests/postgres-rc.json
43-
+++ b/manifests/postgres-rc.json
44-
@@ -22,15 +22,15 @@
45-
"containers": [
46-
{
47-
"name": "deis-database",
48-
- "image": "CHANGEME",
49-
+ "image": "deis/postgres:v0.0.1",
50-
"env": [
51-
{
52-
"name" : "AWS_ACCESS_KEY_ID",
53-
- "value" : "CHANGEME"
54-
+ "value" : "FOO"
55-
},
56-
{
57-
"name" : "AWS_SECRET_ACCESS_KEY",
58-
- "value" : "CHANGEME"
59-
+ "value" : "BAR"
60-
},
61-
{
62-
"name" : "WALE_S3_PREFIX",
63-
@@ -38,7 +38,7 @@
64-
},
65-
{
66-
"name" : "ETCD_SERVICE_HOST",
67-
- "value" : "192.168.0.1"
68-
+ "value" : "10.0.1.100"
69-
}
70-
],
71-
"ports": [
72-
```
73-
7425
After that, run
7526

7627
```
7728
$ make deploy
7829
```
7930

80-
Which will deploy the component to kubernetes. After a while, you should see a few pods up with one
31+
Which will deploy the component to kubernetes. After a while, you should see one pod up with one
8132
running:
8233

8334
```
8435
NAME READY STATUS RESTARTS AGE
8536
deis-database-6wy8o 1/1 Running 0 32s
86-
deis-database-rh00d 0/1 Running 0 32s
8737
```
8838

89-
You can then query these images as you would with any other Kubernetes pod:
39+
You can then query this pod as you would with any other Kubernetes pod:
9040

9141
```
9242
$ kubectl logs -f deis-database-6wy8o
@@ -96,8 +46,6 @@ $ kubectl exec -it deis-database-6wy8o psql
9646

9747
## Testing
9848

99-
**Note**: At this time, tests from Deis v1 are still being ported over.
100-
10149
You can run the test suite with
10250

10351
```
File renamed without changes.

manifests/deis-database-rc.yaml renamed to contrib/kubernetes/manifests/postgres-rc.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
apiVersion: v1
22
kind: ReplicationController
33
metadata:
4-
name: deis-database
4+
name: postgres
55
labels:
6-
app: deis-database
7-
heritage: deis
6+
app: postgres
87
spec:
98
replicas: 1
109
selector:
11-
app: deis-database
12-
heritage: deis
10+
app: postgres
1311
template:
1412
metadata:
1513
labels:
16-
app: deis-database
17-
heritage: deis
14+
app: postgres
1815
spec:
1916
containers:
20-
- name: deis-database
21-
image: quay.io/deisci/database:v2-alpha
17+
- name: postgres
18+
image: quay.io/deisci/postgres:v2-alpha
2219
env:
2320
- name: POSTGRES_USER
2421
value: "deis"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: postgres
5+
spec:
6+
ports:
7+
- port: 5432
8+
selector:
9+
app: postgres

manifests/deis-database-service.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)