This guide provides step-by-step instructions for installing Works using GitHub Actions in an AWS environment.
Github account - signup
Kubectl installed in the system -
AWS account -
Install AWS CLI locally -
Postman - and
A domain host - (example: GoDaddy to configure your server to a domain)
Prepare AWS IAM User
Create an IAM User in your AWS account -
Generate ACCESS_KEY and SECRET_KEY for the IAM user -
Assign administrator access to the IAM user for necessary permissions.
Fork the following repositories with all the branches into your organisation account on :
(We do not need the master data repo since we are using the mdms-v2 by default with data seeded)
Go to the forked works-devops repository:
Navigate to the repository settings.
Go to Secrets and Variables.
Click on the actions options below secrets and variables.
On the new page, choose the new repository secret option in repository secrets and add the following keys mentioned below:
Navigate to the release-githubactions branch in the forked DevOps repository.
Enable GitHub Actions.
Click on Actions, then click on "I understand my workflows, go ahead and enable them":
The following steps can be done either directly in the browser or the local system if you are familiar with Git usage.
Before following any of the steps switch to the release-githubactions branch.
Steps to edit the git repository in the browser -
Steps to edit in the local system if you are familiar with Git basics:
Git clone {forked DevOps repolink}
Follow the below steps and make changes
Note: Make these repository/branch changes before installation; making changes to the configuration repository link in the DevOps repository after installation without understanding what impact they may have will lead to failure in the application functionality.
Navigate to egov-demo.yaml (config-as-code/environments/egov-demo.yaml).
Under the egov-persister: change the gitsync link of the works-config repository to the forked config repository and the branch to DEMO.
Navigate to infra-as-code/terraform/sample-aws.
Open input.yaml and enter details such as domain_name, cluster_name, bucket_name, and db_name.
Navigate to file deploy-as-code/deployer/digit_installer.go
Search for works-demo in the file and check for health-demo-vX.X
Change the version to v1.1-> works-demo-v1.1
Generate SSH key pair.
How to Generate SSH Key Pair - choose one of the following methods to generate an SSH key pair:
Method a: Use an online website. (Note: This is not recommended for production setups, only for demo purposes):
Method b: Use OpenSSL commands:
Once all details are entered, push these changes to the remote GitHub repository. Open the Actions tab in your GitHub account to view the workflow. You should see that the workflow has started, and the pipelines are completed successfully.
Connect to the Kubernetes cluster, from your local machine by using the following command:
Get the CNAME of the nginx-ingress-controller
The output of this will be something like this:
Add the displayed CNAME to your domain provider against your domain name. e.g. GoDaddy domain provider -
After connecting to Kubernetes cluster, edit the deployment of FileStore service using the following command:
The deployment.yaml for Filestore Service will open in VS Code , add the aws key and secret key provided to you in the way shown below:
Close the deployment.yaml file opened in your VS Code editor and the deployment will be updated.
Set up the AWS profile locally by running the following commands:
aws configure --profile {profilename}
fill in the key values as they are prompted
AWS_ACCESS_KEY_ID: <GENERATED_ACCESS_KEY>
AWS_SECRET_ACCESS_KEY: <GENERATED_SECRET_KEY>
AWS_DEFAULT_REGION: ap-south-1
export AWS_PROFILE={profilename}
AWS_ACCESS_KEY_ID: <GENERATED_ACCESS_KEY>
AWS_SECRET_ACCESS_KEY: <GENERATED_SECRET_KEY>
AWS_DEFAULT_REGION: ap-south-1
AWS_REGION: ap-south-1
Then commit and push to the release-githubactions branch
NOTE: Complete all changes at once then commit and push the code to remote to trigger the installation.
Under the egov-indexer: change the gitsync link of the works-config repository to the forked config repository and the branch to DEMO.
openssl genpkey -algorithm RSA -out private_key.pem
ssh-keygen -y -f private_key.pem > ssh_public_key
To view the key run the commands or use any text editor to open the files
vi private_key.pem
vi ssh_public_key
Once generated Navigate to config-as-code/environments
Open egov-demo-secrets.yaml
Search for PRIVATE KEY and replace from -----BEGIN RSA PRIVATE KEY----- to -----BEGIN RSA PRIVATE KEY----- with private_key generated (note: please make sure the private key is indented as given)
Add the public_key to your GitHub account - Git guide
aws eks update-kubeconfig --region ap-south-1 --name $CLUSTER_NAMEkubectl get svc nginx-ingress-controller -n egov -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'export KUBE_EDITOR='code --wait'
kubectl edit deployment egov-filestore -n egovBefore you run the Works application, you need to set up the basic system data such as boundaries of the geography and the master data. In this document, we will illustrate the steps to load the base data for the server.
Create a superuser by using the super_user_createion curl given in the collection.
Add Master data by port-forwading the mdms-v2 service and creating the schema present in the collection. Once all the schema is created add the seed data according to requirements.
Once the master data is set up send the request to the workflow service to create the workflows for the services which require workflows as mentioned in the collection given below.
Encode Aws access key and secret key to base64 encoding
Update the secrets in the cluster (*do not put these in the git DevOps repo files and commit)
If it is not editable by the VI editor, we can use vs code to edit the file, run the below command and run the above step again
Run the below command to delete and restart all the services
Run the command below to check if all pods/services are running. If not, wait for some time and check again:
echo -n "<access key or secret key>" | base64kubectl edit secrets egov-filestore -n egovexport EDITOR='code --wait'kubectl delete pods --all -n egovkubectl get pods -n egov
The DIGIT Works installation comprises five steps to create a new production-ready server that can be scaled on demand. The installation process is currently supported only for AWS. However, support for other cloud platforms such as Azure and GCP will be available in the future.
Step 1: Execute GitHub Action for installation: Execute a GitHub action for the installation process.
Step 2: Execute the System Data Setup: Execute this setup to load system-required data.