From 2749501f3bbb50f9f7b0b54d07f7fdeeaf57a68d Mon Sep 17 00:00:00 2001 From: Anthony Amanse Date: Thu, 17 Aug 2017 10:57:05 -0700 Subject: [PATCH] Travis fix (#21) * Fix travis.yml * Fix travis.yml * Fix travis script * Fix travis script * Fix travis script * Fix travis script * Used config map for environment variables * Fix travis * default values * Update README * Update README & minikube fix * Change default IP to PLACEHOLDER string * Update troubleshooting section * Update README --- .travis.yml | 5 + README.md | 29 ++++-- core/auth.yaml | 155 ++++++++++++++++++++++------ core/map.yaml | 155 ++++++++++++++++++++++------ core/mediator.yaml | 155 ++++++++++++++++++++++------ core/player.yaml | 155 ++++++++++++++++++++++------ core/proxy.yaml | 155 ++++++++++++++++++++++------ core/room.yaml | 155 ++++++++++++++++++++++------ core/webapp.yaml | 155 ++++++++++++++++++++++------ gameon-configmap.yaml | 37 +++++++ platform/kafka.yaml | 4 +- scripts/README.md | 14 --- scripts/deploy-to-bluemix/deploy.sh | 10 +- scripts/install.sh | 12 +-- scripts/replace_ip_OSX.sh | 63 ----------- scripts/replace_ip_linux.sh | 61 ----------- setup.yaml | 5 +- 17 files changed, 951 insertions(+), 374 deletions(-) create mode 100644 gameon-configmap.yaml delete mode 100755 scripts/replace_ip_OSX.sh delete mode 100755 scripts/replace_ip_linux.sh diff --git a/.travis.yml b/.travis.yml index fb4041d..45d2aa4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,3 +6,8 @@ before_install: group: stable dist: precise os: linux +notifications: + slack: + secure: hDrr73QN8Fyay6o/ByGgECUdf9BxW2jYgyULFGgF+0OW0zerfG91ASuflUkd60z1hpQcV3PRPMHtw0HBEx4GRSV/CsKNdaOFML3K70pcHn8wcXDiq1RSbInhwfFIkJpssBkJgk1XMAapCfDot+wdd8WhA5Pa1RT5UbvSjg9Xi/sIrKLdnBvKGaOKVSkLLuMmC7U99Yl4U/oYpCCqQys838ZCegbNDgn1ZhomRBBKi02d4wk9xBdiE6CtdmfDrKMZKdvuLN4bUDAXN9DVxV8o6kY1F1Y9ufiAxLC0cThxpwGYebE8Tv1EvinuNNqkhxyKTS5PqNIEiI9vRti4BQ5qYR7kilQGcAy7AZ24YJO7TxtiVpI/pyHanFcgu7Z6bUcETpB1wzl/gP/AA2l0TzY/39mnuWihiH+nWkfcBMNW4mJbvHXlzAkZ7mzHqMKaHSQjxuEDWz6jzdy7xIO5mPLEH83x7ciQ9xQFmhBjg0glXieaINcdkNdC5hnWjBUwkFaoopN5o+1MX2j/0Y7fJNwVd6bbelHhbghkRNcL7wXxk7OnB3ekQfRmHgmjtE0wOTCCJhOHEZdNu7XMi6FRItgBD0cv1wiImdiBX3HwtXO9bVV20KqKLb6lYuUT/rbASg53OqGBFky/5PblZpbJ9vl8gFi3ELmfv3/PtEjduWeZ4Eg= + on_failure: always + on_success: change diff --git a/README.md b/README.md index 7015934..f691ceb 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you want to deploy GameOn! directly to Bluemix, click on 'Deploy to Bluemix' [![Create Toolchain](https://github.com/IBM/container-journey-template/blob/master/images/button.png)](https://console.ng.bluemix.net/devops/setup/deploy/?repository=https://github.com/IBM/GameOn-Java-Microservices-on-Kubernetes) -Please follow the [Toolchain instructions](https://github.com/IBM/container-journey-template/blob/master/Toolchain_Instructions.md) to complete your toolchain and pipeline. +Please follow the [Toolchain instructions](https://github.com/IBM/container-journey-template/blob/master/Toolchain_Instructions_new.md) to complete your toolchain and pipeline. ## Steps 1. [Modify the Core services yaml files](#1-modify-the-core-services-yaml-files) @@ -53,14 +53,28 @@ Please follow the [Toolchain instructions](https://github.com/IBM/container-jour #### [Troubleshooting](#troubleshooting-1) -# 1. Modify the Core services yaml files -You can use the script provided that replaces the default values in the yaml files to the IP of your current cluster. -* `./scripts/replace_ip_linux.sh` for linux -* `./scripts/replace_ip_OSX.sh` for macOS +# 1. Modify the ConfigMap yaml file +Change these values on the `gameon-configmap.yaml` file. Change `PLACEHOLDER_IP` to the public IP of your cluster. You can get the IP from `bx cs workers ` for the Bluemix Container Service. Ex. `192.168.99.100` +> For minikube, you can get the IP using `minikube ip` -> The script replaces every instance of `169.47.241.213` in the files of your [core services](#core-microservices) yaml files and `setup.yaml` to the IP of your cluster *(found by executing `kubectl get nodes`)*. +```yaml +FRONT_END_PLAYER_URL: https://PLACEHOLDER_IP:30443/players/v1/accounts +FRONT_END_SUCCESS_CALLBACK: https://PLACEHOLDER_IP:30443/#/login/callback +FRONT_END_FAIL_CALLBACK: https://PLACEHOLDER_IP:30443/#/game +FRONT_END_AUTH_URL: https://PLACEHOLDER_IP:30443/auth +... +PROXY_DOCKER_HOST: 'PLACEHOLDER_IP' +``` -[Other usage for the script can be found here.](/scripts#replace_ip_-os-sh) +An easy way to change these values is to do +`sed -i s#PLACEHOLDER_IP##g gameon-configmap.yaml`. + +Then, apply the config map on your cluster: +```bash +$ kubectl create -f gameon-configmap.yaml +configmap "gameon-env" created +``` # 2. Create a Volume for your Cluster You would need to create a volume for your cluster. You can use the provided yaml file. The required keystores will be stored in this volume. The volume will also be used by the [core services](#core-microservices). @@ -253,6 +267,7 @@ To register the deployed rooms in the cluster, you will need to use the UI of yo * `kubectl delete svc,deploy,pvc -l app=gameon` * `kubectl delete pod setup` * `kubectl delete pv local-volume-1` + * `kubectl delete -f gameon-configmap.yaml` ## References diff --git a/core/auth.yaml b/core/auth.yaml index 1cf152e..f3761cd 100644 --- a/core/auth.yaml +++ b/core/auth.yaml @@ -41,67 +41,160 @@ spec: name: auth env: - name: service_map - value : https://map:9443/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_map - name: service_room - value : ws://room:9080/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_room - name: service_simpleroom - value : ws://simpleroom:9090/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_simpleroom - name: GITHUB_APP_ID - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_ID - name: GITHUB_APP_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_SECRET - name: TWITTER_CONSUMER_KEY - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_KEY - name: TWITTER_CONSUMER_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_SECRET - name: MAP_SERVICE_URL - value : http://127.0.0.1:6379/map/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_SERVICE_URL - name: PLAYER_SERVICE_URL - value : http://127.0.0.1:6379/players/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: PLAYER_SERVICE_URL - name: COUCHDB_SERVICE_URL - value : http://couchdb:5984 + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_SERVICE_URL - name: KAFKA_SERVICE_URL - value : kafka:9092 + valueFrom: + configMapKeyRef: + name: gameon-env + key: KAFKA_SERVICE_URL - name: FRONT_END_PLAYER_URL - value : https://169.47.241.213:30443/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_PLAYER_URL - name: FRONT_END_SUCCESS_CALLBACK - value : https://169.47.241.213:30443/#/login/callback + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_SUCCESS_CALLBACK - name: FRONT_END_FAIL_CALLBACK - value : https://169.47.241.213:30443/#/game + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_FAIL_CALLBACK - name: FRONT_END_AUTH_URL - value : https://169.47.241.213:30443/auth + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_AUTH_URL - name: GAMEON_MODE - value : development + valueFrom: + configMapKeyRef: + name: gameon-env + key: GAMEON_MODE - name: TARGET_PLATFORM - value : local + valueFrom: + configMapKeyRef: + name: gameon-env + key: TARGET_PLATFORM - name: SYSTEM_ID - value : game-on.org + valueFrom: + configMapKeyRef: + name: gameon-env + key: SYSTEM_ID - name: LICENSE - value : accept + valueFrom: + configMapKeyRef: + name: gameon-env + key: LICENSE - name: PROXY_DOCKER_HOST - value : '169.47.241.213' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST - name: ADMIN_PASSWORD - value : admin + valueFrom: + configMapKeyRef: + name: gameon-env + key: ADMIN_PASSWORD - name: WLP_SKIP_MAXPERMSIZE - value : 'true' + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_SKIP_MAXPERMSIZE - name: WLP_OUTPUT_DIR - value : /opt/ibm/wlp/usr/servers/ + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_OUTPUT_DIR - name: LOG_DIR - value : /opt/ibm/wlp/usr/servers/defaultServer/logs + valueFrom: + configMapKeyRef: + name: gameon-env + key: LOG_DIR - name: MAP_KEY - value : fish + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_KEY - name: COUCHDB_USER - value : mapUser + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_USER - name: COUCHDB_PASSWORD - value : myCouchDBSecret + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_PASSWORD - name: A8_REGISTRY_URL - value : http://registry:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_REGISTRY_URL - name: A8_CONTROLLER_URL - value : http://controller:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_URL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL ports: - containerPort: 9080 name: auth-1 diff --git a/core/map.yaml b/core/map.yaml index a90a324..3317480 100644 --- a/core/map.yaml +++ b/core/map.yaml @@ -41,67 +41,160 @@ spec: name: map env: - name: service_map - value : https://map:9443/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_map - name: service_room - value : ws://room:9080/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_room - name: service_simpleroom - value : ws://simpleroom:9090/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_simpleroom - name: GITHUB_APP_ID - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_ID - name: GITHUB_APP_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_SECRET - name: TWITTER_CONSUMER_KEY - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_KEY - name: TWITTER_CONSUMER_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_SECRET - name: MAP_SERVICE_URL - value : http://127.0.0.1:6379/map/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_SERVICE_URL - name: PLAYER_SERVICE_URL - value : http://127.0.0.1:6379/players/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: PLAYER_SERVICE_URL - name: COUCHDB_SERVICE_URL - value : http://couchdb:5984 + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_SERVICE_URL - name: KAFKA_SERVICE_URL - value : kafka:9092 + valueFrom: + configMapKeyRef: + name: gameon-env + key: KAFKA_SERVICE_URL - name: FRONT_END_PLAYER_URL - value : https://169.47.241.213:30443/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_PLAYER_URL - name: FRONT_END_SUCCESS_CALLBACK - value : https://169.47.241.213:30443/#/login/callback + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_SUCCESS_CALLBACK - name: FRONT_END_FAIL_CALLBACK - value : https://169.47.241.213:30443/#/game + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_FAIL_CALLBACK - name: FRONT_END_AUTH_URL - value : https://169.47.241.213:30443/auth + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_AUTH_URL - name: GAMEON_MODE - value : development + valueFrom: + configMapKeyRef: + name: gameon-env + key: GAMEON_MODE - name: TARGET_PLATFORM - value : local + valueFrom: + configMapKeyRef: + name: gameon-env + key: TARGET_PLATFORM - name: SYSTEM_ID - value : game-on.org + valueFrom: + configMapKeyRef: + name: gameon-env + key: SYSTEM_ID - name: LICENSE - value : accept + valueFrom: + configMapKeyRef: + name: gameon-env + key: LICENSE - name: PROXY_DOCKER_HOST - value : '169.47.241.213' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST - name: ADMIN_PASSWORD - value : admin + valueFrom: + configMapKeyRef: + name: gameon-env + key: ADMIN_PASSWORD - name: WLP_SKIP_MAXPERMSIZE - value : 'true' + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_SKIP_MAXPERMSIZE - name: WLP_OUTPUT_DIR - value : /opt/ibm/wlp/usr/servers/ + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_OUTPUT_DIR - name: LOG_DIR - value : /opt/ibm/wlp/usr/servers/defaultServer/logs + valueFrom: + configMapKeyRef: + name: gameon-env + key: LOG_DIR - name: MAP_KEY - value : fish + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_KEY - name: COUCHDB_USER - value : mapUser + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_USER - name: COUCHDB_PASSWORD - value : myCouchDBSecret + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_PASSWORD - name: A8_REGISTRY_URL - value : http://registry:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_REGISTRY_URL - name: A8_CONTROLLER_URL - value : http://controller:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_URL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL ports: - containerPort: 9080 name: map-1 diff --git a/core/mediator.yaml b/core/mediator.yaml index af22cb9..c37be0c 100644 --- a/core/mediator.yaml +++ b/core/mediator.yaml @@ -41,67 +41,160 @@ spec: name: mediator env: - name: service_map - value : https://map:9443/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_map - name: service_room - value : ws://room:9080/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_room - name: service_simpleroom - value : ws://simpleroom:9090/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_simpleroom - name: GITHUB_APP_ID - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_ID - name: GITHUB_APP_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_SECRET - name: TWITTER_CONSUMER_KEY - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_KEY - name: TWITTER_CONSUMER_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_SECRET - name: MAP_SERVICE_URL - value : http://127.0.0.1:6379/map/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_SERVICE_URL - name: PLAYER_SERVICE_URL - value : http://127.0.0.1:6379/players/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: PLAYER_SERVICE_URL - name: COUCHDB_SERVICE_URL - value : http://couchdb:5984 + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_SERVICE_URL - name: KAFKA_SERVICE_URL - value : kafka:9092 + valueFrom: + configMapKeyRef: + name: gameon-env + key: KAFKA_SERVICE_URL - name: FRONT_END_PLAYER_URL - value : https://169.47.241.213:30443/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_PLAYER_URL - name: FRONT_END_SUCCESS_CALLBACK - value : https://169.47.241.213:30443/#/login/callback + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_SUCCESS_CALLBACK - name: FRONT_END_FAIL_CALLBACK - value : https://169.47.241.213:30443/#/game + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_FAIL_CALLBACK - name: FRONT_END_AUTH_URL - value : https://169.47.241.213:30443/auth + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_AUTH_URL - name: GAMEON_MODE - value : development + valueFrom: + configMapKeyRef: + name: gameon-env + key: GAMEON_MODE - name: TARGET_PLATFORM - value : local + valueFrom: + configMapKeyRef: + name: gameon-env + key: TARGET_PLATFORM - name: SYSTEM_ID - value : game-on.org + valueFrom: + configMapKeyRef: + name: gameon-env + key: SYSTEM_ID - name: LICENSE - value : accept + valueFrom: + configMapKeyRef: + name: gameon-env + key: LICENSE - name: PROXY_DOCKER_HOST - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST - name: ADMIN_PASSWORD - value : admin + valueFrom: + configMapKeyRef: + name: gameon-env + key: ADMIN_PASSWORD - name: WLP_SKIP_MAXPERMSIZE - value : 'true' + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_SKIP_MAXPERMSIZE - name: WLP_OUTPUT_DIR - value : /opt/ibm/wlp/usr/servers/ + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_OUTPUT_DIR - name: LOG_DIR - value : /opt/ibm/wlp/usr/servers/defaultServer/logs + valueFrom: + configMapKeyRef: + name: gameon-env + key: LOG_DIR - name: MAP_KEY - value : fish + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_KEY - name: COUCHDB_USER - value : mapUser + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_USER - name: COUCHDB_PASSWORD - value : myCouchDBSecret + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_PASSWORD - name: A8_REGISTRY_URL - value : http://registry:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_REGISTRY_URL - name: A8_CONTROLLER_URL - value : http://controller:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_URL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL ports: - containerPort: 9080 name: mediator-1 diff --git a/core/player.yaml b/core/player.yaml index 7e9c6d8..69670fa 100644 --- a/core/player.yaml +++ b/core/player.yaml @@ -46,67 +46,160 @@ spec: name: player env: - name: service_map - value : https://map:9443/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_map - name: service_room - value : ws://room:9080/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_room - name: service_simpleroom - value : ws://simpleroom:9090/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_simpleroom - name: GITHUB_APP_ID - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_ID - name: GITHUB_APP_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_SECRET - name: TWITTER_CONSUMER_KEY - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_KEY - name: TWITTER_CONSUMER_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_SECRET - name: MAP_SERVICE_URL - value : http://127.0.0.1:6379/map/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_SERVICE_URL - name: PLAYER_SERVICE_URL - value : http://127.0.0.1:6379/players/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: PLAYER_SERVICE_URL - name: COUCHDB_SERVICE_URL - value : http://couchdb:5984 + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_SERVICE_URL - name: KAFKA_SERVICE_URL - value : kafka:9092 + valueFrom: + configMapKeyRef: + name: gameon-env + key: KAFKA_SERVICE_URL - name: FRONT_END_PLAYER_URL - value : https://169.47.241.213:30443/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_PLAYER_URL - name: FRONT_END_SUCCESS_CALLBACK - value : https://169.47.241.213:30443/#/login/callback + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_SUCCESS_CALLBACK - name: FRONT_END_FAIL_CALLBACK - value : https://169.47.241.213:30443/#/game + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_FAIL_CALLBACK - name: FRONT_END_AUTH_URL - value : https://169.47.241.213:30443/auth + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_AUTH_URL - name: GAMEON_MODE - value : development + valueFrom: + configMapKeyRef: + name: gameon-env + key: GAMEON_MODE - name: TARGET_PLATFORM - value : local + valueFrom: + configMapKeyRef: + name: gameon-env + key: TARGET_PLATFORM - name: SYSTEM_ID - value : game-on.org + valueFrom: + configMapKeyRef: + name: gameon-env + key: SYSTEM_ID - name: LICENSE - value : accept + valueFrom: + configMapKeyRef: + name: gameon-env + key: LICENSE - name: PROXY_DOCKER_HOST - value : '169.47.241.213' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST - name: ADMIN_PASSWORD - value : admin + valueFrom: + configMapKeyRef: + name: gameon-env + key: ADMIN_PASSWORD - name: WLP_SKIP_MAXPERMSIZE - value : 'true' + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_SKIP_MAXPERMSIZE - name: WLP_OUTPUT_DIR - value : /opt/ibm/wlp/usr/servers/ + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_OUTPUT_DIR - name: LOG_DIR - value : /opt/ibm/wlp/usr/servers/defaultServer/logs + valueFrom: + configMapKeyRef: + name: gameon-env + key: LOG_DIR - name: MAP_KEY - value : fish + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_KEY - name: COUCHDB_USER - value : mapUser + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_USER - name: COUCHDB_PASSWORD - value : myCouchDBSecret + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_PASSWORD - name: A8_REGISTRY_URL - value : http://registry:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_REGISTRY_URL - name: A8_CONTROLLER_URL - value : http://controller:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_URL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL ports: - containerPort: 4201 name: player-1 diff --git a/core/proxy.yaml b/core/proxy.yaml index c6cbd1a..63a1a6a 100644 --- a/core/proxy.yaml +++ b/core/proxy.yaml @@ -46,67 +46,160 @@ spec: name: proxy env: - name: service_map - value : https://map:9443/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_map - name: service_room - value : ws://room:9080/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_room - name: service_simpleroom - value : ws://simpleroom:9090/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_simpleroom - name: GITHUB_APP_ID - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_ID - name: GITHUB_APP_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_SECRET - name: TWITTER_CONSUMER_KEY - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_KEY - name: TWITTER_CONSUMER_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_SECRET - name: MAP_SERVICE_URL - value : http://127.0.0.1:6379/map/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_SERVICE_URL - name: PLAYER_SERVICE_URL - value : http://127.0.0.1:6379/players/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: PLAYER_SERVICE_URL - name: COUCHDB_SERVICE_URL - value : http://couchdb:5984 + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_SERVICE_URL - name: KAFKA_SERVICE_URL - value : kafka:9092 + valueFrom: + configMapKeyRef: + name: gameon-env + key: KAFKA_SERVICE_URL - name: FRONT_END_PLAYER_URL - value : https://169.47.241.213:30443/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_PLAYER_URL - name: FRONT_END_SUCCESS_CALLBACK - value : https://169.47.241.213:30443/#/login/callback + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_SUCCESS_CALLBACK - name: FRONT_END_FAIL_CALLBACK - value : https://169.47.241.213:30443/#/game + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_FAIL_CALLBACK - name: FRONT_END_AUTH_URL - value : https://169.47.241.213:30443/auth + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_AUTH_URL - name: GAMEON_MODE - value : development + valueFrom: + configMapKeyRef: + name: gameon-env + key: GAMEON_MODE - name: TARGET_PLATFORM - value : local + valueFrom: + configMapKeyRef: + name: gameon-env + key: TARGET_PLATFORM - name: SYSTEM_ID - value : game-on.org + valueFrom: + configMapKeyRef: + name: gameon-env + key: SYSTEM_ID - name: LICENSE - value : accept + valueFrom: + configMapKeyRef: + name: gameon-env + key: LICENSE - name: PROXY_DOCKER_HOST - value : '169.47.241.213' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST - name: ADMIN_PASSWORD - value : admin + valueFrom: + configMapKeyRef: + name: gameon-env + key: ADMIN_PASSWORD - name: WLP_SKIP_MAXPERMSIZE - value : 'true' + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_SKIP_MAXPERMSIZE - name: WLP_OUTPUT_DIR - value : /opt/ibm/wlp/usr/servers/ + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_OUTPUT_DIR - name: LOG_DIR - value : /opt/ibm/wlp/usr/servers/defaultServer/logs + valueFrom: + configMapKeyRef: + name: gameon-env + key: LOG_DIR - name: MAP_KEY - value : fish + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_KEY - name: COUCHDB_USER - value : mapUser + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_USER - name: COUCHDB_PASSWORD - value : myCouchDBSecret + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_PASSWORD - name: A8_REGISTRY_URL - value : http://registry:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_REGISTRY_URL - name: A8_CONTROLLER_URL - value : http://controller:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_URL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL ports: - containerPort: 80 name: proxy-1 diff --git a/core/room.yaml b/core/room.yaml index 68caa55..2dbadcd 100644 --- a/core/room.yaml +++ b/core/room.yaml @@ -41,67 +41,160 @@ spec: name: room env: - name: service_map - value : https://map:9443/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_map - name: service_room - value : ws://room:9080/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_room - name: service_simpleroom - value : ws://simpleroom:9090/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_simpleroom - name: GITHUB_APP_ID - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_ID - name: GITHUB_APP_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_SECRET - name: TWITTER_CONSUMER_KEY - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_KEY - name: TWITTER_CONSUMER_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_SECRET - name: MAP_SERVICE_URL - value : http://127.0.0.1:6379/map/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_SERVICE_URL - name: PLAYER_SERVICE_URL - value : http://127.0.0.1:6379/players/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: PLAYER_SERVICE_URL - name: COUCHDB_SERVICE_URL - value : http://couchdb:5984 + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_SERVICE_URL - name: KAFKA_SERVICE_URL - value : kafka:9092 + valueFrom: + configMapKeyRef: + name: gameon-env + key: KAFKA_SERVICE_URL - name: FRONT_END_PLAYER_URL - value : https://169.47.241.213:30443/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_PLAYER_URL - name: FRONT_END_SUCCESS_CALLBACK - value : https://169.47.241.213:30443/#/login/callback + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_SUCCESS_CALLBACK - name: FRONT_END_FAIL_CALLBACK - value : https://169.47.241.213:30443/#/game + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_FAIL_CALLBACK - name: FRONT_END_AUTH_URL - value : https://169.47.241.213:30443/auth + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_AUTH_URL - name: GAMEON_MODE - value : development + valueFrom: + configMapKeyRef: + name: gameon-env + key: GAMEON_MODE - name: TARGET_PLATFORM - value : local + valueFrom: + configMapKeyRef: + name: gameon-env + key: TARGET_PLATFORM - name: SYSTEM_ID - value : game-on.org + valueFrom: + configMapKeyRef: + name: gameon-env + key: SYSTEM_ID - name: LICENSE - value : accept + valueFrom: + configMapKeyRef: + name: gameon-env + key: LICENSE - name: PROXY_DOCKER_HOST - value : '169.47.241.213' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST - name: ADMIN_PASSWORD - value : admin + valueFrom: + configMapKeyRef: + name: gameon-env + key: ADMIN_PASSWORD - name: WLP_SKIP_MAXPERMSIZE - value : 'true' + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_SKIP_MAXPERMSIZE - name: WLP_OUTPUT_DIR - value : /opt/ibm/wlp/usr/servers/ + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_OUTPUT_DIR - name: LOG_DIR - value : /opt/ibm/wlp/usr/servers/defaultServer/logs + valueFrom: + configMapKeyRef: + name: gameon-env + key: LOG_DIR - name: MAP_KEY - value : fish + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_KEY - name: COUCHDB_USER - value : mapUser + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_USER - name: COUCHDB_PASSWORD - value : myCouchDBSecret + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_PASSWORD - name: A8_REGISTRY_URL - value : http://registry:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_REGISTRY_URL - name: A8_CONTROLLER_URL - value : http://controller:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_URL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL ports: - containerPort: 9080 name: room-1 diff --git a/core/webapp.yaml b/core/webapp.yaml index d5b9227..623d786 100644 --- a/core/webapp.yaml +++ b/core/webapp.yaml @@ -36,67 +36,160 @@ spec: name: webapp env: - name: service_map - value : https://map:9443/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_map - name: service_room - value : ws://room:9080/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_room - name: service_simpleroom - value : ws://simpleroom:9090/rooms + valueFrom: + configMapKeyRef: + name: gameon-env + key: service_simpleroom - name: GITHUB_APP_ID - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_ID - name: GITHUB_APP_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: GITHUB_APP_SECRET - name: TWITTER_CONSUMER_KEY - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_KEY - name: TWITTER_CONSUMER_SECRET - value : '' + valueFrom: + configMapKeyRef: + name: gameon-env + key: TWITTER_CONSUMER_SECRET - name: MAP_SERVICE_URL - value : http://127.0.0.1:6379/map/map/v1/sites + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_SERVICE_URL - name: PLAYER_SERVICE_URL - value : http://127.0.0.1:6379/players/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: PLAYER_SERVICE_URL - name: COUCHDB_SERVICE_URL - value : http://couchdb:5984 + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_SERVICE_URL - name: KAFKA_SERVICE_URL - value : kafka:9092 + valueFrom: + configMapKeyRef: + name: gameon-env + key: KAFKA_SERVICE_URL - name: FRONT_END_PLAYER_URL - value : https://169.47.241.213:30443/players/v1/accounts + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_PLAYER_URL - name: FRONT_END_SUCCESS_CALLBACK - value : https://169.47.241.213:30443/#/login/callback + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_SUCCESS_CALLBACK - name: FRONT_END_FAIL_CALLBACK - value : https://169.47.241.213:30443/#/game + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_FAIL_CALLBACK - name: FRONT_END_AUTH_URL - value : https://169.47.241.213:30443/auth + valueFrom: + configMapKeyRef: + name: gameon-env + key: FRONT_END_AUTH_URL - name: GAMEON_MODE - value : development + valueFrom: + configMapKeyRef: + name: gameon-env + key: GAMEON_MODE - name: TARGET_PLATFORM - value : local + valueFrom: + configMapKeyRef: + name: gameon-env + key: TARGET_PLATFORM - name: SYSTEM_ID - value : game-on.org + valueFrom: + configMapKeyRef: + name: gameon-env + key: SYSTEM_ID - name: LICENSE - value : accept + valueFrom: + configMapKeyRef: + name: gameon-env + key: LICENSE - name: PROXY_DOCKER_HOST - value : '169.47.241.213' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST - name: ADMIN_PASSWORD - value : admin + valueFrom: + configMapKeyRef: + name: gameon-env + key: ADMIN_PASSWORD - name: WLP_SKIP_MAXPERMSIZE - value : 'true' + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_SKIP_MAXPERMSIZE - name: WLP_OUTPUT_DIR - value : /opt/ibm/wlp/usr/servers/ + valueFrom: + configMapKeyRef: + name: gameon-env + key: WLP_OUTPUT_DIR - name: LOG_DIR - value : /opt/ibm/wlp/usr/servers/defaultServer/logs + valueFrom: + configMapKeyRef: + name: gameon-env + key: LOG_DIR - name: MAP_KEY - value : fish + valueFrom: + configMapKeyRef: + name: gameon-env + key: MAP_KEY - name: COUCHDB_USER - value : mapUser + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_USER - name: COUCHDB_PASSWORD - value : myCouchDBSecret + valueFrom: + configMapKeyRef: + name: gameon-env + key: COUCHDB_PASSWORD - name: A8_REGISTRY_URL - value : http://registry:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_REGISTRY_URL - name: A8_CONTROLLER_URL - value : http://controller:8080 + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_URL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL - name: A8_CONTROLLER_POLL - value : 5s + valueFrom: + configMapKeyRef: + name: gameon-env + key: A8_CONTROLLER_POLL ports: - containerPort: 8080 name: webapp-1 diff --git a/gameon-configmap.yaml b/gameon-configmap.yaml new file mode 100644 index 0000000..82ca292 --- /dev/null +++ b/gameon-configmap.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: gameon-env + namespace: default +data: + service_map: https://map:9443/map/v1/sites + service_room: ws://room:9080/rooms + service_simpleroom: ws://simpleroom:9090/rooms + GITHUB_APP_ID: '' + GITHUB_APP_SECRET: '' + TWITTER_CONSUMER_KEY: '' + TWITTER_CONSUMER_SECRET: '' + MAP_SERVICE_URL: http://127.0.0.1:6379/map/map/v1/sites + PLAYER_SERVICE_URL: http://127.0.0.1:6379/players/players/v1/accounts + COUCHDB_SERVICE_URL: http://couchdb:5984 + KAFKA_SERVICE_URL: kafka:9092 + FRONT_END_PLAYER_URL: https://PLACEHOLDER_IP:30443/players/v1/accounts + FRONT_END_SUCCESS_CALLBACK: https://PLACEHOLDER_IP:30443/#/login/callback + FRONT_END_FAIL_CALLBACK: https://PLACEHOLDER_IP:30443/#/game + FRONT_END_AUTH_URL: https://PLACEHOLDER_IP:30443/auth + GAMEON_MODE: development + TARGET_PLATFORM: local + SYSTEM_ID: game-on.org + LICENSE: accept + PROXY_DOCKER_HOST: 'PLACEHOLDER_IP' + ADMIN_PASSWORD: admin + WLP_SKIP_MAXPERMSIZE: 'true' + WLP_OUTPUT_DIR: /opt/ibm/wlp/usr/servers/ + LOG_DIR: /opt/ibm/wlp/usr/servers/defaultServer/logs + MAP_KEY: fish + COUCHDB_USER: mapUser + COUCHDB_PASSWORD: myCouchDBSecret + A8_REGISTRY_URL: http://registry:8080 + A8_CONTROLLER_URL: http://controller:8080 + A8_CONTROLLER_POLL: 5s + A8_CONTROLLER_POLL: 5s diff --git a/platform/kafka.yaml b/platform/kafka.yaml index f328966..4489717 100644 --- a/platform/kafka.yaml +++ b/platform/kafka.yaml @@ -33,11 +33,11 @@ spec: name: kafka env: - name: ADVERTISED_HOST - value: kafka + value: localhost - name: ADVERTISED_PORT value: '9092' - name: AUTO_CREATE_TOPICS value: "true" ports: - containerPort: 9092 - name: kafka \ No newline at end of file + name: kafka diff --git a/scripts/README.md b/scripts/README.md index b95be39..dfd79d3 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -6,17 +6,3 @@ Requirements are having a Bluemix account, deployed Cluster in Bluemix container ## install.sh The script for Travis. It runs build and checks if the build has passed or failed. - -## replace\_ip\_< os >.sh -The script for modifying the yaml files in the **core** folder and **setup.yaml**. - -* Usage: - -1. `replace_ip_.sh` - * replaces every instance of `169.47.241.213` in the yaml files inside your **core** folder and **setup.yaml** to the IP of your cluster *(found by executing `kubectl get nodes`)*. -2. `replace_ip_.sh ` - * replaces every instance of `` to the IP of your cluster *(found by executing `kubectl get nodes`)*. - * Ex: `replace_ip_OSX.sh 169.47.241.213` replaces every `169.47.241.213` in the files mentioned above. -3. `replace_ip_.sh ` - * replaces every instance of `` to `` - * Ex: `replace_ip_OSX.sh 169.47.241.213 192.168.99.100` replaces every `169.47.241.213` to `192.168.99.100` diff --git a/scripts/deploy-to-bluemix/deploy.sh b/scripts/deploy-to-bluemix/deploy.sh index 56259c5..d88b550 100755 --- a/scripts/deploy-to-bluemix/deploy.sh +++ b/scripts/deploy-to-bluemix/deploy.sh @@ -2,7 +2,7 @@ echo "Creating GameOn App" -IP_ADDR=$(bx cs workers $CLUSTER_NAME | grep normal | awk '{ print $2 }') +IP_ADDR=$(bx cs workers $CLUSTER_NAME | grep normal | awk '{ print $2 }' | head -1) if [ -z $IP_ADDR ]; then echo "$CLUSTER_NAME not created or workers not ready" echo "Running clusters are: " @@ -24,6 +24,7 @@ if [ $? -ne 0 ]; then fi eval "$exp" +kubectl delete --ignore-not-found=true -f gameon-configmap.yaml kubectl delete pvc -l app=gameon kubectl delete --ignore-not-found=true -f core kubectl delete --ignore-not-found=true -f platform @@ -38,6 +39,11 @@ do done kubectl delete --ignore-not-found=true -f local-volume.yaml + +sed -i s#PLACEHOLDER_IP#$IP_ADDR#g gameon-configmap.yaml + +echo -e "Creating config map" +kubectl create -f gameon-configmap.yaml echo -e "Creating local volumes" kubectl create -f local-volume.yaml @@ -128,7 +134,7 @@ code=$(curl -sw '%{http_code}' http://$IP_ADDR:31300/uptime -o /dev/null) sleep 5s done -sed -i s#169.47.241.213#$IP_ADDR#g core/* + kubectl create -f core diff --git a/scripts/install.sh b/scripts/install.sh index f8cc8f3..b9d783b 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -25,6 +25,7 @@ sudo mv ./kubectl /usr/local/bin/kubectl function cluster_setup() { bx cs workers $CLUSTER_NAME $(bx cs cluster-config $CLUSTER_NAME | grep export) +kubectl delete --ignore-not-found=true -f gameon-configmap.yaml kubectl delete pvc -l app=gameon kubectl delete --ignore-not-found=true -f core kubectl delete --ignore-not-found=true -f platform @@ -43,7 +44,8 @@ function initial_setup() { IP=$(kubectl get nodes | grep Ready | awk '{print $1}' | head -1) kubectl create -f local-volume.yaml sleep 5s -sed -i s#169\.47\.241\.213#$IP#g setup.yaml +sed -i s#PLACEHOLDER_IP#$IP#g gameon-configmap.yaml +kubectl create -f gameon-configmap.yaml kubectl create -f setup.yaml echo "Waiting for container to setup" sleep 45 @@ -70,7 +72,6 @@ done } function create_platform_services() { -IP=$(kubectl get nodes | grep Ready | awk '{print $1}') kubectl create -f platform echo "Waiting for pods to setup" @@ -93,7 +94,7 @@ done echo "Pods for the platform services are now Running." echo "Waiting for the amalgam8 controlplane to finish setup..." - +IP=$(kubectl get po -l tier=controller -o jsonpath='{.items[0].status.hostIP}') TRIES=0 while true do @@ -110,7 +111,7 @@ code=$(curl -sw '%{http_code}' http://$IP:31200/health -o /dev/null) TRIES=$((TRIES+1)) sleep 5s done - +IP=$(kubectl get po -l tier=registry -o jsonpath='{.items[0].status.hostIP}') TRIES=0 while true do @@ -130,9 +131,6 @@ done } function create_core_services() { -IP=$(kubectl get nodes | grep Ready | awk '{print $1}') - -sed -i s#169.47.241.213#$IP#g core/* kubectl create -f core diff --git a/scripts/replace_ip_OSX.sh b/scripts/replace_ip_OSX.sh deleted file mode 100755 index 4ad4abd..0000000 --- a/scripts/replace_ip_OSX.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -if [ -z $1 ] -then - defaultIP=$(cat core/* | grep 169.47.241.213) - if [[ -z $defaultIP ]] - then - echo "169.47.241.213 not found in yaml files. Please use ./scripts/replace_ip_.sh " - else - kubectl get nodes - IP_ADDR=$(kubectl get nodes | grep Ready | awk '{print $1}' | head -1) - echo "Replacing 169.47.241.213 to $IP_ADDR in core/*.yaml and setup.yaml" - for filename in core/*.yaml - do - sed -i '' s#169\.47\.241\.213#$IP_ADDR# $filename - done - - sed -i '' s#169\.47\.241\.213#$IP_ADDR# setup.yaml - fi -else - ip=$1 - if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]] - then - OIFS=$IFS - IFS='.' - ip=($ip) - IFS=$OIFS - [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ - && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] - stat=$? - if [ $stat -eq 0 ] - then - prevIP=$(cat core/* | grep $1) - if [[ -z $prevIP ]] - then - echo "$1 not found in yaml files. Please check your yaml files." - else - if [[ -z $2 ]] - then - kubectl get nodes - IP_ADDR=$(kubectl get nodes | grep Ready | awk '{print $1}' | head -1) - echo "Replacing $1 to $IP_ADDR in core/*.yaml and setup.yaml" - for filename in core/*.yaml - do - sed -i '' s#$1#$IP_ADDR# $filename - done - sed -i '' s#$1#$IP_ADDR# setup.yaml - else - echo "Replacing $1 to $2 in core/*.yaml and setup.yaml" - for filename in core/*.yaml - do - sed -i '' s#$1#$2# $filename - done - sed -i '' s#$1#$2# setup.yaml - fi - fi - else - echo "Invalid IP" - fi - else - echo "Invalid IP format" - fi -fi diff --git a/scripts/replace_ip_linux.sh b/scripts/replace_ip_linux.sh deleted file mode 100755 index 640cb72..0000000 --- a/scripts/replace_ip_linux.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -kubectl get nodes -IP_ADDR=$(kubectl get nodes | grep Ready | awk '{print $1}' | head -1) - -if [ -z $1 ] -then - defaultIP=$(cat core/* | grep 169.47.241.213) - if [[ -z $defaultIP ]] - then - echo "169.47.241.213 not found in yaml files. Please use ./scripts/replace_ip_.sh " - else - echo "Replacing 169.47.241.213 to $IP_ADDR in core/*.yaml and setup.yaml" - for filename in core/*.yaml - do - sed -i s#169\.47\.241\.213#$IP_ADDR# $filename - done - - sed -i s#169\.47\.241\.213#$IP_ADDR# setup.yaml - fi -else - ip=$1 - if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]] - then - OIFS=$IFS - IFS='.' - ip=($ip) - IFS=$OIFS - [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ - && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] - stat=$? - if [ $stat -eq 0 ] - then - prevIP=$(cat core/* | grep $1) - if [[ -z $prevIP ]] - then - echo "$1 not found in yaml files. Please check your yaml files." - else - if [[ -z $2 ]] - then - echo "Replacing $1 to $IP_ADDR in core/*.yaml and setup.yaml" - for filename in core/*.yaml - do - sed -i s#$1#$IP_ADDR# $filename - done - sed -i s#$1#$IP_ADDR# setup.yaml - else - echo "Replacing $1 to $2 in core/*.yaml and setup.yaml" - for filename in core/*.yaml - do - sed -i s#$1#$2# $filename - done - sed -i s#$1#$2# setup.yaml - fi - fi - else - echo "Invalid IP" - fi - else - echo "Invalid IP format" - fi -fi diff --git a/setup.yaml b/setup.yaml index 15dfccc..23496d5 100644 --- a/setup.yaml +++ b/setup.yaml @@ -12,7 +12,10 @@ spec: image: anthonyamanse/keystore env: - name: IP - value: '169.47.241.213' + valueFrom: + configMapKeyRef: + name: gameon-env + key: PROXY_DOCKER_HOST volumeMounts: - name: keystore mountPath: /tmp/keystore/