Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ on:
push:
branches:
- main
paths:
- 'terraform/**'
- 'lambda/**'
pull_request:
paths:
- 'terraform/**'
- 'lambda/**'

jobs:
terraform:
Expand Down
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
# Terraform
.terraform/
*.tfstate
*.tfstate.*
*.tfvars
tfplan
*.tfplan

# Python
*.pyc
*.pyo
*.pyd
__pycache__/
*.py[cod]
*$py.class
.Python
.venv/
venv/
ENV/
env/
*.egg-info/
.pytest_cache/
.mypy_cache/
.coverage
.coverage.*
htmlcov/

# Build artifacts
*.zip

# Local environment
.envrc

# OS
.DS_Store
9 changes: 4 additions & 5 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ This file lists how the Operation Code Infrastructure project is maintained. Whe
Check out [how Operation Code Open Source projects are maintained](https://github.com/OperationCode/START_HERE/blob/61cebc02875ef448679e1130d3a68ef2f855d6c4/open_source_maintenance_policy.md) for details on the process, how to become a maintainer, lieutenant, or the project lead.

# Project Lead
* [Irving Popovetsky](https://github.com/irvingpop)

* [Matthew Walter](https://github.com/ohaiwalt)

# Sergeant
# Past Maintainers

* [Matthew Walter](https://github.com/ohaiwalt)
* [Nell Shamrell-Harrington](http://www.github.com/nellshamrell)

# Maintainers

* [David Marchante](http://www.github.com/cdmarchante)

46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
# Operation Code Infra
Platform infrastructure for the [Operation Code site](https://operationcode.org/).
# Operation Code Infrastructure

[![CircleCI](https://circleci.com/gh/OperationCode/operationcode_infra/tree/master.svg?style=svg)](https://circleci.com/gh/OperationCode/operationcode_infra/tree/master)
Terraform-managed AWS infrastructure for [Operation Code](https://operationcode.org/).

## warning
## Overview

This repository is using [ArgoCD](https://argoproj.github.io/argo-cd/) to deploy the Operation Code infrastructure. Changes landed on main in this repository are reflected in the real running infrastructure.
ECS cluster running containerized services on EC2 spot instances, fronted by an Application Load Balancer.

To set up your workstation to access our Kubernetes cluster, please check the below instructions
### Active Services
- **Python Backend** (prod/staging) - `backend.operationcode.org`, `api.operationcode.org`
- **Pybot** (prod) - Slack integration bot at `pybot.operationcode.org`

## Setup
### Stack
- **Region:** us-east-2
- **Compute:** ECS with Fargate + spot instances
- **Routing:** ALB with host-based routing
- **Logs:** CloudWatch (7-day retention)
- **State:** S3 backend

### Operation Code's Kubernetes Cluster.
Greetings! Much of Operation Code's web site runs in a [Kubernetes](https://kubernetes.io/) cluster. These instructions will guide you through setting up access to our cluster so you can run rails console, tail logs, and more!
## Structure
```
terraform/
├── ecs.tf # ECS cluster config
├── apps.tf # Service definitions
├── alb.tf # Load balancer
├── asg.tf # Auto-scaling groups
├── python_backend/ # Backend service module
└── pybot/ # Pybot service module
```

### Getting access to the cluster
1. Ensure you have [AWS](https://aws.amazon.com) access, and the [aws CLI](https://aws.amazon.com/cli/) is operating correctly
2. Install eksctl: https://eksctl.io/introduction/#installation
3. Run: `eksctl utils write-kubeconfig --region us-east-2 --cluster operationcode-backend`
4. Ensure `kubectl` is working by running `kubectl version`, refer to [Kubectl Install Docs](https://kubernetes.io/docs/tasks/tools/#kubectl)
## License
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Note: if there are issues refer to this [SO Post](https://stackoverflow.com/questions/55360666/kubernetes-kubectl-run-command-not-found)

5. Verify everything works: `kubectl get namespaces`


## Licensing
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Operation Code Infra is under the [MIT License](/LICENSE).
10 changes: 0 additions & 10 deletions SETUP.md

This file was deleted.

8 changes: 0 additions & 8 deletions kubernetes/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions kubernetes/argocd/README.md

This file was deleted.

Loading