Only show these results:

Installing Nylas on AWS

On-Prem is only available to Enterprise customers. Before deploying, please reach out to our sales team.

You'll learn what tools are needed, how to install cloud-core-kots, Kubernetes, and finally deploy your instance of Nylas on AWS.

Prerequisites

Configure the aws-cli

After installing the aws-cli, you’ll need to configure it for Nylas On-Prem. Run aws-configure and update your settings.

    $ aws configure
AWS Access Key ID [None]: <YOUR_AWS_ACCESS_KEY_ID>
AWS Secret Access Key [None]: <YOUR_AWS_SECRET_ACCESS_KEY>
Default region name [None]: <YOUR_AWS_REGION>
Default output format [None]: json

Multiple Accounts

If you need to use multiple accounts with your aws-cli, follow the steps in Named Profiles.

After setting up your profiles, you can run the commands with the profile of your choice. For example:

aws eks --region us-west-2 update-kubeconfig --name cloudcore-kots-dev-usw2-eks --profile <name of your profile>   

Clone the cloud-core-kots Repository

  1. Run git clone git@github.com:nylas/cloud-core-kots.git
  2. cd into the terraform folder of your choice; aws, gcp or azure.
  3. In the terraform.tfvars file you need to update your VPC IDs and subnets.
  4. Update the region if needed to match your AWS region.

Initialize Terraform Workspace

  1. Run terraform init. Running terraform init will retrieve the necessary packages to create a Kubernetes cluster using AWS EKS and RDS, to run your Nylas Instance.

AWS Terraform Init

  1. Run terraform plan to make sure that the terraform script that you’re going to run is not going to delete **or modify any existing infrastructure.

You should see 0 change, 0 to destroy!

DO NOT CONTINUE unless you see 0 change, 0 to destroy! Unless you intend to make real modifications on your AWS console!

AWS DO NOT CONTINUE unless you see 0 change, 0 to destroy

Provision Your EKS Cluster

The Terraform scripts will guide you through provisioning your AWS EKS clusters.

  1. Run terraform apply. terraform apply will show you a preview of the plan that will get applied. If you want to make changes to your Terraform, .tf files, then type no and update your configuration.
  2. Once you are satisfied with the configuration, run terraform apply and make sure the plan shows 47 to add, 0 changes, and 0 to destroy to make sure you’re only adding provisions to your AWS console.

This should take about 20 minutes

On a successful install, you should see:

AWS Terraform Successful Install

Configure Your Kubernetes Cluster

  1. Run aws eks --region us-west-2 update-kubeconfig --name <name of your cluster>.

AWS Profiles

If you are using an AWS profile use
aws eks --region us-west-2 update-kubeconfig --name cloudcore-kots-dev-usw2-eks --profile <name of your profile>

  1. Test that you’re able to connect with: kubectl cluster-info. You get a response similar to:

AWS connect to kubectl

Install Nylas on Your Kubernetes Cluster

Requirements:

  • Your Kubernetes cluster must be able to access your database.
  1. Run curl https://kots.io/install | bash kubectl kots install nylas. This will install Nylas and start the admin dashboard.
  2. As part of setup, it will ask you to create a password. You’ll need this later to log in to your Nylas Dashboard.

On successful install you should see:

What a successful kots install looks like

Admin Password

Make sure you create an admin password. You’ll need it in later steps.

Log In To Your On-Prem Nylas Dashboard

  1. Open http://localhost:8800 in your browser. It will open the Nylas Admin Console.
  2. Enter your password you created during Install Nylas on Your Kubernetes Cluster.

Nylas admin console

  1. You’ll be asked to upload a license file. You can get this from your sales representative or reach out to sales@nylas.com.
  2. Once you license is finished uploading, you will be able to configure your database.

Nylas admin console configure your APIs

We highly recommend that you keep your HTTP connections via VPN only access (this means that the service is an internal load balancer).

HTTP (vpn only access)

  • will attach an internal load balancer annotation

HTTP (external access)

  • will expose the load balancer externally

URL of the Nylas API

  • We also recommend that you create a domain with an ingress so that you’ll be to run the OAuth flows more smoothly and incase your service names change in the future.
  • The Nylas API URL will be equivalent to api.nylas.com
  • If you do not plan on using ingresses and only port-forwarding, use localhost:

