From f28d9652118f2a1eb6289e9c3f291bb9442c1812 Mon Sep 17 00:00:00 2001 From: "shen_vickie@bah.com" Date: Thu, 17 Sep 2020 18:19:14 -0400 Subject: [PATCH 1/2] added deployment instruction in README --- README.md | 51 ++------------------------------------- deploy/deployment.yaml | 54 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 49 deletions(-) create mode 100644 deploy/deployment.yaml diff --git a/README.md b/README.md index 85d5222..1ea5e0f 100644 --- a/README.md +++ b/README.md @@ -5,56 +5,9 @@ The board is updated in real time for all connected users, and its state is alwa A demonstration server is available at [wbo.ophir.dev](https://wbo.ophir.dev) -## Running your own instance of WBO +## Deployment -If you have your own web server, and want to run a private instance of WBO on it, you can. It should be very easy to get it running on your own server. - -### Running the code in a container (safer) - -If you use the [docker](https://www.docker.com/) containerization service, you can easily run WBO as a container. -An official docker image for WBO is hosted on dockerhub as [`lovasoa/wbo`](https://hub.docker.com/repository/docker/lovasoa/wbo). - -You can run it with the following command : - -``` -docker run -it --publish 5001:80 --volume $(pwd)/wbo-boards:/opt/app/server-data lovasoa/wbo:latest -``` - -This will run WBO : - - on port 5001 - - persisting the user data in `$(pwd)/wbo-boards` - -You can then access WBO at `http://localhost:5001`. - -### Running the code without a container - -Alternatively, you can run the code with [node.js](https://nodejs.org/) directly, without docker. - -First, download the sources: -``` -git clone git@github.com:lovasoa/whitebophir.git -cd whitebophir -``` - -Then [install node.js](https://nodejs.org/en/download/) (v8.0 or superior) -if you don't have it already, then install WBO's dependencies: - -``` -npm install --production -``` - -Finally, you can start the server: -``` -PORT=5001 npm start -``` - -This will run WBO directly on your machine, on port 5001, without any isolation from the other services. - -### Running WBO on a subfolder - -By default, WBO launches its own web server and serves all of its content at the root of the server (on `/`). -If you want to make the server accessible with a different path like `https://your.domain.com/wbo/` you have to setup a reverse proxy. -See instructions on our Wiki about [how to setup a reverse proxy for WBO](https://github.com/lovasoa/whitebophir/wiki/Setup-behind-Reverse-Proxies). +Example deployment manifests for Kubernetes can be found in the [deploy](./deploy) directory. ## Translations diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml new file mode 100644 index 0000000..a8c32e4 --- /dev/null +++ b/deploy/deployment.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: Service +metadata: + name: wbo +spec: + selector: + app: wbo + ports: + - protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 32767 + type: NodePort +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wbo-deployment + labels: + app: wbo +spec: + replicas: 1 + selector: + matchLabels: + app: wbo + template: + metadata: + labels: + app: wbo + spec: + containers: + - name: wbo + image: wbo:ib + ports: + - containerPort: 8080 + volumeMounts: + - name: wbo-vol-storage + mountPath: /opt/app/server-data + volumes: + - name: wbo-vol-storage + persistentVolumeClaim: + claimName: wbo-pvc +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wbo-pvc +spec: + accessModes: + - ReadWriteOnce + volumeMode: Filesystem + resources: + requests: + storage: 1Gi -- GitLab From 224ec8308d81b69c98e9642a4e2ab4aab44580ee Mon Sep 17 00:00:00 2001 From: "shen_vickie@bah.com" Date: Thu, 17 Sep 2020 19:38:13 -0400 Subject: [PATCH 2/2] updated image tag --- deploy/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml index a8c32e4..e87ca15 100644 --- a/deploy/deployment.yaml +++ b/deploy/deployment.yaml @@ -30,7 +30,7 @@ spec: spec: containers: - name: wbo - image: wbo:ib + image: registry1.dsop.io/ironbank/opensource/lovasoa/wbo:1.6.3 ports: - containerPort: 8080 volumeMounts: -- GitLab