Skip to content

Commit

Permalink
Publish to stable
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 27, 2024
2 parents 9044448 + d1575bc commit 2abe92a
Show file tree
Hide file tree
Showing 661 changed files with 2,474 additions and 4,687 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/module-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
glob:
type: string
default: "-"
outputs:
durations-artifact:
description: "The artifact ID of the test durations file"
value: ${{ jobs.run-tests.outputs.durations-artifact }}

permissions:
id-token: write
Expand All @@ -19,6 +23,8 @@ jobs:
if: github.repository == 'aws-samples/eks-workshop-v2'
name: run-tests
runs-on: ubuntu-latest
outputs:
durations-artifact: ${{ steps.upload-durations.outputs.artifact-id }}
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down Expand Up @@ -67,13 +73,21 @@ jobs:
env:
DOCKER_BUILDKIT: 1
DEV_MODE: 1
GENERATE_TIMINGS: 1
TEST_REPORT: /tmp/test-output.json
MODULE: ${{ inputs.module }}
GLOB: ${{ inputs.glob }}
AWS_REGION: "${{ secrets.AWS_REGION }}"
ASSUME_ROLE: "${{ secrets.AWS_ROLE_ARN }}"
DOCKER_DNS_OVERRIDE: "8.8.8.8"
run: |
export AWS_DEFAULT_REGION="$AWS_REGION"
make test environment="$CLUSTER_ID" module="$MODULE" glob="$GLOB"
- uses: actions/upload-artifact@v4
id: upload-durations
with:
name: test-durations-${{ env.CLUSTER_ID }}
path: website/test-durations.json
- name: Refresh AWS credentials
if: always()
uses: aws-actions/[email protected]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- name: Run website build
working-directory: website
run: |
export LAB_TIMES_ENABLED='true'
npm install
npm run build
Expand All @@ -53,7 +54,7 @@ jobs:
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Setup terraform-docs
uses: jaxxstorm/action-install-gh-release@v1.11.0
uses: jaxxstorm/action-install-gh-release@v1.12.0
with:
repo: terraform-docs/terraform-docs
- uses: pre-commit/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-content.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Publish Content

on:
workflow_call: {}
push:
branches:
- stable
workflow_dispatch: {}

permissions:
Expand All @@ -15,8 +17,6 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: stable
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/publish-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Publish Snapshot

on:
workflow_call: {}
workflow_dispatch:
inputs:
snapshot:
description: "The snapshot to publish"
required: true
type: string
push:
branches:
- "snapshot-*"
workflow_dispatch: {}

