Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kube-Deployments: Test Assignment

Code Base: deploy the full-stack template from fastapi/full-stack-fastapi-template

Objective: Validate your ability to implement a GitOps workflow that deploys a React frontend, FastAPI backend and PostgreSQL database into two separate Kubernetes namespaces (dev/prod) using Argo CD, Helm charts, AWS Secrets Manager and AWS ECR, with CI/CD automated by GitHub Actions.


Tasks

  1. Initialize the GitOps repository

    • Fork or clone your repo and add a root “App of Apps” Argo CD application that points at an argocd-apps/ directory.
  2. External Secrets

    • Create a ClusterSecretStore for AWS Secrets Manager.
    • Define two ExternalSecret resources (dev/backend-secret, prod/backend-secret) to consume secrets from AWS.
  3. PostgreSQL via ApplicationSet

    • Write an Argo CD ApplicationSet (matrix or list generator) that provisions two PostgreSQL instances—one in namespace dev (1 Gi storage) and one in prod (2 Gi)—using the Bitnami chart and the above secrets.
  4. Custom Helm charts

    • Populate templates/deployment.yaml, service.yaml and ingress.yaml in custom-charts/backend and custom-charts/frontend.
    • In the backend chart, add initContainers to wait for Postgres and run migrations.
    • Configure Ingress rules:
      • Backend: /api and /docsbackend-service
      • Frontend: /frontend-service
  5. CI/CD with GitHub Actions

    • Create two workflows in .github/workflows: backend.yaml and frontend.yaml, each triggered by workflow_dispatch with an environment input (dev or prod).
    • Use OIDC to assume an IAM role and push Docker images to AWS ECR (public).
    • In each workflow:
      1. Check out code
      2. Configure AWS credentials (aws-actions/configure-aws-credentials)
      3. Log in to ECR (aws-actions/amazon-ecr-login)
      4. Build and push images tagged with the short Git SHA, and—if prod—also push a latest tag
      5. Update the image tag in custom-charts/<service>/values-<environment>.yaml via fjogeleit/yaml-update-action
    • In frontend.yaml, additionally set BACKEND_URL (https://dev.myapp.local or https://myapp.local) as a build-arg VITE_API_URL.
  6. ApplicationSet for apps

    • Create a single Argo CD ApplicationSet that generates four applications: backend-dev, backend-prod, frontend-dev, frontend-prod, each pointing at the appropriate chart and values file.
  7. Local testing

    • Map dev.myapp.local and myapp.local to 127.0.0.1 (e.g. /etc/hosts).
    • Ensure pods are running, UI and API are reachable at both domains, and that dev/prod data are isolated.
  8. Documentation

    • Update the README with a concise Quick Start section showing how to:
      git clone <your-fork>
      # Argo CD auto-sync
      kubectl get applications -n argocd
    • Describe where to view Argo CD status, how to access the UI, and how to trigger workflows.

Deliverables

  • A fork with all changes committed.
  • A Pull Request containing:
    • Inline comments on each workflow and chart explaining your implementation
    • A brief PR description summarizing testing steps and outcomes

Good luck!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors