From a5a633016d2d35929f4b1a72ef84b754ff24ade2 Mon Sep 17 00:00:00 2001 From: Nishan Date: Thu, 10 Apr 2025 12:08:06 +0530 Subject: [PATCH] FIX: helm labs --- .../002/scripts/setup/create_directories.sh | 0 .../other/002/scripts/setup/q10_setup.sh | 13 ++++++++++ .../other/002/scripts/setup/q11_setup.sh | 9 +++++++ .../scripts/setup/q12_setup_buggy_release.sh | 0 .../exams/other/002/scripts/setup/q1_setup.sh | 21 ++++++++++++++++ .../exams/other/002/scripts/setup/q2_setup.sh | 12 +++++++++ .../exams/other/002/scripts/setup/q3_setup.sh | 12 +++++++++ .../exams/other/002/scripts/setup/q4_setup.sh | 11 ++++++++ .../exams/other/002/scripts/setup/q5_setup.sh | 12 +++++++++ .../exams/other/002/scripts/setup/q6_setup.sh | 13 ++++++++++ .../exams/other/002/scripts/setup/q7_setup.sh | 10 ++++++++ .../exams/other/002/scripts/setup/q8_setup.sh | 13 ++++++++++ .../exams/other/002/scripts/setup/q9_setup.sh | 9 +++++++ scripts/install.ps1 | 25 +++++++++++++++++++ 14 files changed, 160 insertions(+) mode change 100644 => 100755 facilitator/assets/exams/other/002/scripts/setup/create_directories.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q10_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q11_setup.sh mode change 100644 => 100755 facilitator/assets/exams/other/002/scripts/setup/q12_setup_buggy_release.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q1_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q2_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q3_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q4_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q5_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q6_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q7_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q8_setup.sh create mode 100755 facilitator/assets/exams/other/002/scripts/setup/q9_setup.sh diff --git a/facilitator/assets/exams/other/002/scripts/setup/create_directories.sh b/facilitator/assets/exams/other/002/scripts/setup/create_directories.sh old mode 100644 new mode 100755 diff --git a/facilitator/assets/exams/other/002/scripts/setup/q10_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q10_setup.sh new file mode 100755 index 0000000..1680b6c --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q10_setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Setup environment for Question 10 - Package Chart and Create Local Repo + +# Create necessary directories +mkdir -p /tmp/exam/q10/charts + +# No other specific setup needed for this question +# The student needs to package the webapp chart into a .tgz file +# Create a local chart repository at /tmp/exam/q10/charts +# Create an index file and add the local repo to Helm + +echo "Environment setup complete for Question 10" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q11_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q11_setup.sh new file mode 100755 index 0000000..a27b5d8 --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q11_setup.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Setup environment for Question 11 - Roll Back Release + +# No specific setup needed for this question +# The student needs to roll back the web-server release to its first revision +# and verify the rollback was successful by checking revision number and replica count + +echo "Environment setup complete for Question 11" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q12_setup_buggy_release.sh b/facilitator/assets/exams/other/002/scripts/setup/q12_setup_buggy_release.sh old mode 100644 new mode 100755 diff --git a/facilitator/assets/exams/other/002/scripts/setup/q1_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q1_setup.sh new file mode 100755 index 0000000..010482b --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q1_setup.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Setup environment for Question 1 - Verify Helm Installation + +# Create necessary directories +mkdir -p /tmp/exam/q1 + +# Ensure Helm is installed on the system +# This is likely already set up as part of the environment initialization +# but we'll check and report status + +if ! command -v helm &> /dev/null; then + echo "❌ Helm is not installed on the system. This is a prerequisite for the helm-001 lab." + exit 1 +else + echo "✅ Helm is installed and available for the exam." +fi + +# No other setup needed for this question as it only requires checking the helm version + +echo "Environment setup complete for Question 1" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q2_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q2_setup.sh new file mode 100755 index 0000000..cd3de10 --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q2_setup.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Setup environment for Question 2 - Adding Bitnami Helm Repository + +# No specific setup needed for this question +# This is a task for the student to add the Bitnami repo +# The student needs to run the following commands: +# helm repo add bitnami https://charts.bitnami.com/bitnami +# helm repo update +# helm repo list + +echo "Environment setup complete for Question 2" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q3_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q3_setup.sh new file mode 100755 index 0000000..f53b61f --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q3_setup.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Setup environment for Question 3 - Search for Nginx Chart + +# Create necessary directories +mkdir -p /tmp/exam/q3 + +# No other setup needed for this question +# The student will need to search for the nginx chart in the Bitnami repository +# and save the results to /tmp/exam/q3/nginx-charts.txt + +echo "Environment setup complete for Question 3" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q4_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q4_setup.sh new file mode 100755 index 0000000..090fbe7 --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q4_setup.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Setup environment for Question 4 - Install Nginx Chart + +# No specific setup needed for this question +# The student needs to install the Bitnami nginx chart with release name web-server +# They should set the service type to NodePort and port to 30080 +# The expected commands would be something like: +# helm install web-server bitnami/nginx --set service.type=NodePort --set service.nodePorts.http=30080 + +echo "Environment setup complete for Question 4" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q5_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q5_setup.sh new file mode 100755 index 0000000..658b227 --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q5_setup.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Setup environment for Question 5 - List Helm Releases + +# Create necessary directories +mkdir -p /tmp/exam/q5 + +# No other setup needed for this question +# The student needs to list all Helm releases across all namespaces +# and save the output to /tmp/exam/q5/releases.txt + +echo "Environment setup complete for Question 5" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q6_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q6_setup.sh new file mode 100755 index 0000000..6a35962 --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q6_setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Setup environment for Question 6 - Get Release Status + +# Create necessary directories +mkdir -p /tmp/exam/q6 + +# No other specific setup needed for this question +# The student needs to get the status of the web-server release +# and save the output to /tmp/exam/q6/web-server-status.txt +# They also need to get the manifest summary and save it to /tmp/exam/q6/web-server-manifests.txt + +echo "Environment setup complete for Question 6" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q7_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q7_setup.sh new file mode 100755 index 0000000..7b95eec --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q7_setup.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Setup environment for Question 7 - Upgrade Release + +# No specific setup needed for this question +# The student needs to upgrade the web-server release to set replica count to 3 +# The expected command would be something like: +# helm upgrade web-server bitnami/nginx --set replicaCount=3 + +echo "Environment setup complete for Question 7" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q8_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q8_setup.sh new file mode 100755 index 0000000..e62296f --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q8_setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Setup environment for Question 8 - Create Values File for Redis + +# Create necessary directories +mkdir -p /tmp/exam/q8 + +# No other specific setup needed for this question +# The student needs to create a values file at /tmp/exam/q8/redis-values.yaml +# with specific configuration for Redis installation +# Then install the Bitnami Redis chart with release name cache-db + +echo "Environment setup complete for Question 8" +exit 0 \ No newline at end of file diff --git a/facilitator/assets/exams/other/002/scripts/setup/q9_setup.sh b/facilitator/assets/exams/other/002/scripts/setup/q9_setup.sh new file mode 100755 index 0000000..2a88f74 --- /dev/null +++ b/facilitator/assets/exams/other/002/scripts/setup/q9_setup.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Setup environment for Question 9 - Create New Helm Chart + +# No specific setup needed for this question +# The student needs to create a new Helm chart named webapp +# using the helm create command and modify Chart.yaml + +echo "Environment setup complete for Question 9" +exit 0 \ No newline at end of file diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 8f279c0..29733ca 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -77,6 +77,20 @@ try { } } + # Function to check if Docker is using WSL 2 + function Test-DockerWSL { + try { + $dockerInfo = docker info 2>&1 + if ($dockerInfo -match "WSL") { + return $true + } else { + return $false + } + } catch { + return $false + } + } + # Function to check system requirements function Check-Requirements { Write-ColorOutput "Checking System Requirements" "Blue" @@ -114,6 +128,17 @@ try { $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") return $false } + Write-ColorOutput "✓ Docker is running" "Green" + + # Check if Docker is using WSL 2 + if (-not (Test-DockerWSL)) { + Write-ColorOutput "✗ Docker is not using WSL 2" "Red" + Write-ColorOutput "CKX is not supported without WSL enablement. Please enable WSL 2 in Docker Desktop." "Yellow" + Write-Host "Press any key to continue..." + $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") + return $false + } + Write-ColorOutput "✓ Docker WSL 2 integration is enabled" "Green" Write-ColorOutput "" "" # Check Docker Compose (built into Docker Desktop for Windows)