Skip to content

ph-ee: detailed instructions for ph-ee-env-template and ph-ee-env-labs #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
47 changes: 46 additions & 1 deletion payment-hub-ee/overview/installation-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,58 @@ Depending on the actual configuration, the payment hub's Helm chart installs the
* Kibana
* Zeebe Operate monitoring UI

Each of these components has a git repository in [https://github.com/openMF](https://github.com/openMF), containing source code and Dockerfiles.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the taking the Initiative to document your experience.

I have a couple of nits. :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


Each component will contain a Jenkinsfile containing tasks related to deployment. Refer to this to understand the build steps of each project.

Most components will also have a Dockerfile. After building the image, you may wish to host these docker images in a local docker registry. This can be done using docker locally per [https://docs.docker.com/registry/deploying/](https://docs.docker.com/registry/deploying/), once you make sure that whatever domain name you use is available via DNS, or a local entry in /etc/hosts.

If you wish to setup a local maven repository to host ph-ee-connector-common, this page describes how to set one up using nginx: [https://stackoverflow.com/questions/13834141/create-local-maven-repository](https://docs.docker.com/registry/deploying/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Looks like a typo, Stackoverflow link points the previous docker link.
  • Can we have a simpler version for ph-ee-connector-common use? In my practice, I just do 'mvn clean install' in my local and this is enough for other services to use connector-common from local mvn registry while building.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that would simplify things. Thanks! I'm a bit new to this as you can probably tell


Certainly all these components have various Kubernetes objects \(ReplicationSets, Services, Ingresses, etc\). The Helm chart wraps all this complexity into a single package and allows a single-command deployment, as we will see very soon.

## First deployment

For the first deployment attempt, we suggest taking one of the 3 Lab Environments for a test-drive.

### ph-ee-engine

The `ph-ee-engine` dependency is defined in [https://github.com/openMF/ph-ee-env-template](https://github.com/openMF/ph-ee-env-template)

The lab environments depend on this component, and are configured to pull this from `http://jenkins.mifos.io:8082`. This can be operated locally by installing a custom host entry in your local hosts file (/etc/hosts on linux), and installing a local web server to serve the files.

A sample nginx vhost file is provided:

```
server {
listen 8082;
listen [::]:8082;

root /var/www/jenkinsmifos-helm;

index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
try_files $uri $uri/ =404;
}
}
```

Add these two entries to your /etc/hosts file. `x.x.x.x` should be replaced with your network IP - as some kubernetes environments run inside a VM, they need a network reachable IP to connect to. Only specifying `127.0.0.1` would make that VM try to connect to itself, not the host which provides the charts.
```
127.0.0.1 jenkins.mifos.io
x.x.x.x jenkins.mifos.io
```

Inspect [https://github.com/openMF/ph-ee-env-template/blob/master/helm/package.sh](https://github.com/openMF/ph-ee-env-template/blob/master/helm/package.sh) for build instructions, and customize the commands to suit your installation. Unless you are remotely pushing the files, you will not need to run scp. Only cp is needed in that case, however please ensure the web root directory (/usr/share/nginx/html) is updated to reflect your configuration. If using the nginx file above, it would be `/var/www/jenkinsmifos-helm`.

Verify your results by doing `curl http://jenkins.mifos.io:8082/index.yaml` to download your index.yaml. If problems occur, check your web server logs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I was thinking of cutting out the Jenkins.mifos.io part completely and move the charts to a GitHub Pages based Helm repo. As seen here. We can take this up later with a proof of concept.

### Deploying the Helm chart

For the first deployment attempt, we suggest taking one of the 3 Lab Environments for a test-drive. Deploying any of there is as simple as cloning the Labs repository, changing directory to eg. [https://github.com/openMF/ph-ee-env-labs/tree/master/helm/payment-hub-med](https://github.com/openMF/ph-ee-env-labs/tree/master/helm/payment-hub-med) and executing the command `helm install <release-name> .`, where release name is freely chosen, eg. `ph-ee-med`, in this case.
Deploying any of there is as simple as cloning the Labs repository, changing directory to eg. [https://github.com/openMF/ph-ee-env-labs/tree/master/helm/payment-hub-med](https://github.com/openMF/ph-ee-env-labs/tree/master/helm/payment-hub-med), installing the dependencies with `helm dep up`, and executing the command `helm install <release-name> .`, where release name is freely chosen, eg. `ph-ee-med`, in this case.

Upgrading an installation with changed or updated configuration parameters is possible with executing the command `helm upgrade <release-name>`.

Expand Down