Last active
January 28, 2019 03:07
-
-
Save hodrigohamalho/4a779cf44d0f03b1b56387bf13204658 to your computer and use it in GitHub Desktop.
ONS Plataforma deploy Openshift
This file contains hidden or 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
| oc login -u system:admin | |
| oc new-project ons-poc | |
| oc policy add-role-to-user admin developer -n ons-poc | |
| # Setup AMQ 7.x (Based on Artemis Community Project) | |
| # - Image streams | |
| oc create -f https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/amq-broker-72/amq-broker-7-image-streams.yaml -n openshift | |
| oc create -f https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/amq-broker-72/amq-broker-7-scaledown-controller-image-streams.yaml -n openshift | |
| oc create -f https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/amq-broker-72/templates/amq-broker-72-persistence.yaml -n openshift | |
| # - Template | |
| oc create -f https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/amq-broker-72/templates/amq-broker-72-basic.yaml -n openshift | |
| oc login -u developer | |
| # AMQ | |
| oc new-app --template=amq-broker-72-persistence \ | |
| --name amq \ | |
| -p APPLICATION_NAME=amq \ | |
| -p AMQ_NAME=amq \ | |
| -p AMQ_USER=amq \ | |
| -p AMQ_PASSWORD=amq \ | |
| -p VOLUME_CAPACITY=1Gi | |
| # Postgres | |
| oc new-app --template=postgresql-persistent \ | |
| --name=postgres \ | |
| -p POSTGRESQL_USER=postgres \ | |
| -p POSTGRESQL_PASSWORD=postgres \ | |
| -p POSTGRESQL_DATABASE=postgres \ | |
| -p VOLUME_CAPACITY=1Gi \ | |
| -p POSTGRESQL_VERSION=latest \ | |
| -p DATABASE_SERVICE_NAME=postgres \ | |
| # Mongo | |
| oc new-app --template=mongodb-persistent \ | |
| --name=mongo \ | |
| -p MONGODB_USER=mongo \ | |
| -p NAMESPACE=openshift \ | |
| -p DATABASE_SERVICE_NAME=mongo \ | |
| -p MONGODB_USER=mongo \ | |
| -p MONGODB_PASSWORD=mongo \ | |
| -p MONGODB_DATABASE=plataforma \ | |
| -p MONGODB_ADMIN_PASSWORD=mongo \ | |
| -p VOLUME_CAPACITY=1Gi \ | |
| -p MONGODB_VERSION=latest | |
| # Influxdb | |
| oc new-app influxdb:alpine | |
| # API Core | |
| oc new-app https://github.com/marcelomrwin/Plataforma-ApiCore.git \ | |
| --name=apicore \ | |
| --context-dir=plataforma_apicore \ | |
| --strategy=docker \ | |
| -e POSTGRES_HOST=postgres \ | |
| -e POSTGRES_USER=postgres \ | |
| -e POSTGRES_PASSWORD=postgres \ | |
| -e PROCESS_MEMORY_PORT=9091 \ | |
| -e COREAPI_URL=apicore \ | |
| -e COREAPI_PORT=9110 | |
| # Process Memory | |
| oc new-app https://github.com/ONSBR/Plataforma-ProcessMemory.git \ | |
| --name=process-memory \ | |
| -e MONGO_HOST=mongo \ | |
| --strategy=docker \ | |
| -l traefik.backend=process_memory \ | |
| -l "traefik.process_memory.frontend.rule=PathPrefixStrip: /process_memory" \ | |
| -l traefik.docker.network=plataforma_network \ | |
| -l traefik.port=9091 | |
| # Event Manager (Not working yet) | |
| # oc new-app https://github.com/hodrigohamalho/Plataforma-EventManager.git \ | |
| # --name=event-manager \ | |
| # --strategy=docker \ | |
| # -e EXECUTOR_HOST=executor \ | |
| # -e REPLAY_HOST=replay \ | |
| # -e PROCESS_MEMORY_HOST=process_memory \ | |
| # -e ROUTER_HOST=http_router \ | |
| # -e INFLUX_HOST=influxdb \ | |
| # -e APICORE_HOST=apicore \ | |
| # -e RABBITMQ_HOST=amq \ | |
| # -e RABBITMQ_USERNAME=amq \ | |
| # -e RABBITMQ_PASSWORD=amq \ | |
| # -e RABBITMQ_API_PORT=15672 \ | |
| # -e RABBITMQ_AMQP_PORT=5672 \ | |
| # -e MONGO_HOST=mongo:27017 \ | |
| # -e MAESTRO_HOST=maestro | |
| # UI (Front) Not working Yet | |
| # oc new-build nodejs:8~https://github.com/ONSBR/Plataforma-UI.git --name=front-s2i | |
| # oc new-build --name=ui \ | |
| # --context-dir=plataforma_apicore | |
| # --docker-image=registry.access.redhat.com/rhscl/nginx-112-rhel7 \ | |
| # --source-image=front-s2i \ | |
| # --source-image-path=/opt/app-root/src/dist/:. \ | |
| # --dockerfile=$'FROM rhscl/nginx-112-rhel7\nCOPY dist /opt/app-root/src\nCMD ["nginx", "-g", "daemon off;"]' | |
| # Se quiser fazer o eager download de algumas imagens | |
| # docker pull registry.access.redhat.com/amq-broker-7/amq-broker-72-openshift | |
| # docker pull registry.access.redhat.com/openshift/mongodb | |
| # docker pull registry.access.redhat.com/openshift/postgresql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment