All pages
Powered by GitBook
1 of 1

Loading...

Install Using GitHub Actions in AWS

Prerequisites

Before you begin, ensure you have the following: ✅ GitHub account (to fork repositories and manage workflows) ✅ AWS account (to deploy infrastructure) ✅ AWS CLI installed (for authentication & deployment) ✅ Kubectl installed (for managing Kubernetes) ✅ Postman installed (for API testing) ✅ Domain hosting provider (e.g., GoDaddy) for server domain configuration.

Steps

1

Install AWS

  • 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.

  • Use the below command to set up the AWS profile locally:

    • Fill in the key values at the respective prompts

    • Ensure the AWS Account has S3 Bucket access to the Filestore service.

    2

    Fork GitHub Repositories

    Fork the following repositories into your GitHub account: ✅ Health-campaign-devops ✅ Configs

    3

    Add AWS Keys to GitHub Repository

    • Go to the forked health-campaign-devops repository and navigate to the repository settings.

    • Navigate to Secrets and Variables.

    • Add the following secrets under repository secrets:

    • Ensure AWS keys are added to the forked DevOps repository.

    4

    Enable GitHub Actions

    • 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":

    5

    Modify Configuration Files

    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 health-campaign-config repository to the forked config repository and the branch to DEMO.

    • Under the egov-indexer: change the gitsync link of the health-campaign-config repository to the forked config repository and the branch to DEMO.

    • Under the pdf-service: change the git-sync link of the health-campaign-config repository to the forked config repository and the branch to DEMO.

    6

    Configure Infrastructure-as-code

    • 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.

    7

    Configure HCM Version

    • Navigate to the file deploy-as-code/deployer/digit_installer.go

    • Search for health-demo in the file and check for health-demo-vX.X

    • Change the version to v1.7 -> health-demo-v1.7

    8

    Enable HCM Module

    • Navigate to the file deploy-as-code/deployer/digit_installer.go

    • Search for m_health , and add this below this line selectedMod = append(selectedMod, "m_pgr")

    9

    Generate SSH Key Pair

    • Method A: Navigate to this website to generate the SSH Key Pair. (Note: This is not recommended for production setups, only for demo purposes.)

    • Method B: Use OpenSSL commands:

      • 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

    • Once generated, navigate to config-as-code/environments

    • Open egov-demo-secrets.yaml

    • Search for PRIVATE KEY and replace -----BEGIN RSA PRIVATE KEY----- to -----BEGIN RSA PRIVATE KEY----- with private_key generated

    Note: Make sure the private key is indented as given

    • Add the public key to your GitHub account.

    10

    Trigger Installation

    🔹 Push all changes to GitHub. 🔹 Navigate to GitHub Actions and check the workflow. 🔹 Ensure the installation runs successfully.

    11

    Configure Domain Name

    • Connect to the Kubernetes cluster from your local machine using the command below:

    • 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

    12

    Enable Filestore Service

    • After connecting to the Kubernetes cluster, edit the deployment of the 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. The deployment is updated.

    aws eks update-kubeconfig --region ap-south-1 --name $CLUSTER_NAME
    export KUBE_EDITOR='code --wait'
    kubectl edit deployment egov-filestore -n egov
    aws configure --profile {profilename}
     AWS_ACCESS_KEY_ID: <GENERATED_ACCESS_KEY>
     AWS_SECRET_ACCESS_KEY: <GENERATED_SECRET_KEY>
     AWS_DEFAULT_REGION: ap-south-1
     export AWS_PROFILE={profilename}

    vi private_key.pem

  • vi ssh_public_key

  • ae210873da6ff4c03bde2ad22e18fe04-233d3411.ap-south-1.elb.amazonaws.com
    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
    kubectl get svc nginx-ingress-controller -n egov -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'