Skip to content

Commit 43d7708

Browse files
committed
fix: PR review fixes for fastpaths and auto mode cluster support
- SecondaryNav: fix dual active highlighting when Intro and Setup share a path prefix - create-infrastructure.sh: fix auto cluster condition checking 'standard' instead of 'auto' - destroy-infrastructure.sh: fix auto cluster name override that diverged from common-env.sh with environment suffix - setup.sh: fix delete-cluster functions echoing 'Creating' instead of 'Deleting' - base.tf: auto-detect auto mode cluster via ListClusters API instead of unconditional lookup that fails when cluster doesn't exist - navigating-labs.md: remove confusing prepare-environment section with placeholder vars, add 'Starting a Lab' tip, constrain oversized browser dialog images, remove duplicated Kustomize section - introduction/navigating-labs.md: constrain oversized browser dialog image - fastpaths/index.md: fix intro text to match sidebar order and correctly reference setup for both event and in-your-account flows - getting-started/first.md: fix expected namespace output to match actual state (no pre-provisioned namespaces)
1 parent ee42cde commit 43d7708

9 files changed

Lines changed: 56 additions & 56 deletions

File tree

hack/create-infrastructure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fi
2929
auto_cluster_exists=0
3030
aws eks describe-cluster --name "${EKS_CLUSTER_AUTO_NAME}" &> /dev/null || auto_cluster_exists=$?
3131

32-
if [ $auto_cluster_exists -ne 0 ] && [[ "$cluster" == "standard" || "$cluster" == "all" ]]; then
32+
if [ $auto_cluster_exists -ne 0 ] && [[ "$cluster" == "auto" || "$cluster" == "all" ]]; then
3333
echo "Creating auto mode cluster ${EKS_CLUSTER_AUTO_NAME}"
3434
bash $SCRIPT_DIR/exec.sh "${environment}" 'cat /cluster/eksctl/cluster-auto.yaml /cluster/eksctl/access-entries.yaml | envsubst | eksctl create cluster -f -'&
3535
else

hack/destroy-infrastructure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ else
2222
echo "Cluster ${EKS_CLUSTER_NAME} does not exist or skipped"
2323
fi
2424

25-
export EKS_CLUSTER_AUTO_NAME="${EKS_CLUSTER_NAME}-auto"
25+
export EKS_CLUSTER_AUTO_NAME="${EKS_CLUSTER_AUTO_NAME}"
2626
auto_cluster_exists=0
2727
aws eks describe-cluster --name "${EKS_CLUSTER_AUTO_NAME}" &> /dev/null || auto_cluster_exists=$?
2828

