Skip to content

Commit 5f27223

Browse files
authored
Merge pull request #319 from krancour/elim-legacy-manifests
Eliminate legacy manifests and update hack / deploy process
2 parents ea19e45 + 3e8ff74 commit 5f27223

10 files changed

+100
-164
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
manifests/deis-router-rc.tmp.yaml
2-
manifests/deis-router-deployment.tmp.yaml
31
rootfs/opt/router/sbin/router
42
rootfs/opt/router/sbin/router.*
53
vendor/

Makefile

+8-15
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,14 @@ clean: check-docker
6262
full-clean: check-docker
6363
docker images -q ${DEIS_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME} | xargs docker rmi -f
6464

65-
dev-release: docker-build docker-push set-image
66-
67-
set-image:
68-
sed "s#\(image:\) .*#\1 ${IMAGE}#" manifests/deis-${SHORT_NAME}-deployment.yaml > manifests/deis-${SHORT_NAME}-deployment.tmp.yaml
69-
70-
deploy: check-kubectl dev-release
71-
@kubectl describe deployment deis-${SHORT_NAME} --namespace=deis >/dev/null 2>&1; \
72-
if [ $$? -eq 0 ]; then \
73-
kubectl apply -f manifests/deis-${SHORT_NAME}-deployment.tmp.yaml; \
74-
else \
75-
kubectl create -f manifests/deis-${SHORT_NAME}-deployment.tmp.yaml; \
76-
fi
77-
78-
examples:
79-
kubectl create -f manifests/examples.yaml
65+
deploy: check-kubectl docker-build docker-push
66+
kubectl --namespace=deis patch deployment deis-${SHORT_NAME} \
67+
--type='json' \
68+
-p='[ \
69+
{"op": "replace", "path": "/spec/strategy", "value":{"type":"Recreate"}}, \
70+
{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}, \
71+
{"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value":"Always"} \
72+
]'
8073

8174
test: test-style test-unit test-functional
8275

README.md

+14-19
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,25 @@ This section documents simple procedures for installing the Deis Router for eval
2929

3030
Deis Router can be installed with or without the rest of the Deis Workflow platform. In either case, begin with a healthy Kubernetes cluster. Kubernetes getting started documentation is available [here](http://kubernetes.io/gettingstarted/).
3131

32-
Next, install the [Helm Classic](http://helm.sh) package manager, then use the commands below to initialize that tool and load the [deis/charts](https://github.com/deis/charts) repository.
32+
Next, install the [Helm](http://helm.sh) package manager, then use the commands below to initialize that tool and install all of Deis Workflow or the Deis Router by itself.
3333

3434
```
35-
$ helmc update
36-
$ helmc repo add deis https://github.com/deis/charts
35+
$ helm init
3736
```
3837

39-
To install the router:
38+
To install all of Deis Workflow:
4039

4140
```
42-
$ helmc fetch deis/<chart>
43-
$ helmc generate -x manifests <chart>
44-
$ helmc install <chart>
41+
$ helm repo add workflow https://charts.deis.com/workflow
42+
$ helm install workflow/workflow --namespace deis
4543
```
46-
Where `<chart>` is selected from the options below:
4744

48-
| Chart | Description |
49-
|-------|-------------|
50-
| workflow-rc2 | Install the router along with the rest of the latest stable Deis Workflow release. |
51-
| workflow-dev | Install the router from master with the rest of the edge Deis Workflow platform. |
52-
| router-dev | Install the router from master with its minimal set of dependencies. |
45+
Or to install the Deis Router by itself:
5346

47+
```
48+
$ helm repo add router https://charts.deis.com/router
49+
$ helm install router/router --namespace deis
50+
```
5451

5552
For next steps, skip ahead to the [How it Works](#how-it-works) and [Configuration Guide](#configuration) sections.
5653

@@ -98,15 +95,13 @@ $ make build
9895

9996
Make sure to have defined the variable `DEIS_REGISTRY` previous to this step, as your image tags will be prefixed according to this.
10097

101-
Built images will be tagged with the sha of the latest git commit. __This means that for a new image to have its own unique tag, experimental changes should be committed _before_ building. Do this in a branch. Commits can be squashed later when you are done hacking.__
102-
10398
#### To deploy:
10499

105100
```
106101
$ make deploy
107102
```
108103

109-
The deploy target will implicitly build first, then push the built image (which has its own unique tags) to your development registry (i.e. that specified by `DEIS_REGISTRY`). A Kubernetes manifest is prepared, referencing the uniquely tagged image, and that manifest is submitted to your Kubernetes cluster. If a router component is already running in your Kubernetes cluster, it will be deleted and replaced with your build.
104+
The deploy target will implicitly build first, then push the built image to your development registry (i.e. that specified by `DEIS_REGISTRY`). The router's _existing_ Kubernetes `Deployment` (installed via Helm) will be updated to use the newly built image.
110105

111106
To see that the router is running, you can look for its pod(s):
112107

@@ -119,7 +114,7 @@ $ kubectl get pods --namespace=deis
119114
To deploy some sample routable applications:
120115

121116
```
122-
$ make examples
117+
$ helm install charts/examples --namespace router-examples
123118
```
124119

125120
This will deploy Nginx and Apache to your Kubernetes cluster as if they were user applications.
@@ -152,7 +147,7 @@ metadata:
152147
name: foo
153148
labels:
154149
router.deis.io/routable: "true"
155-
namespace: examples
150+
namespace: router-examples
156151
annotations:
157152
router.deis.io/domains: www.foobar.com
158153
spec:
@@ -318,7 +313,7 @@ metadata:
318313
name: foo
319314
labels:
320315
router.deis.io/routable: "true"
321-
namespace: examples
316+
namespace: router-examples
322317
# ...
323318
annotations:
324319
router.deis.io/domains: foo,bar,www.foobar.com

charts/examples/Chart.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: examples
2+
home: https://github.com/deis/router
3+
version: <Will be populated by the ci before publishing the chart>
4+
description: Standalone examples for Deis Router.
5+
maintainers:
6+
- name: Deis Team
7+
email: engineering@deis.com
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: apache
5+
labels:
6+
app: apache
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: apache
12+
template:
13+
metadata:
14+
labels:
15+
app: apache
16+
spec:
17+
containers:
18+
- name: apache
19+
image: httpd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: apache
5+
labels:
6+
router.deis.io/routable: "true"
7+
app: apache
8+
annotations:
9+
# Demonstrates a subdomain of the router's default domain as well as a fully-qualified domain name
10+
router.deis.io/domains: apache,httpd.example.com
11+
spec:
12+
ports:
13+
- port: 80
14+
protocol: TCP
15+
targetPort: 80
16+
selector:
17+
app: apache
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: nginx
5+
labels:
6+
app: nginx
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: nginx
12+
template:
13+
metadata:
14+
labels:
15+
app: nginx
16+
spec:
17+
containers:
18+
- name: nginx
19+
image: nginx
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: nginx
5+
labels:
6+
router.deis.io/routable: "true"
7+
app: nginx
8+
annotations:
9+
router.deis.io/domains: nginx
10+
spec:
11+
ports:
12+
- port: 80
13+
protocol: TCP
14+
targetPort: 80
15+
selector:
16+
app: nginx

manifests/deis-router-deployment.yaml

-52
This file was deleted.

manifests/examples.yaml

-76
This file was deleted.

0 commit comments

Comments
 (0)