Skip to content

Kubernetes #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "GitpodFlix Dev Environment",
"name": "GitpodFlix Dev Environment - Kubernetes",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
Expand All @@ -17,6 +17,11 @@
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true
},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest",
"helm": "latest",
"minikube": "latest"
}
},
"forwardPorts": [
Expand All @@ -33,7 +38,8 @@
"mtxr.sqltools",
"mtxr.sqltools-driver-sqlite",
"mtxr.sqltools-driver-mysql",
"bradlc.vscode-tailwindcss"
"bradlc.vscode-tailwindcss",
"ms-kubernetes-tools.vscode-kubernetes-tools"
],
"settings": {
"editor.formatOnSave": true
Expand Down
35 changes: 21 additions & 14 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Exit on error
set -e

echo "🚀 Starting development environment setup..."
echo "🚀 Starting Kubernetes development environment setup..."

# Function to handle package installation
install_package() {
Expand All @@ -22,32 +22,31 @@ apt-get clean
echo "🔄 Updating package lists..."
apt-get update

# Install system dependencies one by one with error handling
# Install system dependencies
echo "📦 Installing system dependencies..."
install_package "mariadb-client"
install_package "mariadb-server"
install_package "postgresql-client"
install_package "net-tools"

# Verify PostgreSQL client tools are installed
if ! command -v pg_isready &> /dev/null; then
echo "❌ PostgreSQL client tools not properly installed"
exit 1
fi

# Start MariaDB service
echo "💾 Starting MariaDB service..."
if ! service mariadb status > /dev/null 2>&1; then
service mariadb start
else
echo "✅ MariaDB service is already running"
# Verify Kubernetes tools are available
echo "🔍 Verifying Kubernetes tools..."
if ! command -v kubectl &> /dev/null; then
echo "❌ kubectl not found"
exit 1
fi

# Verify MariaDB is running
if ! service mariadb status > /dev/null 2>&1; then
echo "❌ Failed to start MariaDB service"
if ! command -v minikube &> /dev/null; then
echo "❌ minikube not found"
exit 1
fi

echo "✅ Kubernetes tools verified"

# Install global npm packages
echo "📦 Installing global npm packages..."
npm install -g nodemon
Expand All @@ -69,4 +68,12 @@ if [ -d "/workspaces/gitpodflix-demo/backend/catalog" ]; then
npm install
fi

echo "✅ Setup completed successfully!"
# Make scripts executable
echo "🔧 Making scripts executable..."
chmod +x /workspaces/gitpodflix-demo/scripts/*.sh

echo "✅ Kubernetes development environment setup completed successfully!"
echo "🎯 Next steps:"
echo " 1. Run 'Setup Minikube' task to initialize the cluster"
echo " 2. Run 'Start Port Forwards' task to access services"
echo " 3. Run 'Seed Database' task to populate with sample data"
Loading