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
72 changes: 4 additions & 68 deletions docs/aws-eks.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# AWS EKS Cluster Walkthrough

This walkthrough uses `eksctl` and assumes you already have an AWS account, have the [eksctl prerequisites installed](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html) including `eksctl` and `helm`.
After creating the cluster we'll walk through installing the following add-ons and controllers:
This is a verbose walkthrough. It uses `eksctl` and assumes you already have an AWS account, have the [eksctl prerequisites installed](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html) including `eksctl` and `helm`.

If you are familiar with Terraform would like an IaC choice that is more terse consider setting up your cluster with that: https://github.com/developmentseed/eoapi-k8s-terraform

* `aws-ebs-csi-driver`
* `aws-load-balancer-controller`
* `nginx-ingress-controller`

## Table of Contents:
1. [Create EKS Cluster](#create-cluster)
2. [Make sure EKS Cluster has OIDC Provider](#check-oidc)
3. [Install Node Autoscaling](#node-autoscaler)
4. [Install EBS CSI Add-on](#ebs-addon)
5. [Install AWS LB Controller](#aws-lb)
4. [Install NGINX Ingress Controller](#nginx-ingress)
5. [Install NGINX Ingress Controller](#nginx-ingress)

---

Expand Down Expand Up @@ -161,67 +158,6 @@ a sample application to make sure it dynamically mounts an EBS volume

---

### Install AWS load balancer controller <a name="aws-lb"></a>

Best to walk through the [AWS userguide](https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html) and [docs](https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html) but
examples are provided below.

First, we create the policy, IAM role and the k8s `ServiceAccount`

```sh
export AWS_ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"

# download the policy aws-load-balancer policy
curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.7/docs/install/iam_policy.json

# create the policy
aws iam create-policy \
--policy-name AWSLoadBalancerControllerIAMPolicy \
--policy-document file://iam_policy.json

# Create the IAM Role, the ServiceAccount and bind them
# Arbitrary, the naming is up to you
# ARN from last step

eksctl create iamserviceaccount \
--region us-west-2 \
--cluster=sandbox \
--namespace=kube-system \
--name=aws-load-balancer-controller \
--role-name AmazonEKSLoadBalancerControllerRole \
--attach-policy-arn=arn:aws:iam::${AWS_ACCOUNT_ID}:policy/AWSLoadBalancerControllerIAMPolicy \
--approve

# assert it was created and has an annotation
kubectl get sa aws-load-balancer-controller -n kube-system

# NAME SECRETS AGE
# aws-load-balancer-controller 0 13s

# kubectl describe sa aws-load-balancer-controller -n kube-system | grep Annotations
# Annotations: eks.amazonaws.com/role-arn: arn:aws:iam::<AWS_ACCOUNT_ID>:role/AmazonEKSLoadBalancerControllerRole
```

Then install the K8s AWS Controller:

```sh
helm repo add eks https://aws.github.io/eks-charts
helm repo update
helm install aws-load-balancer-controller \
eks/aws-load-balancer-controller \
-n kube-system \
--set clusterName=sandbox \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller
# since the last steps already did this, set to false
```

```sh
kubectl get deployment -n kube-system aws-load-balancer-controller
# NAME READY UP-TO-DATE AVAILABLE AGE
# aws-load-balancer-controller 2/2 2 2 36d
```

## Install Nginx Ingress Controller <a name="nginx-ingress"></a>

Please look through the [Nginx Docs](https://github.com/kubernetes/ingress-nginx) to verify nothing has changed below. There are multiple ways to provision and configure. Below is the simplest we found:
Expand Down
4 changes: 3 additions & 1 deletion docs/gcp-gke.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# GCP GKE Cluster Setup

This walk-through uses `gcloud` and assumes you already have an GCP account and project where you want to run eoapi. We also assume that you have some prerequisites installed including `gcloud`, `kubectl` and `helm`.
This is a verbose walkthrough. It uses `gcloud` and assumes you already have an GCP account and project where you want to run eoapi. We also assume that you have some prerequisites installed including `gcloud`, `kubectl` and `helm`.

If you are familiar with Terraform would like an IaC choice that is more terse consider setting up your cluster with that: https://github.com/developmentseed/eoapi-k8s-terraform

# Table of Contents
- [Pre-requisites](#pre-requisites)
Expand Down
6 changes: 3 additions & 3 deletions helm-chart/eoapi-support/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ dependencies:
#
- name: prometheus
# NOTE: configuration for this dependency is handled in `eoapi-support/values.yaml.prometheus` values
version: 24.5.0
version: 25.3.1
repository: https://prometheus-community.github.io/helm-charts

# used to create custom metrics to autoscale on
#
- name: prometheus-adapter
# NOTE: configuration for this dependency is handled in `eoapi-support/values.yaml.prometheus-adapter` values
version: 4.6.0
version: 4.7.1
repository: https://prometheus-community.github.io/helm-charts

# Grafana for dashboarding of metrics
# https://github.com/grafana/helm-charts/tree/main/charts/grafana
#
- name: grafana
# NOTE: configuration for this dependency is handled in `eoapi-support/values.yaml.grafana` values
version: 6.60.1
version: 7.3.3
repository: https://grafana.github.io/helm-charts
2 changes: 1 addition & 1 deletion helm-chart/eoapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ service:
port: 8080

ingress:
# `"nginx"` will create a `kind:Service` with a `spec.port:ClusterIP` and a single (A||N)LB and path rewrites for /vector, /stac, /raster
# `"nginx"` will create a `kind:Service` with a `spec.port:ClusterIP` and a single Load Balancer and path rewrites for /vector, /stac, /raster
enabled: true
className: "nginx"
host: ""
Expand Down
2 changes: 1 addition & 1 deletion iac/aws/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TODO: TF/CDK/EKS related IaC goes here
please refer to https://github.com/developmentseed/eoapi-k8s-terraform
2 changes: 1 addition & 1 deletion iac/gcp/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TODO: TF/CDK/GKE related IaC goes here
please refer to https://github.com/developmentseed/eoapi-k8s-terraform