Skip to content

Commit

Permalink
Adding github pages doc using mkdocs (#194)
Browse files Browse the repository at this point in the history
* adding github pages doc

* fixing broken urls and eks version

* fixing relative path links

* fixing relative path links

* fixing getting started initial doc
  • Loading branch information
edgarsilva948 authored May 31, 2024
1 parent de9662d commit 042adab
Show file tree
Hide file tree
Showing 19 changed files with 375 additions and 22 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/linkcheck.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"timeout": "5s",
"retryOn429": true,
"retryCount": 5,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [200, 206],
"httpHeaders": [
{
"urls": ["https://help.github.com/"],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
"ignorePatterns": [
{
"pattern": [
"localhost"
]
},
{
"pattern": [
"127.0.0.1"
]
}
]
}
37 changes: 37 additions & 0 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check Markdown links

on:
push:
branches:
- main
paths:
- "**/*.md"

pull_request:
branches:
- main
paths:
- "**/*.md"

permissions:
contents: read

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: install markdown-link-check
run: npm install -g markdown-link-check@3.10.2
- name: markdown-link-check version
run: npm list -g markdown-link-check
- name: Run markdown-link-check on MD files
run: find docs -name "*.md" | xargs -n 1 markdown-link-check -q -c .github/workflows/linkcheck.json
47 changes: 47 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- main

env:
PYTHON_VERSION: 3.x

permissions:
contents: read

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout main
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
fetch-depth: 0

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install mkdocs-material==9.5.21 \
mkdocs-include-markdown-plugin==6.0.6 \
mkdocs-awesome-pages-plugin==2.9.2
- name: git config
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- run: mkdocs gh-deploy --force
76 changes: 76 additions & 0 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '20 7 * * 2'
push:
branches: ["main"]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
contents: read
actions: read

steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
with:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.5.4
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecards on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
with:
sarif_file: results.sarif
15 changes: 9 additions & 6 deletions bootstrap/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ module "eks_blueprints_addons" {
enable_argocd = true
argocd = {
namespace = "argocd"
chart_version = "6.11.1" # ArgoCD v2.11.2
chart_version = "7.1.0" # ArgoCD v2.11.2
wait = true
wait_for_jobs = true
timeout = "600"
values = [
templatefile("${path.module}/values/argocd.yaml", {
Expand All @@ -160,18 +161,20 @@ module "eks_blueprints_addons" {
}
enable_gatekeeper = true
gatekeeper = {
timeout = "600"
wait = true
wait = true
wait_for_jobs = true
timeout = "600"
}

enable_metrics_server = true
enable_aws_load_balancer_controller = true

enable_kube_prometheus_stack = true
kube_prometheus_stack = {
wait = true
timeout = "600"
values = [file("${path.module}/values/prometheus.yaml")]
wait = true
wait_for_jobs = true
timeout = "600"
values = [file("${path.module}/values/prometheus.yaml")]
}

depends_on = [module.eks.eks_managed_node_groups]
Expand Down
14 changes: 7 additions & 7 deletions bootstrap/terraform/values/argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ controller:
annotations:
prometheus.io/scrape: true
env:
- name: ARGOCD_K8S_CLIENT_QPS #required for Crossplane too many CRDs https://github.com/argoproj/argo-cd/pull/448
value: "300"
- name: ARGOCD_K8S_CLIENT_QPS #required for Crossplane too many CRDs https://github.com/argoproj/argo-cd/pull/448
value: "300"

repoServer:
autoscaling:
enabled: true
minReplicas: 1
resources: # Adjust based on your specific use case (required for HPA)
requests:
cpu : "100m"
memory : "256Mi"
cpu: "100m"
memory: "256Mi"
limits:
cpu: "200m"
memory: "512Mi"
Expand All @@ -46,8 +46,8 @@ server:
minReplicas: 1
resources: # Adjust based on your specific use case (required for HPA)
requests:
cpu : "100m"
memory : "256Mi"
cpu: "100m"
memory: "256Mi"
limits:
cpu: "200m"
memory: "512Mi"
Expand All @@ -58,7 +58,7 @@ server:
prometheus.io/scrape: true
service:
type: "LoadBalancer"
annotations:
annotations:
service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"

configs:
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ variable "name" {
variable "cluster_version" {
type = string
description = "Kubernetes Version"
default = "1.30"
default = "1.29"
}

variable "capacity_type" {
Expand Down
5 changes: 5 additions & 0 deletions docs/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nav:
- Overview: index.md
- Getting Started: getting-started.md
- Patterns: patterns
- FAQ: faq.md
18 changes: 18 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Frequently Asked Questions

## Timeouts on destroy

Customers who are deleting their environments using `terraform destroy` may see timeout errors when VPCs are being deleted. This is due to a known issue in the [vpc-cni](https://github.com/aws/amazon-vpc-cni-k8s/issues/1223#issue-704536542)

Customers may face a situation where ENIs that were attached to EKS managed nodes (same may apply to self-managed nodes) are not being deleted by the VPC CNI as expected which leads to IaC tool failures, such as:

* ENIs are left on subnets
* EKS managed security group which is attached to the ENI can’t be deleted by EKS

The current recommendation is to execute cleanup in the following order:

1. delete all pods that have been created in the cluster.
2. add delay/ wait
3. delete VPC CNI
4. delete nodes
5. delete cluster
70 changes: 70 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started

This getting started guide will help you bootstrap your first cluster using Crossplane Blueprints.

## Prerequisites

Ensure that you have installed the following tools locally:

- [awscli](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html)
- [kubectl](https://Kubernetes.io/docs/tasks/tools/)
- [terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli)

## Deploy

### eksctl

1. TBD

### terraform

1. For consuming Crossplane Blueprints, please see the [Getting Started](https://awslabs.github.io/crossplane-on-eks/#getting-started) section. For exploring and trying out the patterns provided, please
clone the project locally to quickly get up and running with a pattern. After cloning the project locally, `cd` into the pattern
directory of your choice.

2. To provision the pattern, the typical steps of execution are as follows:

```sh
terraform init
terraform apply -target="module.vpc" -auto-approve
terraform apply -target="module.eks" -auto-approve
terraform apply -target="module.eks_blueprints_addons" -auto-approve
terraform apply -target="module.crossplane" -auto-approve
terraform apply -auto-approve
```

3. Once all of the resources have successfully been provisioned, the following command can be used to update the `kubeconfig`
on your local machine and allow you to interact with your EKS Cluster using `kubectl`.

```sh
aws eks --region <REGION> update-kubeconfig --name <CLUSTER_NAME> --alias <CLUSTER_NAME>
```

!!! info "Terraform outputs"
The examples will output the `aws eks update-kubeconfig ...` command as part of the Terraform apply output to simplify this process for users

4. Once you have updated your `kubeconfig`, you can verify that you are able to interact with your cluster by running the following command:

```sh
kubectl get nodes
```

This should return a list of the node(s) running in the cluster created. If any errors are encountered, please re-trace the steps above
and consult the pattern's `README.md` for more details on any additional/specific steps that may be required.
## Destroy
To teardown and remove the resources created in the bootstrap, the typical steps of execution are as follows:
```sh
terraform destroy -target="module.crossplane" -auto-approve
terraform destroy -target="module.eks_blueprints_addons" -auto-approve
terraform destroy -target="module.eks" -auto-approve
terraform destroy -target="module.vpc" -auto-approve
terraform destroy -auto-approve
```
!!! danger "Resources created outside of Terraform"
Some resources may have been created that Terraform is not aware of that will cause issues
when attempting to clean up the pattern. Please see the `destroy.md` for more
details.
Binary file added docs/images/colored-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/white-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%
include-markdown "../README.md"
%}
Loading

0 comments on commit 042adab

Please sign in to comment.