Add a callback URL

You will need to add a callback URL to your application in your app settings so that your redirect url is registered properly http://localhost:4444/applications/<application_id>/accounts otherwise you’ll get redirect errors if you auth via the Dashboard using Hosted Auth.

Add callback URL

URL of the Nylas Dashboard

  • We also recommend that you create a domain with an ingress so that you’ll be to run the OAuth flows more smoothly and incase your service names change in the future.
  • The Nylas Dashboard url will be equivalent to dashboard.nylas.com
    • the dashboard is a web application where you will be able to create applications and set OAuth keys
  • If you do not plan on using ingresses and only port-forwarding, use localhost:
  1. Next, we’ll run a Preflight check. The preflight checks make sure that all the version and resource requirements are met for Nylas to run.
    1. Yellow messages are okay. You should review them for the best experience.
    2. Red preflight checks should be correct right away.

Successful preflight checks

Unsuccessful preflight check will not allow you to update

  1. Click Continue. The build will take 5 to 10 minutes and the status will update once completed. You’ll be taken to the Dashboard where you manage your cluster.

Successful Deployment

Deployment Troubleshooting

If you are seeing issues, check your Kubernetes pods to see if there are any errors, pending or init stages. If it is taking a long time, there could be networking issues. If it is still showing init, scripts are still running.

Create a Nylas Application

Now that you have installed Nylas on AWS you can start using the API.

You will be using port forwarding to access the API and Nylas Dashboard. Port forwarding will let you access your Nylas Dashboard on your local machine.

Prerequisites

If you are using Google or Microsoft accounts you’ll need to create an application before you can connect the accounts to Nylas.

If you haven’t already created a Google or Microsoft app, you can follow the steps outlined in Create a Google Application or Office 365 Set Up with Nylas.

Port Forward the API

  1. In a new terminal in your AWS folder run kubectl port-forward svc/nylas-api <local-port>:80 -n <namespace>.

Port Forward the Dashboard

  1. Run kubectl port-forward svc/nylas-dashboard <local-port>:80 -n <namespace>.

If you did not change the namespace, the default is nylas. In the example, we are forwarding to localhost port 4040.

This example we’re forwarding to the localhost port 4040

  1. Access the dashboard using your localhost port. In this example, the address is http://localhost:4040/sign-in.
  2. At the login screen, select Register. Since this is a local instance of Nylas, any accounts created at https://nylas.com will not be registered here. You will need to create a new account.
    Log into Nylas Dashboard

You must forward the API and the Dashboard before you can register as a new user.

Port Forwarding

You must forward the API and the Dashboard before you can register as a new user.

  1. Click Create New App.
    Create new app
  2. If you haven’t already created a Google or Microsoft app, you can follow the steps outlined in Create a Google Application or Office 365 Set Up with Nylas.
  3. If you have already created an application, click App Settings and either update Google OAuth with your Google OAuth Client ID or update Office 365 OAuth with your Office365 OAuth Client ID.

Nylas dashboard Google Auth

  1. After setting your OAuth tokens, click Accounts, then Auth Account. Go through the provider flow to add an account to your Nylas application.

Make Your First API Request

  1. Using the localhost created in Port Forward the API, make an API request. In this example we are returning account data.

For example: http://localhost:444/account

Congratulations!

You’ve set up Nylas locally, registered a new account, and make your first API request.

Troubleshooting

Terraform Out of Date

  • Run terraform init to get the latest version.

> terraform init
Initializing modules...
Downloading terraform-aws-modules/eks/aws 13.0.0 for eks...
- eks in .terraform/modules/eks
- eks.node_groups in .terraform/modules/eks/modules/node_groups

Error: Unsupported Terraform Core version

on .terraform/modules/eks/versions.tf line 2, in terraform:
2: required_version = ">= 0.12.9, != 0.13.0"

Module module.eks (from terraform-aws-modules/eks/aws) does not support
Terraform version 0.13.0. To proceed, either choose another supported
Terraform version or update this version constraint. Version constraints are
normally set for good reason, so updating the constraint may lead to other
errors or unexpected behavior.

Debugging in Kubernetes

What’s Next?