This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Human-Connection/kompose
Kompose
- Loading branch information
Showing
11 changed files
with
244 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
FROM neo4j:3.4 | ||
RUN mkdir /plugins && wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.4.0.3/apoc-3.4.0.3-all.jar -P /plugins | ||
|
||
RUN wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.4.0.3/apoc-3.4.0.3-all.jar -P plugins/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: "3.7" | ||
|
||
services: | ||
backend: | ||
container_name: backend.127.0.0.1.xip.io | ||
volumes: | ||
- .:/backend | ||
- /backend/node_modules | ||
neo4j: | ||
ports: | ||
- 7687:7687 | ||
- 7474:7474 | ||
|
||
networks: | ||
hc-network: | ||
name: hc-network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Usage with minikube | ||
|
||
First of all start minikube on your machine: | ||
```sh | ||
minikube start | ||
``` | ||
You can always get an overview and see what's going on with your minikube: | ||
```sh | ||
minikube dashboard | ||
``` | ||
|
||
Build Docker images, using the Minikube Docker daemon: | ||
```sh | ||
eval $(minikube docker-env) | ||
docker build -t humanconnection/backend:latest . | ||
docker build -t humanconnection/neo4j:latest -f Dockerfile.neo4j . | ||
``` | ||
|
||
check that the image is in Minikube’s Docker registry: | ||
```sh | ||
minikube ssh docker images | ||
``` | ||
|
||
Now change into directory kubernetes and create services and deployments: | ||
```sh | ||
cd kubernetes | ||
|
||
kubectl create -f neo4j-deployment.yaml,neo4j-data-persistentvolumeclaim.yaml,backend-deployment.yaml,neo4j-service.json,backend-service.json | ||
``` | ||
|
||
You can see the backend in action with: | ||
```sh | ||
minikube service backend | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert -f ../docker-compose.yml | ||
kompose.version: 1.16.0 (0c01309) | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: backend | ||
name: backend | ||
spec: | ||
replicas: 1 | ||
strategy: {} | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: backend | ||
spec: | ||
containers: | ||
- env: | ||
- name: CLIENT_URI | ||
value: http://localhost:3000 | ||
- name: GRAPHQL_LISTEN_PORT | ||
value: "4000" | ||
- name: GRAPHQL_URI | ||
value: http://localhost:4000 | ||
- name: JWT_SECRET | ||
value: b/&&7b78BF&fv/Vd | ||
- name: MOCK | ||
value: "false" | ||
- name: NEO4J_URI | ||
value: bolt://neo4j:7687 | ||
image: humanconnection/backend:latest | ||
name: backend | ||
ports: | ||
- containerPort: 4000 | ||
resources: {} | ||
imagePullPolicy: IfNotPresent | ||
restartPolicy: Always | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "backend", | ||
"namespace": "default", | ||
"selfLink": "/api/v1/namespaces/default/services/backend", | ||
"uid": "57749bc1-dea3-11e8-ace2-080027b5d96d", | ||
"resourceVersion": "8321", | ||
"creationTimestamp": "2018-11-02T13:29:36Z", | ||
"labels": { | ||
"io.kompose.service": "backend" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"protocol": "TCP", | ||
"port": 4000, | ||
"targetPort": 4000, | ||
"nodePort": 32633 | ||
} | ||
], | ||
"selector": { | ||
"io.kompose.service": "backend" | ||
}, | ||
"clusterIP": "10.110.129.92", | ||
"type": "LoadBalancer", | ||
"sessionAffinity": "None", | ||
"externalTrafficPolicy": "Cluster" | ||
}, | ||
"status": { | ||
"loadBalancer": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kubernetes-dashboard | ||
labels: | ||
k8s-app: kubernetes-dashboard | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kubernetes-dashboard | ||
namespace: kube-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: neo4j-data | ||
name: neo4j-data | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 100Mi | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert -f ../docker-compose.yml | ||
kompose.version: 1.16.0 (0c01309) | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: neo4j | ||
name: neo4j | ||
spec: | ||
replicas: 1 | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: neo4j | ||
spec: | ||
containers: | ||
- env: | ||
- name: NEO4J_AUTH | ||
value: none | ||
image: humanconnection/neo4j:latest | ||
name: neo4j | ||
ports: | ||
- containerPort: 7687 | ||
- containerPort: 7474 | ||
resources: {} | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- mountPath: /data | ||
name: neo4j-data | ||
restartPolicy: Always | ||
volumes: | ||
- name: neo4j-data | ||
persistentVolumeClaim: | ||
claimName: neo4j-data | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "neo4j", | ||
"namespace": "default", | ||
"selfLink": "/api/v1/namespaces/default/services/neo4j", | ||
"uid": "57de6181-dea3-11e8-ace2-080027b5d96d", | ||
"resourceVersion": "8326", | ||
"creationTimestamp": "2018-11-02T13:29:37Z", | ||
"labels": { | ||
"io.kompose.service": "neo4j" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"name": "port-1", | ||
"protocol": "TCP", | ||
"port": 7687, | ||
"targetPort": 7687, | ||
"nodePort": 30116 | ||
}, | ||
{ | ||
"name": "port-2", | ||
"protocol": "TCP", | ||
"port": 7474, | ||
"targetPort": 7474, | ||
"nodePort": 32658 | ||
} | ||
], | ||
"selector": { | ||
"io.kompose.service": "neo4j" | ||
}, | ||
"clusterIP": "10.108.175.122", | ||
"type": "LoadBalancer", | ||
"sessionAffinity": "None", | ||
"externalTrafficPolicy": "Cluster" | ||
}, | ||
"status": { | ||
"loadBalancer": {} | ||
} | ||
} |