Skip to content

Prerequisites

Before deploying applications to the DineTogether infrastructure, ensure you have the following:

Required Accounts

GitHub Account

  • [ ] Member of the dine-together organization
  • [ ] Access to create/manage repositories

Development Tools

  • [ ] Git - Version control

    git --version
    

  • [ ] Docker - For building container images

    docker --version
    

  • [ ] kubectl - Kubernetes CLI (for deployment and debugging)

    kubectl version --client
    # Install: https://kubernetes.io/docs/tasks/tools/
    

  • [ ] Flux CLI (optional but recommended)

    flux --version
    # Install: curl -s https://fluxcd.io/install.sh | sudo bash
    

  • [ ] GitHub CLI (optional but recommended)

    gh --version
    # Install: https://cli.github.com/
    

Repository Requirements

1. Repository Location

Your repository must be in the dine-together organization: - ✅ github.com/dine-together/your-app - ❌ github.com/personal/your-app

2. Required Files

your-app/
├── Dockerfile              # Container build instructions
└── .github/
    └── workflows/
        └── build.yml       # CI/CD workflow for building images

3. GitHub Actions Setup

Your app repository needs a workflow to build and push Docker images to GHCR:

# .github/workflows/build.yml
name: Build and Push Image

on:
  push:
    branches: [main]

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write
    # ... (see first-deployment.md for full example)

Infrastructure Repository Access

1. Clone the Infrastructure Repository

git clone https://github.com/dine-together/k8s-infrastructure.git
cd k8s-infrastructure

2. Understand the Structure

k8s-infrastructure/
├── clusters/
│   ├── staging/            # Staging environment configs
│   └── production/         # Production environment configs
├── apps/                   # Application manifests
├── monitoring/             # Prometheus, Grafana, Loki
└── scripts/                # Helper scripts

Local Development Setup

1. Install Docker Desktop

brew install --cask docker
Or download from Docker Desktop for Mac

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER

2. Install kubectl

brew install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/

Download from kubectl for Windows

3. Test Your Setup

# Test Docker
docker run hello-world

# Test kubectl (requires kubeconfig)
kubectl version --client

# Test GHCR access
echo $GITHUB_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin

Application Requirements

Supported Languages/Frameworks

The infrastructure supports any application that can run in a container:

  • Frontend: React, Next.js, Vue, Angular
  • Backend: Node.js, Python/Django, Ruby/Rails, Go
  • Databases: PostgreSQL, MySQL, MongoDB, Redis
  • Other: Any Dockerized application

Port Configuration

Your application should: - Bind to 0.0.0.0 (not localhost or 127.0.0.1) - Expose ports in Dockerfile - Use standard ports (3000 for Node.js, 8000 for Django, etc.)

Environment Variables

  • Use environment variables for configuration
  • Never hardcode secrets in code
  • Use Kubernetes Secrets for sensitive data

Kubernetes Cluster Access

For Deployment

You'll need: - Access to the k8s-infrastructure repository - Understanding of Helm charts or Kustomize - FluxCD will handle the actual deployment

For Debugging

If you need direct cluster access:

# Get kubeconfig from your administrator
# Then test connection
kubectl get nodes
kubectl get namespaces

Understanding GitOps

What is GitOps?

GitOps means: - Git repository is the source of truth - Changes are made via pull requests - FluxCD automatically syncs changes to the cluster - No manual kubectl apply commands

Key Concepts

  1. HelmRelease: Defines how to deploy your Helm chart
  2. Kustomization: Defines how to apply raw Kubernetes manifests
  3. ImageRepository: Watches for new container images
  4. ImagePolicy: Defines which image tags to use

Checklist

Before proceeding to deployment:

  • [ ] Docker installed and running
  • [ ] kubectl installed
  • [ ] Repository in dine-together organization
  • [ ] Can build Docker image locally
  • [ ] Understand GitOps principles
  • [ ] Access to k8s-infrastructure repository

Troubleshooting

Docker Not Running

# macOS/Windows: Start Docker Desktop app

# Linux: Start Docker service
sudo systemctl start docker

Permission Denied

# Add user to docker group (Linux)
sudo usermod -aG docker $USER
newgrp docker

Can't Access Repository

Ensure you're a member of the dine-together organization. Contact an admin if needed.

GHCR Authentication Issues

# Create a personal access token with read:packages and write:packages permissions
# Then login
echo YOUR_GITHUB_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin

Next Steps

Once prerequisites are met: 1. Continue to First Deployment 2. Learn about GitOps with FluxCD 3. Explore Helm Charts