Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e04a99c
Restructure intro section
avinashdesireddy Aug 6, 2025
d02a78b
Intro restructure
avinashdesireddy Aug 21, 2025
20f30d2
Merge branch 'main' of https://github.com/avinashdesireddy/eks-worksh…
avinashdesireddy Sep 23, 2025
7239d80
Restructure Intro
avinashdesireddy Sep 29, 2025
d23278d
Merge changes from main
avinashdesireddy Sep 29, 2025
6b63ad6
code updates
avinashdesireddy Oct 2, 2025
2ddacc9
Merge branch 'aws-samples:main' into feature/k8sintro
avinashdesireddy Oct 3, 2025
8f30534
Add Kubernetes basics pages(ns, pods, deploy, ss & ds)
avinashdesireddy Oct 4, 2025
d928f1d
Kubernetes basics content update
avinashdesireddy Oct 4, 2025
764f740
Kubernetes basics content update
avinashdesireddy Oct 5, 2025
7c3ae94
Fix k8s basics services test
avinashdesireddy Oct 5, 2025
d4adb57
K8s basics content updates
avinashdesireddy Oct 5, 2025
41b0f92
K8s basics content updates
avinashdesireddy Oct 5, 2025
3f1c675
Merge branch 'feature/k8sintro' of https://github.com/avinashdesiredd…
avinashdesireddy Oct 6, 2025
7f8b3e6
K8s basics content updates
avinashdesireddy Oct 6, 2025
d83bfae
fix page order
avinashdesireddy Oct 6, 2025
dfc4f46
add test durations
avinashdesireddy Oct 6, 2025
67a1447
fix broken links
avinashdesireddy Oct 6, 2025
064b3e0
update dependencies
avinashdesireddy Oct 6, 2025
85eafcf
Merge branch 'aws-samples:main' into feature/k8sintro
avinashdesireddy Oct 6, 2025
5c4b240
sync yarn.lock with main
avinashdesireddy Oct 6, 2025
5b32a28
Update yarn.lock
niallthomson Oct 6, 2025
45607fc
consolidate labs
avinashdesireddy Oct 13, 2025
898d1af
Merge branch 'feature/k8sintro' of https://github.com/avinashdesiredd…
avinashdesireddy Oct 13, 2025
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
Empty file modified .yarn/releases/yarn-4.9.4.cjs
100755 → 100644
Empty file.
45 changes: 26 additions & 19 deletions lab/bin/reset-environment
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,29 @@ kubectl delete pod load-generator --ignore-not-found

kubectl delete namespace other --ignore-not-found

kubectl apply -k $base_path --prune --all \
--prune-allowlist=autoscaling/v1/HorizontalPodAutoscaler \
--prune-allowlist=core/v1/Service \
--prune-allowlist=core/v1/ConfigMap \
--prune-allowlist=apps/v1/Deployment \
--prune-allowlist=apps/v1/StatefulSet \
--prune-allowlist=core/v1/ServiceAccount \
--prune-allowlist=core/v1/Secret \
--prune-allowlist=core/v1/PersistentVolumeClaim \
--prune-allowlist=scheduling.k8s.io/v1/PriorityClass \
--prune-allowlist=networking.k8s.io/v1/Ingress
if [[ $module != introduction/basics* ]]; then
kubectl apply -k $base_path --prune --all \
--prune-allowlist=autoscaling/v1/HorizontalPodAutoscaler \
--prune-allowlist=core/v1/Service \
--prune-allowlist=core/v1/ConfigMap \
--prune-allowlist=apps/v1/Deployment \
--prune-allowlist=apps/v1/StatefulSet \
--prune-allowlist=core/v1/ServiceAccount \
--prune-allowlist=core/v1/Secret \
--prune-allowlist=core/v1/PersistentVolumeClaim \
--prune-allowlist=scheduling.k8s.io/v1/PriorityClass \
--prune-allowlist=networking.k8s.io/v1/Ingress

