Easy installer (Draft)

Overview:

Easy installer is meant to install Sunbird Ed platform on Kubernetes cluster which helps the adopter to setup Sunbird Ed platform within in few hours.

Pre-requisites:

  • Server or Laptop with Ubuntu 20.04 LTS operating system

  • Azure Kubernets Cluster

  • Azure Storage Account

  • Domain name and SSL Certificates

  • Google re-captcha

  • Google OAuth Credentials

To successfully complete Sunbird installation, you need to have:

  • System administrator permissions to the cloud resources

  • Hands-on experience in administering and debugging Linux systems

  • Hands-on experience using Docker and Kubernetes to run containerized workloads

Steps:

  1. Provision Pre-requisites: Current easy installer supports azure cloud service provider. Please provision the following resources required

  2. Update environment values

    • Clone the repository

      git clone https://github.com/project-sunbird/sunbird-devops -b oneclickinstaller
      cd sunbird-devops/oneclickinstaller
      chmod +x *sh
    • Use your favourite text editor and update variables mentioned in global-values.yaml. Follow the instructions mentioned in the global-values.yaml file under every variable

  3. Run the Ed easy installer bash script. While the installer is running, you can view the deployments to the kubernetes cluster using any kubernetes client like kubectl or k9s. This step take 45 min to 1 hour based on the internet speed on the machine where you are running the script. Take a break and check back !

K9s download link: https://k9scli.io/topics/install/

bash ./install-ed.sh /path/to/kubeconfig.yaml -i ed-install  
  1. Manual keycloak configurations

NOTE: These manual configurations will be automated in the next consequent releases

  • Port forward to keycloak pod to access admin console through web browser. If you are running installer from server(not local machine).Make sure SSH tunnel is done b/w local machine to server.Make sure there is no process running on port 8080 on the system from where you are running the installer. Also, make sure context to kubectl is set to the right kubernetes cluster.

    POD_NAME=$(kubectl get pods -n dev | grep keycloak | awk '{print $1}')
    kubectl port-forward -n dev "$POD_NAME" 8080:8080 
  • Go to http://localhost:8080/auth/admin/master/console/#/realms/sunbird/clients

    username: admin password: admin

    • Click lms client -> Select service account roles -> Click on Client roles drop down -> Select realm management -> Select manage-users in Available Roles -> Click on Add Selected

    • Click on Credentials TAB-> Copy the secret value -> Update sunbird_sso_client_secret variable value in global-values.yaml with the copied secret value

    • Click on Realm Settings-> Keys -> Click on public key button-> Copy the key. Update the variables sunbird_sso_publickey and keycloak_sunbird_realm_public_key in global-values.yaml with the copied public key

    • Click on Realm Settings -> Click on Themes -> Select sunbird as a login theme -> click save

  • Goto http://localhost:8080/auth/admin/master/console/#/realms/sunbird/user-federation Click on cassandra-storage-provider -> Copy the Provider ID. Update the sunbird_keycloak_user_federation_provider_id variable in global-values.yaml with the copied Provider ID

  • Goto http://localhost:8080/auth/admin/master/console/#/realms/sunbird/keys -> copy KID of Type RSA . Update the variable keycloak_sunbird_realm_kid in global-values.yaml

  1. Run the Ed easy installer post install script

bash ./install-ed.sh /path/to/kubeconfig.yaml -i postscript  
  1. Update the DNS record: Get the public ip printed on the console and add DNS A record for the same domain you have added to global-values.yaml. Access the Ed instance using https://{domain-name}

Functional Configuration:

Once above steps are completed, functional configurations need to be setup. Following postman collection helps to setup minimal functional configuration.You can leverage same postman collection to setup functional configuration for your use case.

To configure these functionalities, you will need to use the Postman tool. You can download and install the Postman tool by visiting the following link: https://www.postman.com/downloads/.

Please refer the below mentioned postman collection to setup minimal functional configuration for content creation workflow.

Download the postman collection of Sunbird-Ed functional configuration

https://github.com/project-sunbird/sunbird-devops/blob/oneclickinstaller/oneclickinstaller/collection.json

Download the postman environment variable file

https://github.com/project-sunbird/sunbird-devops/blob/oneclickinstaller/oneclickinstaller/environment.json

Import postman collection and environment variables to postman tool

https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#importing-postman-data\

Update below mentioned environmental variables in postman tool. Please refer global_values.yaml file for varaible values.

Environment key name
global_values.yaml key name
Description

host

domain

http://example.co.in/

kong_api_key

Bearer {{core_vault_sunbird_api_auth_token}}

Bearer xxx.yyy.zzz

  • Import the Postman collection and environment files. Then, go to the "Environment" section and choose the "sunbird-easeinstall" environment. Update the values of the "host" and "kong_api_key" variables, and remember to save the changes.

  • Once you have updated the environment variables, click on the "Collections" tab located in the upper-left corner. From the dropdown menu in the upper-right corner, select the desired environment name.

  • Now, you can start triggering the APIs in the collection one by one, following the specified sequence. Proceed to the next API only when the response from the current API is a successful "200" status code.

If you have any queries or facing issues please create a discussion thread at https://github.com/orgs/Sunbird-Ed/discussions/categories/installation

Last updated