AWS
In this walk-through, you’re going to automate the deployment of an example application on the AWS cloud using Argonaut. It is aimed at first-time users of Argonaut.
The walk-through assumes that you have and can log into:
Let's begin.
1. Create an account
If it’s your first time using Argonaut, you’ll need to sign up for an account. Alternatively, if you already have one, log into your account.
2. Create an organization
Each Argonaut account needs to be associated with one Argonaut organization. To create an organization:
- Click on the
Settings
icon on your top right. - Click on Cloud Connect.
- Under
Organization Details
, type in a name in theOrganization Name
field. - Click on the
Set
button. - You should see an
Org is set successfully
message.
3. Connect your AWS account
On the same Cloud Connect
page:
- Scroll to the
Connect Your Cloud
section. - Scroll to the
AWS
section. - Click on
Authorize with IAM
. - Log into your AWS account, if you aren’t already logged in.
- You’ll be redirected to the AWS CloudFormation's
Create stack
page. - Note that the
Create stack
page is already populated with Argonaut-specific parameters. - Click on the
Create stack
button. - You should now see the new stack’s page on AWS CloudFormation dashboard.
- Navigate back to
Connections
page from yourSettings
. - Scroll to
Connect Your Cloud
—>AWS
. - Click
Refresh
. - You should see your newly connect AWS account ID.
- Against the AWS account ID, verify that the connection shows as
Successful
.
4. Connect your GitHub account
With your AWS account successfully connected, you finally need to connect Argonaut to your GitHub repository.
- Click on the
Settings
icon ⚙ on the top right of the top nav. - Click
Version Control
on the left pane. - Scroll to
GitHub
. - Click
+
. - Click on the GitHub account you’d like to connect with Argonaut. You’ll host your sample application on this account.
- Click on
Install
to installArgonautBot
on your chosen GitHub account. - Enter your password, and click on
Confirm Password
. - On successfully connecting your GitHub account, you’ll be redirected to the
Version Control
page that shows your GitHub account.
5. Create an environment on AWS
- Click on
Infrastructure
in the top nav bar. - Click on
Environments +
. - Choose
Amazon Web Services
. - Give your environment a name.
- Choose your environment’s region. An environment's region can't be changed later.
- Click on
Create Environment
.
To check if the environment creation was successful, navigate to the Infrastructure page from the top nav bar pane, and look for your environment's name in the list.
6. Create your EKS cluster
To deploy your application on K8s, you need to first create a K8s cluster:
Skip this step if you are choosing Lambda as your runtime.
- Navigate to
Infrastructure
→ Select your Active AWS Environment →New Resource +
. - Click on
EKS
. - Input the following values:
- Cluster Name as
dev
. - Visibility
spot
. - Instance Type
t3.medium
. - Desired Node Count as
3
. - Set Nodes:
Min
as3
andMax
as5
. - Set
Disk Size
as50
.
- Cluster Name as
- Click on
Create EKS
.
7. Set up automatic deployment on an example application
- Fork the Examples repository into your GitHub account - the same account that you’ve connected to in Argonaut. The rest of the steps assume that the name of the forked repository is also
Examples
. - On your Argonaut dashboard, click on
Applications
on your left pane. - Click the button
Deploy
on the top right. - Select
Git Source
in theDeployment Setup
step. - This takes you to the
Deployment Details
step.- Choose your GitHub account from the dropdown.
- Choose the
Examples
repository. - Choose the
node-test
branch. - Click
Next
.
- You will be taken to the
New Deployment
screen. Check if the environment is the desired environment and region. - Choose between
Kubernetes
andLambda
runtimes.- Select the
Kubernetes
runtime- Choose your target cluster as
dev
- In
Service
, fillawsquickstart
. - In
Path
, fill./Dockerfile
. - Ensure,
Service Type
is chosen asStateless
. - Under
Network Services
, clickAdd Service
.- Fill in your
Hostname
. - Fill in the port on which you want the application to run in
Container Port
.
- Fill in your
- Ensure that
Resource Requests & Limits
have values set by default. - Click
Deploy
.
- Choose your target cluster as
- Select the
Lambda
runtime.- Select your
test
environment from the dropdown. - Fill your App Name as
nodejsexample
. - Choose the
Build Method
asnode:latest
. - Fill the port as
3000
. - Fill the
Build Context
asnode-express
. - Fill the
Install Dependencies Command
asnpm i
. - Fill the
Run Command
asnpm start
. - Click
Deploy
.
- Select your
- Select the
- After clicking
Deploy
, you’ll be taken to the deploymentLogs
. Your application is now being deployed. - To check if the deployment was complete, look for the
Outputs
section in your logs. - Your left column should look like the above with
Key
,Description
,Value
, etc. listed. - Now, go to the
Applications
page and look for your applicationnodejsexample
. - Scroll right, and click the
PREVIEW URL
againstnodejsexample
. This is the URL where yournodejsexample
application is being hosted. - You should see
PING_PONG
displayed on your screen.
You’ve successfully deployed your example application using Argonaut! Let’s test whether your application now automatically gets deployed when you push a code change.
8. Test automatic deployment of your application
You’re now ready to test if your app gets deployed automatically whenever any code change is pushed to it. Let’s make a code change, and view the app again.
- Git clone your forked
Examples
repository on your local machine. - Go to its
node-express
folder. - Open the
index.js
file. - Change the string
PING_PONG
inindex.js
toTEST_AUTO_DEPLOY
. - Push this change to your
node-test
branch. - Check your application’s deployments on Argonaut dashboard:
Applications
→nodejsexample
→Deployments
- You’ll see a deployment against your commit ID.
- Once the deployment is complete, navigate to your PREVIEW URL again.
- You’ll see
TEST_AUTO_DEPLOY
on your screen.
That’s it!
You just used Argonaut to successfully set up the automatic deployment of an example application on every code push. You can now connect your own app with Argonaut to automate its deployment.