...
Bahmni ABDM Proxy simulates HRP (Health Repository Providers) in order to allow sharing ABDM secrets across multiple single tenant bahmni instances running as HIU/HIP.
...
The assumption is that all the Bahmni instances are running within the same Kubernetes cluster (any of the 3 approaches depicted in this document).
🔘 Create A record for ABDM Proxy
The assumption is that you have already setup a Also Hosted Zone for your target domain (e.g. mybahmni.in
) and completed the is already setup along with completing this infra setup.
🔘 Create A record for ABDM Proxy
This A record is to have a unique subdomain for ABDM proxy e.g. abdm-proxy.mybahmni.in
. You could either follow Follow this guide for CLI or this for Console (choose Alias to network load-balancer and then select the configured elb from your target aws region).
🔘 Apply ABDM proxy ingress in default namespace
Start by forking this repo https://github.com/BahmniIndiaDistro/abdm-callback-proxy - change the host in ingress.yaml to the alias that you was setup in above earlier setup e.g. abdm-proxy.mybahmni.in
and then apply . Apply the configuration in default namespace
Install kubectl CLI and ensure you have the appropirate aws privilege set on your terminal session before running below commands
Code Block |
---|
kubectl apply -f ingress.yaml |
...
Register individual HIP/HIU as service on the gateway using the shared abdm client secrets
HIU
Code Block |
---|
//HIU curl --location --request PUT 'https://dev.ndhm.gov.in/devservice/v1/bridges/services' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer ENTER_THE_TOKEN' \ --data-raw '{"id":"alpha","name":"Alpha","type":"HIU","active":true,"alias":["Alpha"]}' //HIP |
HIP
Code Block |
---|
curl --location --request PUT 'https://dev.ndhm.gov.in/devservice/v1/bridges/services' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer ENTER_THE_TOKEN' \ --data-raw '{"id":"omega","name":"Omega","type":"HIP","active":true,"alias":["Omega"]}' |
Configure the HIU ID and HIP ID registered with the gateway in the values.yaml of umbrella chart and follow this guide to provision the cluster.
🔘 Configure HIU and HIP instance url on Bahmni ABDM Proxy
Bahmni ABDM proxy uses Nginx + NJS to manage the HIU/HIP map and perform the deligationdelegation. Change the deligateRepository in njs.ts to represent your the bahmni cluster with various instances of bahmni as HIU/HIP. In below example alpha and omega are 2 bahmni instances running as HIP/HIP in different namespace within the same EKS cluster having their own A record defined.
Code Block |
---|
const deligateRepository: { [key: string]: string } = { alpha: 'alpha.mybahmni.in', omega: 'omega.mybahmni.in', }; |
alpha and omega are the same id’s that was configured as service on gateway in earlier step
Build the project using
yarn build
Create and publish docker Image:
docker build -t yourDockerHubRepo/abdm-callback-proxy . && docker push yourDockerHubRepo/abdm-callback-proxy
. It would also require
...
a docker login to
...
target dockerhub account before pushing the image.
...
Setup a new dockerhub repo to maintain the abdm-callback-proxy image versions prior to building and publishing
🔘 Apply abdm proxy service in default namespace
Replace spec.containers.image
in abdm-callback.proxy.yaml with your Dockerhub repo name (instead of bahmniindiadistro/
). Apply the abdm-callback-proxy service in default namesapce
...