Openwhisk: Installing openwhisk in multiple nodes

Created on 14 May 2020  路  2Comments  路  Source: apache/openwhisk

Hello guys, I'm trying to set up openwhisk in 3 ubuntu 16.04 nodes.
I want to install openwhisk to have one master node and two slave node on three Ubuntu 16.04 nodes.
However, I couldn't find the appropriate documentation.
So I looked for several issues, but I couldn't get the answer I wanted.
The closest I found was using Jenkins, but I couldn't use it because I'm not using VMs.
I'm also tried adding an invoker to the ansible/environment/local/hosts.j2.ini file in master node, but there is an error that invokers could not pull whisk/invoker image.
What should I do to install openwhisk on multiple nodes?

Most helpful comment

Currently, we are install openwhisk via jenkins with ansible, steps as below

  • Prepared several machines

    • make sure install docker(this is ours: 18.06.3-ce)

    • check your kernel version(this is ours:4.16.1-1.el7.elrepo.x86_64 #1 SMP Sun Apr 8 10:21:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux)

    • add your jenkins's pubKey to all your machines(make sure jenkins machine can connect other machines without username/password)

    • check machines whether can pull openwhisk runtime images

    • install some init lib

sudo easy_install pip
sudo pip install jsonschema
sudo pip install argcomplete
sudo pip install couchdb
sudo pip install markupsafe
sudo pip install docker-py
sudo pip install httplib2==0.9.2
sudo pip install requests==2.10.0
 ```
* Prepare script (just example)
 ```
cat > ${OPENWHISK_HOME}/ansible/environments/local/hosts << EOL
ansible ansible_connection=local
[registry]
${CONTROLLER01} ansible_host=${CONTROLLER01}

[edge]
${CONTROLLER01} ansible_host=${CONTROLLER01}
${CONTROLLER02} ansible_host=${CONTROLLER02}

[apigateway:children]
edge

[redis]
${CONTROLLER01} ansible_host=${CONTROLLER01}

[controllers]
controller0 ansible_host=${CONTROLLER01}
controller1 ansible_host=${CONTROLLER02}

[invokers]
invoker0 ansible_host=${INVOKER01} 
invoker1 ansible_host=${INVOKER02} 
invoker2 ansible_host=${INVOKER03}

[kafkas]
kafka0 ansible_host=${DB01}
kafka1 ansible_host=${DB02}
kafka2 ansible_host=${DB03}


[zookeepers:children]
kafkas

[db]
${DB01} ansible_host=${DB01}
${DB02} ansible_host=${DB02}
${DB03} ansible_host=${DB03}
EOL

cat > ${OPENWHISK_HOME}/ansible/environments/local/group_vars/all << EOL
---
db_provider: CouchDB
db_port: 5984
db_protocol: http
db_username: admin
db_password: admin
# you can add your own configuration here
EOL

cd ${OPENWHISK_HOME}/ansible
ANSIBLE_CMD="ansible-playbook -i environments/local/hosts"

$ANSIBLE_CMD setup.yml
$ANSIBLE_CMD prereq.yml
$ANSIBLE_CMD couchdb.yml
$ANSIBLE_CMD initdb.yml
$ANSIBLE_CMD wipe.yml
$ANSIBLE_CMD kafka.yml
$ANSIBLE_CMD controller.yml
$ANSIBLE_CMD invoker.yml
$ANSIBLE_CMD edge.yml
$ANSIBLE_CMD apigateway.yml
$ANSIBLE_CMD routemgmt.yml
$ANSIBLE_CMD postdeploy.yml

or execute $ANSIBLE_CMD openwhisk.yml
  • check whether ok
cat > ~/.wskprops << EOL
APIHOST=please input apihost
AUTH=please input auth
EOL

wsk action list

All 2 comments

Currently, we are install openwhisk via jenkins with ansible, steps as below

  • Prepared several machines

    • make sure install docker(this is ours: 18.06.3-ce)

    • check your kernel version(this is ours:4.16.1-1.el7.elrepo.x86_64 #1 SMP Sun Apr 8 10:21:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux)

    • add your jenkins's pubKey to all your machines(make sure jenkins machine can connect other machines without username/password)

    • check machines whether can pull openwhisk runtime images

    • install some init lib

sudo easy_install pip
sudo pip install jsonschema
sudo pip install argcomplete
sudo pip install couchdb
sudo pip install markupsafe
sudo pip install docker-py
sudo pip install httplib2==0.9.2
sudo pip install requests==2.10.0
 ```
* Prepare script (just example)
 ```
cat > ${OPENWHISK_HOME}/ansible/environments/local/hosts << EOL
ansible ansible_connection=local
[registry]
${CONTROLLER01} ansible_host=${CONTROLLER01}

[edge]
${CONTROLLER01} ansible_host=${CONTROLLER01}
${CONTROLLER02} ansible_host=${CONTROLLER02}

[apigateway:children]
edge

[redis]
${CONTROLLER01} ansible_host=${CONTROLLER01}

[controllers]
controller0 ansible_host=${CONTROLLER01}
controller1 ansible_host=${CONTROLLER02}

[invokers]
invoker0 ansible_host=${INVOKER01} 
invoker1 ansible_host=${INVOKER02} 
invoker2 ansible_host=${INVOKER03}

[kafkas]
kafka0 ansible_host=${DB01}
kafka1 ansible_host=${DB02}
kafka2 ansible_host=${DB03}


[zookeepers:children]
kafkas

[db]
${DB01} ansible_host=${DB01}
${DB02} ansible_host=${DB02}
${DB03} ansible_host=${DB03}
EOL

cat > ${OPENWHISK_HOME}/ansible/environments/local/group_vars/all << EOL
---
db_provider: CouchDB
db_port: 5984
db_protocol: http
db_username: admin
db_password: admin
# you can add your own configuration here
EOL

cd ${OPENWHISK_HOME}/ansible
ANSIBLE_CMD="ansible-playbook -i environments/local/hosts"

$ANSIBLE_CMD setup.yml
$ANSIBLE_CMD prereq.yml
$ANSIBLE_CMD couchdb.yml
$ANSIBLE_CMD initdb.yml
$ANSIBLE_CMD wipe.yml
$ANSIBLE_CMD kafka.yml
$ANSIBLE_CMD controller.yml
$ANSIBLE_CMD invoker.yml
$ANSIBLE_CMD edge.yml
$ANSIBLE_CMD apigateway.yml
$ANSIBLE_CMD routemgmt.yml
$ANSIBLE_CMD postdeploy.yml

or execute $ANSIBLE_CMD openwhisk.yml
  • check whether ok
cat > ~/.wskprops << EOL
APIHOST=please input apihost
AUTH=please input auth
EOL

wsk action list

Thanks a lot!
I'll try using Jenkins with ansible.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Daniel15 picture Daniel15  路  4Comments

jthomas picture jthomas  路  3Comments

tysonnorris picture tysonnorris  路  3Comments

dubee picture dubee  路  5Comments

rabbah picture rabbah  路  3Comments