logmessage "\n⏳ Waiting for application to become ready..."

sleep 10

kubectl wait --for=condition=available --timeout=240s deployments -l app.kubernetes.io/created-by=eks-workshop -A
kubectl wait --for=condition=Ready --timeout=240s pods -l app.kubernetes.io/created-by=eks-workshop -A

logmessage "\n⏳ Waiting for application to become ready..."

sleep 10

kubectl wait --for=condition=available --timeout=240s deployments -l app.kubernetes.io/created-by=eks-workshop -A
kubectl wait --for=condition=Ready --timeout=240s pods -l app.kubernetes.io/created-by=eks-workshop -A
else
kubectl delete -k $base_path --ignore-not-found
fi

# Addons
rm -rf /eks-workshop/terraform
Expand Down Expand Up @@ -238,10 +243,12 @@ if [ $EXIT_CODE -ne 0 ]; then
fi

# Recycle workload pods in case stateful pods got restarted
kubectl delete pod -l app.kubernetes.io/created-by=eks-workshop -l app.kubernetes.io/component=service -A
kubectl delete pod -l app.kubernetes.io/created-by=eks-workshop -l app.kubernetes.io/component=service -A --ignore-not-found

# Wait for the workload pods previously recycled
kubectl wait --for=condition=Ready --timeout=240s pods -l app.kubernetes.io/created-by=eks-workshop -A
if kubectl get pods -A -l app.kubernetes.io/created-by=eks-workshop 2>/dev/null | grep -q .; then
kubectl wait --for=condition=Ready --timeout=240s pods -l app.kubernetes.io/created-by=eks-workshop -A
fi

# Finished
logmessage "\n✅ Environment is ${GREEN}ready${NC}!"
34 changes: 34 additions & 0 deletions manifests/modules/introduction/basics/.workshop/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

set -e

echo "Cleaning up Kubernetes Basics module resources..."

# Clean up pods
echo "Cleaning up pods..."
kubectl delete pod ui-pod -n ui --ignore-not-found=true
kubectl delete pod test-pod --ignore-not-found=true

# Clean up secrets
echo "Cleaning up secrets..."
kubectl delete secret catalog-db -n catalog --ignore-not-found=true

# Clean up daemonsets
echo "Cleaning up daemonsets..."
kubectl delete daemonset log-collector -n kube-system --ignore-not-found=true

# Clean up jobs and cronjobs
echo "Cleaning up jobs and cronjobs..."
kubectl delete job data-processor -n catalog --ignore-not-found=true
kubectl delete cronjob catalog-cleanup -n catalog --ignore-not-found=true
kubectl delete job manual-cleanup -n catalog --ignore-not-found=true

# Delete any jobs that start with catalog-cleanup (created by CronJob)
kubectl get jobs -n catalog -o name 2>/dev/null | grep "job/catalog-cleanup" | xargs -r kubectl delete -n catalog --ignore-not-found=true

# Clean up namespaces (do this last as it will clean up any remaining resources)
echo "Cleaning up namespaces..."
kubectl delete namespace ui --ignore-not-found=true
kubectl delete namespace catalog --ignore-not-found=true

