This repository is deprecated in favor of https://github.com/openwisp/docker-openwisp
I've tested installation of openwisp-controller, openwisp-network-topology, openwisp-radius & openwisp-dashboard with a redis instance and a postgresql instance.
I've also tested horizontal scaling with docker swarm & kubernetes.
The sample files for deployment on kubernetes is available in the kubernetes/ directory. You can also deploy the same using terraform and the relevant files are present in terraform/.
Images are available on docker hub and can be pulled from the following links:
- OpenWISP Dashboard - 
atb00ker/ready-to-run:openwisp-dashboard - OpenWISP Radius - 
atb00ker/ready-to-run:openwisp-radius - OpenWISP Controller - 
atb00ker/ready-to-run:openwisp-controller - OpenWISP Network Topology - 
atb00ker/ready-to-run:openwisp-topology - OpenWISP Nginx - 
atb00ker/ready-to-run:openwisp-nginx - OpenWISP Orchestration - 
atb00ker/ready-to-run:openwisp-orchestration 
Test using:
- 
(optional) Setup a Kubernetes Cluster: A guide for setting up the cluster on bare-metal machines is available here and the guide to get started with kubernetes-dashboard (Web UI) is available here.
 - 
Set external IP: You need to set the external IP for all the services. This is the IP on which you will access your openwisp applications. All the services are in this file. Please do
ctrl+fto find172.16.6.2*and replace with your server's external IP in this file. - 
(optional) Customization: You can change the settings in the container by changing the environment variables. You can pass the environment variables by changing this file. You can add any of the variables from the list here.
 
- The ConfigMap with name 
postgres-configwill pass the environment variables only to the postgresql container. - The ConfigMap with name 
common-configwill pass the environment variables to all the openwisp containers. - The ConfigMap with name 
controller-configwill pass the environment variables to only the openwisp-controller container. If required, newConfigMapcan be easily set and added to the service as done here. 
- If you are doing bare-metal setup, follow the steps below to setup nfs-provisioner:
 
4.1. Install NFS requirements: sudo apt install nfs-kernel-server nfs-common
4.2. Setup storage directory:
sudo mkdir -p /mnt/kubes
sudo chown nobody: /mnt/kubes
4.3. Export the directory file system - inside the /etc/exports file add line: /mnt/kubes    *(rw,sync,no_root_squash,no_subtree_check,no_all_squash,insecure) and then export sudo exportfs -rav
- 
helm install --set storageClass.name=nfs-provisioner --set nfs.server=<ip-address> --set nfs.path=/mnt/kubes stable/nfs-client-provisioner - 
helm install --name cert-manager --namespace kube-system stable/cert-manager - 
Apply to Kubernetes Cluster: You need to apply all the files in the
kubernetes/directory to your cluster. You can use the Web UI to create new components or you can usekubectl apply -f <filename>to apply from CLI. SomeReplicationControllersare dependant on other components, so it'll be useful to apply them at last. I recommend to follow this order: 
$ kubectl apply -f ConfigMap.yml
$ kubectl apply -f ClusterIssuer.yml
$ kubectl apply -f PresistentVolumeClaim.yml
$ kubectl apply -f Service.yml
$ kubectl apply -f Ingress.yml
$ kubectl apply -f ReplicationController.yml
NOTE: Wait for a while after every file. Containers will take a little while to boot up. You can see the status on the Web UI or on CLI by kubectl get all --namespace=default command. These files have some variables inside them as well.
Read the content of the files before deploying and change according to your needs.
Testing on docker-compose is relatively less resource and time consuming.
- Install docker-compose: 
pip install docker-compose - (optional) Congfigure: Manipulate all the values in the .env file as you desire & run 
make_secret_key.pyto generate a new secret key. - Pull all the required images to avoid building them. (building images is a time consuming task.)
 
docker pull atb00ker/ready-to-run:openwisp-dashboard
docker pull atb00ker/ready-to-run:openwisp-radius
docker pull atb00ker/ready-to-run:openwisp-controller
docker pull atb00ker/ready-to-run:openwisp-topology
docker pull atb00ker/ready-to-run:openwisp-orchestratoin
docker pull atb00ker/ready-to-run:openwisp-nginx- 
Run containers: Inside root of the repository, run
docker-compose up. It will take a while for the containers to start up. (~1 minute) - 
When the containers are ready, you can test them out by going to the domain name that you've set for the modules. (if the domains used are not registered domains, you'll need to add them to the /etc/hosts)
 
Note:
- Default username & password are 
admin. - Default domains are: dashboard.openwisp.org, controller.openwisp.org, radius.openwisp.org and topology.openwisp.org.
 - You may want to add the domains in your hosts file, command: 
echo "127.0.0.1 dashboard.openwisp.org controller.openwisp.org radius.openwisp.org topology.openwisp.org" >> /etc/hosts/ 
Note(pipenv): Remember changing the values in .env file does nothing because .env is also a special file in pipenv, you need to change the values in .env file then re-activate environment to ensure that the changes reflect.
Guide to build images again with modification or with different environment variables.
- Install docker-compose: 
pip install docker-compose - (optional) Congfigure: Manipulate all the values in the .env file as you desire & run 
make_secret_key.pyto generate a new secret key. - Make desired changes in the Dockerfiles.
 - You can build the containers with 
docker-compose build. - After that do 
docker-compose up, when the containers are ready, you can test them out by going to the domain name of the modules. 
Note:
- Default username & password are 
admin. - Default domains are: dashboard.openwisp.org, controller.openwisp.org, radius.openwisp.org and topology.openwisp.org.
 - You may want to add the domains in your hosts file, command: 
echo "127.0.0.1 dashboard.openwisp.org controller.openwisp.org radius.openwisp.org topology.openwisp.org" >> /etc/hosts/ - You may want to change 
createProdCertstocreateDevCertsin thebuild/openwisp_orchestration/init_command.shfile for development to get self-signed certificates. 
