Skip to content

Commit

Permalink
Merge pull request #1 from desmax74/master
Browse files Browse the repository at this point in the history
Aligned with the new names
  • Loading branch information
mariofusco authored Mar 7, 2019
2 parents 7b3e1cb + e5d635a commit 6f319aa
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
1 change: 0 additions & 1 deletion drools-quarkus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM registry.fedoraproject.org/fedora-minimal
# FROM centos:7
WORKDIR /work/
COPY target/*-runner /work/application
RUN chmod 775 /work
Expand Down
37 changes: 24 additions & 13 deletions drools-quarkus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,25 @@ curl -d '{"name":"edo", "age":32}' -H "Content-Type: application/json" \

#### Build Container on docker
```sh
docker build -t quickstarter/quick-drools .
docker images | grep quick-drools
docker build -t submarine-examples/drools-quarkus .
docker images | grep drools-quarkus
```

#### Deploy on Openshift
By default will be created under project called "My Project"
```sh
kubectl create -f kubernetes/deployment.yml
kubectl create -f kubernetes/service.yml
oc expose service quick-drools
```
In the pod's log you could see
```
2019-03-07 15:51:40,720 INFO [io.quarkus] (main) Quarkus 0.11.0 started in 0.019s. Listening on: http://[::]:8080
2019-03-07 15:51:40,720 INFO [io.quarkus] (main) Installed features: [cdi, resteasy]
```

Let's go to expose the service
```
oc expose service drools-quarkus
```
this create a yaml file and the route for us on openshift, like this (in routes section on My Project)
```yaml
Expand All @@ -62,19 +71,19 @@ this create a yaml file and the route for us on openshift, like this (in routes
openshift.io/host.generated: 'true'
creationTimestamp: '2019-02-20T10:25:59Z'
labels:
app: quick-drools
name: quick-drools
app: drools-quarkus
name: drools-quarkus
namespace: myproject
resourceVersion: '30743'
selfLink: /apis/route.openshift.io/v1/namespaces/myproject/routes/quick-drools
selfLink: /apis/route.openshift.io/v1/namespaces/myproject/routes/drools-quarkus
uid: ea2676d6-34f9-11e9-bd97-08002709a920
spec:
host: quick-drools-myproject.192.168.99.109.nip.io
host: drools-quarkus-myproject.192.168.99.109.nip.io
port:
targetPort: http
to:
kind: Service
name: quick-drools
name: drools-quarkus
weight: 100
wildcardPolicy: None
status:
Expand All @@ -83,17 +92,19 @@ this create a yaml file and the route for us on openshift, like this (in routes
- lastTransitionTime: '2019-02-20T10:25:59Z'
status: 'True'
type: Admitted
host: quick-drools-myproject.192.168.99.109.nip.io
host: drools-quarkus-myproject.192.168.99.109.nip.io
routerName: router
wildcardPolicy: None

```
```
oc get route
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
quick-drools quick-drools-myproject.192.168.99.109.nip.io quick-drools http None
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
drools-quarkus drools-quarkus-myproject.192.168.99.109.nip.io drools-quarkus http None
```

Your address will be
http://quick-drools-myproject.192.168.99.109.nip.io/hello
http://drools-quarkus-myproject.192.168.99.109.nip.io/hello


12 changes: 6 additions & 6 deletions drools-quarkus/kubernetes/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: quick-drools
app: drools-quarkus
version: v1
name: quick-drools
name: drools-quarkus
spec:
replicas: 1
selector:
matchLabels:
app: quick-drools
app: drools-quarkus
version: v1
template:
metadata:
labels:
app: quick-drools
app: drools-quarkus
version: v1
spec:
containers:
- env:
image: quickstarter/quick-drools:latest
image: submarine-examples/drools-quarkus:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand All @@ -29,7 +29,7 @@ spec:
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 1
name: quick-drools
name: drools-quarkus
ports:
- containerPort: 8080
name: http
Expand Down
6 changes: 3 additions & 3 deletions drools-quarkus/kubernetes/service.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: quick-drools
name: drools-quarkus
labels:
app: quick-drools
app: drools-quarkus
spec:
ports:
- name: http
port: 8080
selector:
app: quick-drools
app: drools-quarkus

0 comments on commit 6f319aa

Please sign in to comment.