permissions:
id-token: write
Expand All @@ -20,8 +17,6 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: snapshot-${{ inputs.snapshot }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -42,10 +37,14 @@ jobs:
role-duration-seconds: 900
aws-region: ${{ secrets.AWS_REGION }}
role-session-name: GithubActionsSession-publish
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Run publish
env:
SNAPSHOT_BUCKET: "${{ secrets.SNAPSHOT_BUCKET }}"
SNAPSHOT_CLOUDFRONT: "${{ secrets.SNAPSHOT_CLOUDFRONT }}"
BRANCH: snapshot-${{ inputs.snapshot }}
BRANCH: ${{ steps.extract_branch.outputs.branch }}
run: |
bash hack/publish-snapshot.sh
3 changes: 2 additions & 1 deletion .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ weaveworks
nirmal
mehta
sheetal
joshi
joshi
keda
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# Amazon Elastic Kubernetes Service Workshop
<div align="center">
<a href="https://eksworkshop.com" target="_blank" rel="noopener noreferrer">
<picture>
<img width="160" src="docs/images/eks.png" alt="Amazon Elastic Kubernetes Service logo">
</picture>
</a>

<br/>

<div align="center">

[![Stars](https://img.shields.io/github/stars/aws-samples/eks-workshop-v2)](LICENSE)
[![License](https://img.shields.io/github/license/aws-samples/eks-workshop-v2)](LICENSE)

</div>

<strong>
<h2>Amazon Elastic Kubernetes Service Workshop</h2>
</strong>
</div>

Welcome to the repository for the [Amazon Elastic Kubernetes Services workshop](https://eksworkshop.com). This contains the source for the website content as well as the accompanying infrastructure-as-code to set up a workshop lab environment in your AWS account. Please review the [Introduction](https://www.eksworkshop.com/docs/introduction/) chapter of the workshop for more details.

Expand Down
4 changes: 2 additions & 2 deletions cluster/eksctl/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ availabilityZones:
metadata:
name: ${EKS_CLUSTER_NAME}
region: ${AWS_REGION}
version: "1.29"
version: "1.30"
tags:
karpenter.sh/discovery: ${EKS_CLUSTER_NAME}
created-by: eks-workshop-v2
Expand All @@ -31,7 +31,7 @@ managedNodeGroups:
maxSize: 6
instanceType: m5.large
privateNetworking: true
releaseVersion: "1.29.0-20240129"
releaseVersion: "1.30.0-20240625"
updateConfig:
maxUnavailablePercentage: 50
labels:
Expand Down
4 changes: 2 additions & 2 deletions cluster/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ variable "cluster_name" {
variable "cluster_version" {
description = "EKS cluster version."
type = string
default = "1.29"
default = "1.30"
}

variable "ami_release_version" {
description = "Default EKS AMI release version for node groups"
type = string
default = "1.29.0-20240129"
default = "1.30.0-20240625"
}

variable "vpc_cidr" {
Expand Down
3 changes: 3 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ patterns:
pattern: "/`(.*)`/g"
- name: browser_block
pattern: "/<Browser.*>[\\s\\S]*?^\\s*<\\/Browser>/gm"
- name: yaml_block
pattern: "/::yaml.*/g"
languageSettings:
- languageId: markdown
ignoreRegExpList:
- markdown_code_block
- markdown_code_snippet
- browser_block
- yaml_block
dictionaries:
- custom-words
dictionaryDefinitions:
Expand Down
1 change: 1 addition & 0 deletions docs/eks_version_upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ There are various places that reference the Kubernetes versions (Kubernetes, kub
1. eksctl: `cluster/eksctl/cluster.yaml`
1. Terraform: `cluster/terraform/variables.tf`
1. Common kubectl: `hack/lib/kubectl-version.sh`
1. Renovatebot version constraints: `renovate.json`
Binary file added docs/images/console-button.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/eks.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/yaml-annotations.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/yaml-plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reviewer_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ See style guide for expanded explanations.

- [ ] Generated lab timing has been created (new lab) or updated (updated lab) if needed
- [ ] All Terraform resources created have dynamic names
- [ ] Images should be in `webp` format
92 changes: 58 additions & 34 deletions docs/style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,64 @@

This document provides a style guide that should be used when creating or modifying content for the workshop in order to maintain a consistent experience throughout the content.

## General content

### Use admonitions

Use appropriate [Docusaurus admonitions](https://docusaurus.io/docs/markdown-features/admonitions) to call out relevant information.

```markdown
:::info
Use info blocks for additional information
:::

:::caution
Caution blocks also available
:::

:::note
Note blocks are available
:::
```

### Badges

To mark your module as an independent module that users can begin with, place the following in the header of your markdown file:

```
---
...
sidebar_custom_props: {"module": true}
---
```

To mark your module as informational, with no actionable steps, place the following in the header of your markdown file:

```
---
...
sidebar_custom_props: {"info": true}
---
```

### Navigating the AWS console

There are instances where the user needs to navigate to specific screens in the AWS console. It is preferable to provide a link to the exact screen if possible, or a close as can be done.

For example to link to the EKS console you can use a link like this:

```
https://console.aws.amazon.com/eks/home#/clusters
```

> Note that this has had the region information removed, the link as shown in the browser would be: `https://us-west-2.console.aws.amazon.com/eks/home?region=us-west-2#/clusters`. The region must be removed to allow the content to be portable.
These links should be displayed to the user with the [Console button component](./ui_components.md) for consistency.

### Screenshots

Use of screenshots should be limited to only wherever necessary. Where possible command-line output should be used as it is more maintainable and testable. When screenshots are necessary only the relevant section of the screen should be included as it reduces image size and makes the images more legible, especially for users with limited screen resolution. Screenshots should be cropped to display only the necessary details.

## Scripts/Commands

This section provides guidelines related to the commands and scripts learners are instructed to use during the workshop content.
Expand Down Expand Up @@ -177,37 +235,3 @@ An example of using this would look like so:
```
$ aws eks describe-cluster --name $EKS_CLUSTER_NAME
```

### Info and Caution Blocks

:::Info
Use info blocks for additional information
:::

:::Caution
Caution blocks also available
:::

:::Note
Note blocks are available
:::

### Badges

To mark your module as an independent module that users can begin with, place the following in the header of your markdown file:

```
---
...
sidebar_custom_props: {"module": true}
---
```

To mark your module as informational, with no actionable steps, place the following in the header of your markdown file:

```
---
...
sidebar_custom_props: {"info": true}
---
```
73 changes: 73 additions & 0 deletions docs/ui_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,79 @@ this is output
```
````

Multiple commands can be displayed in the same terminal window:

````
```bash
$ first command
output of the first command
$ second command
output of the second command
```
````

## YAML file

![Plain YAML file](images/yaml-plain.png)

Working with Kubernetes involves a lot of YAML and this can be challenging to explain to a participant, especially for larger blocks of YAML. The YAML file component is intended to provide a mechanism to make this easier for content authors both in terms of breaking down complex YAML as well as for maintainability.

The above screenshot would be accomplish with something like this:

```bash
::yaml{file="manifests/modules/autoscaling/compute/karpenter/nodepool/nodepool.yaml" paths="spec.disruption"}
```

This consists of two parts:

1. The `file` attribute is file path to an existing YAML file somewhere in the project
2. The `paths` attribute a YAML path within the file to lookup one or more parts of the file, it can be comma-separated

The paths attribute can display individual fields, sections or items in an array, see these examples related to the above YAML:

1. `paths="spec.disruption.consolidationPolicy"` would only highlight the `consolidationPolicy` field instead of the entire `disruption` block
2. `paths="spec.template.spec.requirements[0]"` would highlight the first element of the requirements array
3. `paths="spec.template.spec.requirements[0].values"` would highlight the `values` field of the first element of the requirements array

Using the `paths` attribute has several advantanges over the typical Docusaurus highlighting:

1. Using hard-coded line numbers can become out-of-sync with the content of a file if it is changed
2. Using comments in the YAML file pollutes the file itself, and makes it harder for the participant to inspect the file on their own

You can optionally provide "annotations" for the respective `paths` to provide call-outs to explain each path that is highlights:

![Annotated YAML file](images/yaml-annotations.png)

This is done by adding an ordered markdown list immediately after the `::yaml` directive:

```
::yaml{file="manifests/modules/autoscaling/compute/karpenter/nodepool/nodepool.yaml" paths="spec.template.metadata.labels,spec.template.spec.requirements, spec.limits"}
1. We're asking the `NodePool` to start all new nodes with a Kubernetes label `type: karpenter`, which will allow us to specifically target Karpenter nodes with pods for demonstration purposes
2. The [NodePool CRD](https://karpenter.sh/docs/concepts/nodepools/) supports defining node properties like instance type and zone. In this example, we're setting the `karpenter.sh/capacity-type` to initially limit Karpenter to provisioning On-Demand instances, as well as `node.kubernetes.io/instance-type` to limit to a subset of specific instance types. You can learn which other properties are [available here](https://karpenter.sh/docs/concepts/scheduling/#selecting-nodes). We'll work on a few more during the workshop.
3. A `NodePool` can define a limit on the amount of CPU and memory managed by it. Once this limit is reached Karpenter will not provision additional capacity associated with that particular `NodePool`, providing a cap on the total compute.
```

If using annotations then all paths should have a corresponding list entry, and the code lines will always be annotated in the order of the paths as listed in the attribute.

## Console button

![Console button](images/console-button.png)

The console button component is designed to provide a consistent way to link to the AWS console.

The component is used like so:

```jsx
<ConsoleButton
url="https://console.aws.amazon.com/cloudwatch/home#dashboards"
service="cloudwatch"
label="Open CloudWatch console"
/>
```

The `service` parameter dictates the icon that is shown, and the corresponding image must exist in `website/static/img/services`.

## Browser Window

![Browser Window](images/browser-window.png)
Expand Down
Loading

0 comments on commit 2abe92a

Please sign in to comment.