echo "Kubernetes Basics module cleanup completed."
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../base-application/ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: Pod
metadata:
name: ui-pod
namespace: ui
labels:
app.kubernetes.io/name: ui
app.kubernetes.io/component: service
app.kubernetes.io/created-by: eks-workshop
spec:
containers:
- name: ui
image: public.ecr.aws/aws-containers/retail-store-sample-ui:0.4.0
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: ui
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: log-collector
namespace: kube-system
labels:
app.kubernetes.io/name: log-collector
app.kubernetes.io/created-by: eks-workshop
spec:
selector:
matchLabels:
app: log-collector
template:
metadata:
labels:
app: log-collector
spec:
containers:
- name: fluentd
image: public.ecr.aws/aws-observability/aws-for-fluent-bit:stable
volumeMounts:
- name: varlog
mountPath: /var/log
readOnly: true
- name: containers
mountPath: /var/lib/docker/containers
readOnly: true
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 200m
memory: 256Mi
volumes:
- name: varlog
hostPath:
path: /var/log
- name: containers
hostPath:
path: /var/lib/docker/containers
52 changes: 52 additions & 0 deletions manifests/modules/introduction/basics/jobs/catalog-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: catalog-cleanup
namespace: catalog
labels:
app.kubernetes.io/name: catalog-cleanup
app.kubernetes.io/created-by: eks-workshop
spec:
schedule: "*/1 * * * *" # Every 1 minute for demo purposes
timeZone: "UTC"
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
metadata:
labels:
app: catalog-cleanup
spec:
restartPolicy: OnFailure
containers:
- name: cleanup
image: busybox:1.36
command:
- /bin/sh
- -c
- |
echo "Starting cleanup job at $(date)"
echo "Checking for temporary files..."

# Simulate finding and cleaning up files
echo "Found 3 temporary files to clean up:"
echo " - /tmp/cache_file_1.tmp"
echo " - /tmp/cache_file_2.tmp"
echo " - /tmp/old_log.log"

# Simulate cleanup process
sleep 3
echo "Cleaning up temporary files..."
sleep 2
echo "Temporary files removed successfully"

echo "Cleanup completed at $(date)"
echo "Next cleanup scheduled in 1 minute"
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: batch/v1
kind: Job
metadata:
name: data-processor
namespace: catalog
labels:
app.kubernetes.io/name: data-processor
app.kubernetes.io/created-by: eks-workshop
spec:
completions: 1
parallelism: 1
backoffLimit: 3
template:
metadata:
labels:
app: data-processor
spec:
restartPolicy: Never
containers:
- name: processor
image: busybox:1.36
command:
- /bin/sh
- -c
- |
echo "Starting data processing job..."
echo "Processing catalog data files..."

# Simulate processing multiple files
for i in $(seq 1 5); do
echo "Processing file $i/5..."
sleep 2
echo "File $i processed successfully"
done

echo "Generating summary report..."
cat > /tmp/processing-report.txt << EOF
Data Processing Report
=====================
Job: data-processor
Date: $(date)
Files processed: 5
Status: Completed successfully
EOF

echo "Report generated:"
cat /tmp/processing-report.txt
echo "Data processing job completed successfully!"
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 200m
memory: 256Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: ui
labels:
app.kubernetes.io/created-by: eks-workshop
25 changes: 25 additions & 0 deletions manifests/modules/introduction/basics/pods/ui-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: Pod
metadata:
name: ui-pod
namespace: ui
labels:
app.kubernetes.io/name: ui
app.kubernetes.io/component: service
spec:
containers:
- name: ui
image: public.ecr.aws/aws-containers/retail-store-sample-ui:1.2.1
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: JAVA_OPTS
value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom
resources:
requests:
cpu: 250m
memory: 1.5Gi
limits:
memory: 1.5Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v1
kind: Pod
metadata:
name: catalog-pod
namespace: catalog
labels:
app.kubernetes.io/name: catalog
app.kubernetes.io/component: service
app.kubernetes.io/created-by: eks-workshop
spec:
containers:
- name: catalog
image: public.ecr.aws/aws-containers/retail-store-sample-catalog:1.2.1
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: catalog
- secretRef:
name: catalog-db
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../base-application/catalog
26 changes: 26 additions & 0 deletions manifests/modules/introduction/basics/services/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ui
labels:
app.kubernetes.io/created-by: eks-workshop
app.kubernetes.io/type: app
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
template:
spec:
containers:
- name: ui
env:
- name: MANAGEMENT_INFO_ENV_ENABLED
value: "true"
- name: INFO_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../base-application/ui
patches:
- path: deployment.yaml
Loading