lab/scripts/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ function prepare-environment() {
6262
function use-cluster() { bash /usr/local/bin/use-cluster \$1; source ~/.bashrc.d/env.bash; }
6363
function create-cluster() { URL=https://raw.githubusercontent.com/\${REPOSITORY_OWNER}/\${REPOSITORY_NAME}/refs/heads/\${REPOSITORY_REF}/cluster/eksctl/cluster.yaml; echo "Creating cluster with eksctl from \$URL"; curl -fsSL \$URL | envsubst | eksctl create cluster -f -; }
6464
function create-cluster-auto() { URL=https://raw.githubusercontent.com/\${REPOSITORY_OWNER}/\${REPOSITORY_NAME}/refs/heads/\${REPOSITORY_REF}/cluster/eksctl/cluster-auto.yaml; echo "Creating cluster with eksctl from \$URL"; curl -fsSL \$URL | envsubst | eksctl create cluster -f -; }
65-
function delete-cluster() { URL=https://raw.githubusercontent.com/\${REPOSITORY_OWNER}/\${REPOSITORY_NAME}/refs/heads/\${REPOSITORY_REF}/cluster/eksctl/cluster.yaml; echo "Creating cluster with eksctl from \$URL"; curl -fsSL \$URL | envsubst | eksctl delete cluster -f -; }
66-
function delete-cluster-auto() { URL=https://raw.githubusercontent.com/\${REPOSITORY_OWNER}/\${REPOSITORY_NAME}/refs/heads/\${REPOSITORY_REF}/cluster/eksctl/cluster-auto.yaml; echo "Creating cluster with eksctl from \$URL"; curl -fsSL \$URL | envsubst | eksctl delete cluster -f -; }
65+
function delete-cluster() { URL=https://raw.githubusercontent.com/\${REPOSITORY_OWNER}/\${REPOSITORY_NAME}/refs/heads/\${REPOSITORY_REF}/cluster/eksctl/cluster.yaml; echo "Deleting cluster with eksctl from \$URL"; curl -fsSL \$URL | envsubst | eksctl delete cluster -f -; }
66+
function delete-cluster-auto() { URL=https://raw.githubusercontent.com/\${REPOSITORY_OWNER}/\${REPOSITORY_NAME}/refs/heads/\${REPOSITORY_REF}/cluster/eksctl/cluster-auto.yaml; echo "Deleting cluster with eksctl from \$URL"; curl -fsSL \$URL | envsubst | eksctl delete cluster -f -; }
6767
EOT
6868

6969
if [ ! -z "$REPOSITORY_REF" ]; then

manifests/.workshop/terraform/base.tf

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ data "aws_partition" "current" {}
5656
data "aws_caller_identity" "current" {}
5757
data "aws_region" "current" {}
5858

59+
data "aws_eks_clusters" "available" {}
60+
5961
data "aws_eks_cluster" "eks_cluster" {
6062
name = var.eks_cluster_id
6163
}
@@ -64,11 +66,17 @@ data "aws_eks_cluster_auth" "this" {
6466
name = var.eks_cluster_id
6567
}
6668

69+
locals {
70+
auto_cluster_exists = contains(data.aws_eks_clusters.available.names, var.eks_cluster_auto_id)
71+
}
72+
6773
data "aws_eks_cluster" "eks_cluster_auto" {
68-
name = var.eks_cluster_auto_id
74+
count = local.auto_cluster_exists ? 1 : 0
75+
name = var.eks_cluster_auto_id
6976
}
7077
data "aws_eks_cluster_auth" "this_auto" {
71-
name = var.eks_cluster_auto_id
78+
count = local.auto_cluster_exists ? 1 : 0
79+
name = var.eks_cluster_auto_id
7280
}
7381

7482
provider "aws" {
@@ -85,9 +93,9 @@ provider "kubernetes" {
8593

8694
provider "kubernetes" {
8795
alias = "auto_mode"
88-
host = data.aws_eks_cluster.eks_cluster_auto.endpoint
89-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster_auto.certificate_authority[0].data)
90-
token = data.aws_eks_cluster_auth.this_auto.token
96+
host = try(data.aws_eks_cluster.eks_cluster_auto[0].endpoint, "https://localhost")
97+
cluster_ca_certificate = try(base64decode(data.aws_eks_cluster.eks_cluster_auto[0].certificate_authority[0].data), "")
98+
token = try(data.aws_eks_cluster_auth.this_auto[0].token, "")
9199
}
92100

93101
provider "helm" {
@@ -101,9 +109,9 @@ provider "helm" {
101109
provider "helm" {
102110
alias = "auto_mode"
103111
kubernetes {
104-
host = data.aws_eks_cluster.eks_cluster_auto.endpoint
105-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster_auto.certificate_authority[0].data)
106-
token = data.aws_eks_cluster_auth.this_auto.token
112+
host = try(data.aws_eks_cluster.eks_cluster_auto[0].endpoint, "https://localhost")
113+
cluster_ca_certificate = try(base64decode(data.aws_eks_cluster.eks_cluster_auto[0].certificate_authority[0].data), "")
114+
token = try(data.aws_eks_cluster_auth.this_auto[0].token, "")
107115
}
108116
}
109117

website/docs/fastpaths/getting-started/first.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,18 @@ Before we do anything, let's inspect the current Namespaces in our EKS cluster:
2323

2424
```bash
2525
$ kubectl get namespaces
26-
NAME STATUS AGE
27-
amazon-cloudwatch Active 30h
28-
default Active 30h
29-
external-secrets Active 30h
30-
kube-node-lease Active 30h
31-
kube-public Active 30h
32-
kube-system Active 30h
33-
ui Active 30h
26+
NAME STATUS AGE
27+
default Active 30h
28+
kube-node-lease Active 30h
29+
kube-public Active 30h
30+
kube-system Active 30h
3431
```
3532

36-
All of the entries listed are Namespaces for system components that were pre-installed for us. We'll ignore most of these by using [Kubernetes labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to filter the Namespaces down to only those we've created:
33+
All of the entries listed are Namespaces for system components. We'll use [Kubernetes labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to filter the Namespaces down to only those we've created:
3734

3835
```bash
3936
$ kubectl get namespaces -l app.kubernetes.io/created-by=eks-workshop
40-
ui Active 21h
37+
No resources found
4138
```
4239

4340
The first thing we'll do is deploy the catalog component by itself. The manifests for this component can be found in `~/environment/eks-workshop/base-application/catalog`.

website/docs/fastpaths/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Streamlined, role-based learning experiences that get you hands-on with Amazon E
1313

1414
As you can see in the picture, you can choose your learning journey for this workshop as per the following steps:
1515

16-
1. Learn how to navigate the instructions in the lab using _Navigating the Labs_ module to begin with.
17-
2. [Skip if you're at an AWS Event] : Setup an EKS Auto Mode cluster to use the learning paths.
16+
1. **[Setup](/docs/fastpaths/setup)** your environment — whether you're at an AWS event or running this in your own account, follow the setup guide to get your IDE and cluster ready.
17+
2. Learn how to navigate the instructions in the lab using the [Navigating the Labs](/docs/fastpaths/navigating-labs) module.
1818
3. Based on your role and interest, either choose the EKS developer or the EKS operator path for further learning.
1919

2020
Powered by Amazon EKS Auto Mode, these paths minimize infrastructure setup and management, letting you focus on learning core EKS concepts and deploying workloads faster. Perfect for workshops, events, or self-paced learning when you want immediate hands-on experience.
2121

22-
Let's understand how to navigate this workshop and the lab instructions now.
22+
Let's get your environment set up!

website/docs/fastpaths/navigating-labs.md

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,10 @@ If you haven't done so yet, you can open the IDE from the *Event outputs* sectio
2323

2424
![Event Outputs copy/paste](/img/fastpaths/ide-open.png)
2525

26-
## Prepare Environment
27-
28-
The `prepare-environment` tool helps you set up and configure your lab environment for each section. Simply run:
29-
30-
```
31-
$ prepare-environment $MODULE_NAME
32-
```
33-
34-
### Basic Usage Patterns
35-
```
36-
$ prepare-environment $MODULE_NAME/$LAB
37-
```
26+
## Starting a Lab
3827

3928
:::caution
40-
You should start each lab from the page indicated by "BEFORE YOU START" badge. Starting in the middle of a lab will cause unpredictable behavior.
29+
Each lab has a "BEFORE YOU START" section with a `prepare-environment` command you need to run first. Always start from that page — jumping into the middle of a lab will cause unpredictable behavior.
4130
:::
4231

4332
## Tips
@@ -49,18 +38,18 @@ Depending on your browser, you may need to copy/paste content differently in to
4938
<TabItem value="Google Chrome" label="Google Chrome (Recommended)" default>
5039
First time when you try to paste content in the terminal, you will see a browser pop-up that looks like this:
5140

52-
![Chrome copy/paste](/docs/introduction/vscode-copy-paste.webp)
41+
<img src="/docs/introduction/vscode-copy-paste.webp" alt="Chrome copy/paste" width="480" />
5342

5443
Click **Allow** button to enable this functionality. After this, the subsequent copy/paste will be straight forward. For this workshop, we recommend using Google Chrome if possible.
5544
</TabItem>
5645
<TabItem value="Firefox/Safari" label="Firefox/Safari">
5746
Every time when you try to paste content in the terminal, you will see a small button as shown in the following screenshot adjacent to your mouse pointer. You will need to click on it to actually paste the copied content.
5847

59-
![Firefox/Safari copy/paste](/img/fastpaths/introduction/paste-in-firefox-safari.png)
48+
<img src="/img/fastpaths/introduction/paste-in-firefox-safari.png" alt="Firefox/Safari copy/paste" width="480" />
6049

6150
Additionally, you may also see the following pop-up box on the bottom-right corner of your editor window, which you may close and ignore.
6251

63-
![Firefox/Safari copy/paste](/img/fastpaths/introduction/paste-warning-in-firefox-safari.png)
52+
<img src="/img/fastpaths/introduction/paste-warning-in-firefox-safari.png" alt="Firefox/Safari copy/paste" width="480" />
6453
</TabItem>
6554
</Tabs>
6655

@@ -106,18 +95,6 @@ In this workshop, you will see the following two types of commands involving Kus
10695

10796
You can learn more about Kustomize at https://kustomize.io/.
10897

109-
### Using Kustomize
110-
111-
[Kustomize](https://kustomize.io/) allows you to manage Kubernetes manifest files using declarative "kustomization" files. It provides the ability to express "base" manifests for your Kubernetes resources and then apply changes using composition, customization and easily making cross-cutting changes across many resources.
112-
113-
In this workshop, you will see the following two types of commands involving Kustomize.
114-
115-
1. `kubectl kustomize some-deployment.yaml` - This command **generates** the customized version of the yaml using Kustomize configuration. It does not deploy the resource.
116-
117-
1. `kubectl apply -k some-deployment.yaml` - This command directly **applies** the customized version of the yaml using Kustomize configuration and deploys the resource.
118-
119-
You can learn more about Kustomize at https://kustomize.io/.
120-
12198
## Next Steps
12299

123100
Now that you're familiar with the format of this workshop, head over to Getting started

website/docs/introduction/navigating-labs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ $ prepare-environment
6868
### Copy/Paste Permission
6969
Depending on your browser the first time you copy/paste content in to the VSCode terminal you may be presented with a prompt that looks like this:
7070

71-
![VSCode copy/paste](/docs/introduction/vscode-copy-paste.webp)
71+
<img src="/docs/introduction/vscode-copy-paste.webp" alt="VSCode copy/paste" width="480" />
7272
### Terminal commands
7373

7474
Most of the interaction you will do in this workshop will be done with terminal commands, which you can either manually type or copy/paste to the IDE terminal. You will see this terminal commands displayed like this:

website/src/components/SecondaryNav/index.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ export default function SecondaryNav() {
4444
<div className={styles.secondaryNavContainer}>
4545
<div className={styles.navSection}>
4646
{eksGroup.items.map((item, i) => {
47-
const isActive = location.pathname.startsWith(item.to);
47+
const normalizedTo = item.to.replace(/\/+$/, '');
48+
const normalizedPath = location.pathname.replace(/\/+$/, '');
49+
const isActive = normalizedPath === normalizedTo ||
50+
(normalizedPath.startsWith(normalizedTo + '/') &&
51+
!eksGroup.items.some(other => {
52+
const otherTo = other.to.replace(/\/+$/, '');
53+
return otherTo !== normalizedTo &&
54+
otherTo.startsWith(normalizedTo + '/') &&
55+
normalizedPath.startsWith(otherTo);
56+
}));
4857
return (
4958
<Link key={i} to={item.to} className={isActive ? styles.activeLink : ''}>{item.label}</Link>
5059
);
@@ -62,7 +71,16 @@ export default function SecondaryNav() {
6271
<div className={styles.secondaryNavContainer}>
6372
<div className={styles.navSection}>
6473
{autoModeGroup.items.map((item, i) => {
65-
const isActive = location.pathname.startsWith(item.to);
74+
const normalizedTo = item.to.replace(/\/+$/, '');
75+
const normalizedPath = location.pathname.replace(/\/+$/, '');
76+
const isActive = normalizedPath === normalizedTo ||
77+
(normalizedPath.startsWith(normalizedTo + '/') &&
78+
!autoModeGroup.items.some(other => {
79+
const otherTo = other.to.replace(/\/+$/, '');
80+
return otherTo !== normalizedTo &&
81+
otherTo.startsWith(normalizedTo + '/') &&
82+
normalizedPath.startsWith(otherTo);
83+
}));
6684
return (
6785
<Link key={i} to={item.to} className={isActive ? styles.activeLink : ''}>{item.label}</Link>
6886
);

0 commit comments

Comments
 (0)