rabbah closed pull request #179: put db_host and db_port in db.config configmap URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/179
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/kubernetes/controller/controller.yml b/kubernetes/controller/controller.yml index a279442..c647361 100644 --- a/kubernetes/controller/controller.yml +++ b/kubernetes/controller/controller.yml @@ -156,9 +156,15 @@ spec: name: db.config key: db_protocol - name: "CONFIG_whisk_couchdb_host" - value: "$(COUCHDB_SERVICE_HOST)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_host - name: "CONFIG_whisk_couchdb_port" - value: "$(COUCHDB_SERVICE_PORT_COUCHDB)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_port - name: "CONFIG_whisk_couchdb_provider" valueFrom: configMapKeyRef: diff --git a/kubernetes/couchdb/README.md b/kubernetes/couchdb/README.md index 1622d06..dda82c9 100644 --- a/kubernetes/couchdb/README.md +++ b/kubernetes/couchdb/README.md @@ -9,9 +9,9 @@ The db.auth secret and db.config configmap contain authorization and configuration information for the CouchDB instance being used for this OpenWhisk deployment. The db.auth secret is expected to define two keys: db_username and db_password. The db.config configmap is expected -to define five keys: db_protocol, db_provider, db_prefix, -db_whisk_activations, db_whisk_actions, and db_whisk_auths. The -commands below create them with default values; adjust as needed for +to define the following keys: db_protocol, db_provider, db_host, db_port, +db_prefix, db_whisk_activations, db_whisk_actions, and db_whisk_auths. +The commands below create them with default values; adjust as needed for your deployment. ``` @@ -19,7 +19,7 @@ kubectl -n openwhisk create secret generic db.auth --from-literal=db_username=wh ``` ``` -kubectl -n openwhisk create configmap db.config --from-literal=db_protocol=http --from-literal=db_provider=CouchDB --from-literal=db_whisk_activations=test_activations --from-literal=db_whisk_actions=test_whisks --from-literal=db_whisk_auths=test_subjects --from-literal=db_prefix=test_ +kubectl -n openwhisk create configmap db.config --from-literal=db_protocol=http --from-literal=db_provider=CouchDB --from-literal=db_host=couchdb.openwhisk.svc.cluster.local --from-literal=db_port=5984 --from-literal=db_whisk_activations=test_activations --from-literal=db_whisk_actions=test_whisks --from-literal=db_whisk_auths=test_subjects --from-literal=db_prefix=test_ ``` ## Deploy the CouchDB pod diff --git a/kubernetes/invoker/invoker-dcf.yml b/kubernetes/invoker/invoker-dcf.yml index 63645c8..3f91786 100644 --- a/kubernetes/invoker/invoker-dcf.yml +++ b/kubernetes/invoker/invoker-dcf.yml @@ -172,9 +172,15 @@ spec: name: db.config key: db_protocol - name: "CONFIG_whisk_couchdb_host" - value: "$(COUCHDB_SERVICE_HOST)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_host - name: "CONFIG_whisk_couchdb_port" - value: "$(COUCHDB_SERVICE_PORT_COUCHDB)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_port - name: "CONFIG_whisk_couchdb_provider" valueFrom: configMapKeyRef: diff --git a/kubernetes/invoker/invoker-k8scf.yml b/kubernetes/invoker/invoker-k8scf.yml index 334c6b6..a83a293 100644 --- a/kubernetes/invoker/invoker-k8scf.yml +++ b/kubernetes/invoker/invoker-k8scf.yml @@ -177,9 +177,15 @@ spec: name: db.config key: db_protocol - name: "CONFIG_whisk_couchdb_host" - value: "$(COUCHDB_SERVICE_HOST)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_host - name: "CONFIG_whisk_couchdb_port" - value: "$(COUCHDB_SERVICE_PORT_COUCHDB)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_port - name: "CONFIG_whisk_couchdb_provider" valueFrom: configMapKeyRef: diff --git a/kubernetes/package-kafka/README.md b/kubernetes/package-kafka/README.md index 792e551..2075210 100644 --- a/kubernetes/package-kafka/README.md +++ b/kubernetes/package-kafka/README.md @@ -11,6 +11,8 @@ kubectl -n openwhisk create cm packages.kafkaprovider --from-literal=kafkapkg_db The deployment also has dependencies to secret `whisk.auth` and `db.auth`, and configmap `whisk.ingress`. Make sure you have these settings before you start the deployment. ## Step 1. Install kafka provider +Note, if you are using an external CouchDB or Cloudant database for your deployment, you will need to edit the definition of DB_URL in kafkaprovider.yml. + ``` kubectl apply -f kafkaprovider.yml ``` diff --git a/kubernetes/package-kafka/kafkapkginstaller.yml b/kubernetes/package-kafka/kafkapkginstaller.yml index 6b10dc4..6f929cc 100644 --- a/kubernetes/package-kafka/kafkapkginstaller.yml +++ b/kubernetes/package-kafka/kafkapkginstaller.yml @@ -23,9 +23,15 @@ spec: name: whisk.ingress key: api_host - name: "DB_HOST" - value: "$(COUCHDB_SERVICE_HOST)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_host - name: "DB_PORT" - value: "$(COUCHDB_SERVICE_PORT_COUCHDB)" + valueFrom: + configMapKeyRef: + name: db.config + key: db_port - name: "DB_USERNAME" valueFrom: secretKeyRef: diff --git a/tools/travis/build.sh b/tools/travis/build.sh index fbd65e1..0521d6e 100755 --- a/tools/travis/build.sh +++ b/tools/travis/build.sh @@ -175,7 +175,7 @@ popd echo "Deploying couchdb" pushd kubernetes/couchdb kubectl -n openwhisk create secret generic db.auth --from-literal=db_username=whisk_admin --from-literal=db_password=some_passw0rd - kubectl -n openwhisk create configmap db.config --from-literal=db_protocol=http --from-literal=db_provider=CouchDB --from-literal=db_whisk_activations=test_activations --from-literal=db_whisk_actions=test_whisks --from-literal=db_whisk_auths=test_subjects --from-literal=db_prefix=test_ + kubectl -n openwhisk create configmap db.config --from-literal=db_protocol=http --from-literal=db_provider=CouchDB --from-literal=db_host=couchdb.openwhisk.svc.cluster.local --from-literal=db_port=5984 --from-literal=db_whisk_activations=test_activations --from-literal=db_whisk_actions=test_whisks --from-literal=db_whisk_auths=test_subjects --from-literal=db_prefix=test_ kubectl apply -f couchdb.yml couchdbHealthCheck ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services