Skip to content

Commit

Permalink
docs: add new docs scaffolding to wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAnderegg committed Oct 3, 2023
1 parent 91b7b37 commit 74923e4
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 34 deletions.
42 changes: 29 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,49 @@

![aws-eks-ec2](https://user-images.githubusercontent.com/24816990/174409888-488bb9b1-a200-4afd-aeb3-320680f49274.svg)
![aws-eks-ec2](https://raw.githubusercontent.com/wiki/workflows-sh/aws-eks-ec2-asg-cdk/_assets/banner.svg)

# Stack: AWS-EKS-EC2-ASG-CDK via CTO.ai

This repo contains a complete, functional PaaS workflow with integrated GitOps and ChatOps features. Designed for deployment to AWS infrastructure, this workflow supports EKS on EC2, Aurora, SQS, Redis, and Autoscaling—all orchestrated by CDK.

## Prerequisites

- [A local NodeJS programming environment and Workflow CLI installed on your machine](https://cto.ai/docs/install-cli)
- [An AWS Personal Access key and Secret Key, which you can create via the AWS Console](https://cto.ai/docs/aws-ecs-fargate#create-secrets-from-settings)
- [Docker](https://docs.docker.com/get-docker/), [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html), and [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) installed on your machine.
- [NVM Installed](https://github.com/nvm-sh/nvm)

## Quick Start

To get started with this stack, you can follow the steps below to orchestrate the deployment of this stack to your AWS infrastructure, using the CTO.ai platform.

### Requirements

To use this workflow, you should already have an account on the [CTO.ai platform](https://cto.ai) and ensure all of the following tools are installed on your local machine:

- CTO.ai [`ops` CLI](https://cto.ai/docs/install-cli)
- [Docker](https://docs.docker.com/get-docker/)
- [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html)
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
- [NVM](https://github.com/nvm-sh/nvm)

You must also have an AWS Personal Access key and Secret Key, which you can create from the [AWS Console](#create-secrets-from-settings).

### Clone the repo

```bash
git clone https://github.com/workflows-sh/aws-eks-ec2-asg-cdk.git
cd aws-eks-ec2-asg-cdk
```

## Usage

You can find detailed instructions for using this workflow stack in the repo wiki.

- [AWS-EKS-EC2-ASG-CDK Workflow Stack Documentation](https://github.com/workflows-sh/aws-eks-ec2-asg-cdk/wiki)
## Documentation

<dl>
<dt>
<a href="https://github.com/workflows-sh/aws-eks-ec2-asg-cdk/wiki">AWS-EKS-EC2-ASG-CDK Stack Wiki</a>
</dt>
<dd>
The repository's wiki on GitHub has more detailed documentation for using this workflow stack.
</dd>
<dt>
<a href="https://cto.ai/docs">CTO.ai Docs</a>
</dt>
<dd>
The CTO.ai product documentation can provide you with important context to help you understand how this stack works.
</dd>
</dl>

## Support and Community

Expand Down
3 changes: 3 additions & 0 deletions docs/Generating access tokens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generating AWS and GitHub access tokens

On this page...
51 changes: 30 additions & 21 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
![aws-eks-ec2 Banner Image](_assets/banner.svg)
![aws-eks-ec2 Banner Image](https://raw.githubusercontent.com/wiki/workflows-sh/aws-eks-ec2-asg-cdk/_assets/banner.svg)

# Docs for AWS-EKS-EC2-ASG-CDK Workflow Stack
## AWS-EKS-EC2-ASG-CDK Workflow Stack Documentation

### Set Up your Account on CTO.ai
This repo contains a complete, functional PaaS workflow with integrated GitOps and ChatOps features. Designed for deployment to AWS infrastructure, this workflow supports EKS on EC2, Aurora, SQS, Redis, and Autoscaling—all orchestrated by CDK.

Before you can deploy this Workflow, you need to [Setup your account on CTO.ai](https://cto.ai/docs/setup-flow)
## Add environment variables to Secrets Store

### Create Secrets from Settings
> Resource: [Using Secrets and Configs via Dashboard](https://cto.ai/docs/secrets-and-configs-dashboard)
Secrets are encrypted environment variables that CTO.ai utilizes within your workflow to build and run your application and deployments. [Follow this guide to create secrets from settings.](https://cto.ai/docs/aws-eks-ec2#create-secret-from-settings), and also [generate your Github token](https://cto.ai/docs/aws-eks-ec2#generate-github-token)
Create new environment variables via your Secrets Store on the CTO.ai Dashboard, one for each of the following keys:

### View Auto Scaling groups
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_ACCOUNT_NUMBER`
- `GITHUB_TOKEN`

Schedule the scaling [actions that proactively increases and decreases capacity to match the load forecast](https://cto.ai/docs/aws-eks-ec2#view-auto-scaling-groups)
This wiki has more information on [generating your AWS and GitHub credentials](https://github.com/workflows-sh/aws-eks-ec2-asg-cdk/wiki/Generating-access-tokens).

Follow the following steps below to configure and deploy your AWS EC2-Elastic Kubernetes Service Workflow
## Install the repo locally

### Build and Run Pipelines
Clone the GitHub repository for this workflow stack locally, then change in to the directory:

- [Build Pipelines locally with the Workflow CLI](https://cto.ai/docs/aws-eks-ec2#build-pipelines-locally-with-the-ctoai-cli)
```bash
git clone https://github.com/workflows-sh/aws-eks-ec2-asg-cdk.git
cd aws-eks-ec2-asg-cdk
```

- [Run Pipelines locally with the Workflow CLI](https://cto.ai/docs/aws-eks-ec2#run-pipelines-locally-with-the-ctoai-cli)
## Build Pipelines locally with CTO.ai CLI

### Run and Setup your Infrastructure
Run the following CLI command to build the repo's Pipelines workflow locally:

In your AWS EKS EC2 workflow, [build and set up your infrastructure using the `ops run -b .` command. This will provision your AWS-EKS EC2 stacks using Cloud Formation](https://cto.ai/docs/aws-eks-ec2#run-and-setup-your-infrastructure)
```bash
ops build .
```

### View changes on CloudFormation
Then, when prompted, select the `sample-app-pipeline` workflow from the list. This will build the workflow locally (for use or sharing) and build the workflow's Docker image from its `Dockerfile`.

- [Get a detailed overview of your entire Stack on CloudFormation](https://cto.ai/docs/aws-eks-ec2#view-changes-on-aws-cloudformation)
The resulting Docker image will be tagged with the name and version specified in the workflow's `ops.yml` file.

### View EC2 instances on AWS
## Run Pipelines locally with CTO.ai CLI

Get insights to your EC2 instances on AWS. [View EC2 instances on AWS](https://cto.ai/docs/aws-eks-ec2#view-ec2-instances-on-aws)
Run the following CLI command to run the repo's Pipelines workflow locally:

```bash
ops run .
```

### View Elastic Kubernetes Service Cluster

See your [EKS Cluster resources, deployments, and authentication](https://cto.ai/docs/aws-eks-ec2#view-elastic-kubernetes-service-cluster)
Then, when prompted, select the `sample-app-pipeline` workflow from the list. This will run the workflow locally, using the Docker image built in the previous step.

0 comments on commit 74923e4

Please sign in to comment.