订阅内容

Parse is a well-known open source Mobile Backend-as-a-Service

If you haven't seen the previous post on how to run Parse Server on OpenShift, please take a look Parse Server on OpenShift Online (Next Gen).

Here, I'll focus more on dashboard and Parse Server integration. Running Parse mobile backend on OpenShift has been greatly simplified and made available in a few commands.

Note: If you're using self-signed certs for your router, then you need to accept them for the dashboard URL and Parse Server URL, otherwise you may see issues.

Create a Namespace and Provide Appropriate Permissions

$ oc new-project parse
$ oc adm policy add-scc-to-user anyuid -z default -n parse
$ oc adm policy add-scc-to-user privileged -z default -n parse

Importing Parse Server Example Template

$ oc create -f https://raw.githubusercontent.com/parse-community/parse-server-example/master/openshift.json
$ oc new-app parse-server-example  -e APP_ID=myappid -e MASTER_KEY=supersecret
$ oc patch route/parse-server-example -p '{"spec":{"tls": {"termination":"edge"}}}'
$ oc get routes -l app=parse-server-example -o jsonpath='{.items[*].spec.host}'
$ PARSE_SERVER_URL=$(oc get routes -l app=parse-server-example -o jsonpath='{.items[*].spec.host}')
$ PARSE_SERVER_URL='https://'$PARSE_SERVER_URL'/parse'
$ oc volume dc/mongodb --remove --name mongodb-data #incase you dont have persistent volume

Deploy Parse Dashboard

$ oc project parse
$ oc new-app https://github.com/parse-community/parse-dashboard.git \
-e PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=true \
-e PARSE_DASHBOARD_SERVER_URL=$PARSE_SERVER_URL \
-e PARSE_DASHBOARD_MASTER_KEY="supersecret" \
-e PARSE_DASHBOARD_APP_ID="myappid" \
-e PARSE_DASHBOARD_APP_NAME="MyApp" \
-e PARSE_DASHBOARD_USER_ID="user1" \
-e PARSE_DASHBOARD_USER_PASSWORD="pass"
$ oc expose dc parse-dashboard --port=4040
$ oc expose svc parse-dashboard
$ oc patch route/parse-dashboard -p '{"spec":{"tls": {"termination":"edge"}}}'
$ oc get routes

How to Use?

Open the the dashboard URL and use the following credentials for logging into the Parse Dashboard: user1/pass
parse dashboard screenshot

Conclusion

You can deploy and scale your Parse Server easily using OpenShift. OpenShift has the capability to autoscale, so deploy your Parse Server and set it to scale on demand.

For simplicity, this post did not use a persistent volume, but if you need data persisted use OpenShift volumes.


关于作者

UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Original series icon

原创节目

关于企业技术领域的创客和领导者们有趣的故事