diff --git a/examples/kubernetes-tilt-dev/README.md b/examples/kubernetes-tilt-dev/README.md index e69de29..6277eab 100644 --- a/examples/kubernetes-tilt-dev/README.md +++ b/examples/kubernetes-tilt-dev/README.md @@ -0,0 +1,89 @@ +# Tilt + Minikube Development Environment 🚀 + +Welcome to a seamless, efficient, and developer-friendly Kubernetes development experience! This repository combines the power of [Tilt](https://tilt.dev/) and [Minikube](https://minikube.sigs.k8s.io/) to supercharge your microservices development. Say goodbye to complex configurations and hello to streamlined development! + +## Why This Demo Matters + +This demo isn't just about showcasing two impressive microservices. It's about empowering developers to harness the agility of Kubernetes without the steep learning curve. We've crafted an environment that's easy to set up, intuitive to navigate, and accelerates your development workflow. + +## What's Inside? 🏗️ + +In this repository, you'll find two remarkable microservices waiting for you: + +1. **Node.js with Nest.js** 🟢 + A beautifully crafted Nest.js API, complete with Swagger integration for effortless exploration. + +2. **Python with FastAPI** 🐍 + Dive into FastAPI's high-performance world! Another RESTful API flaunting a Swagger interface for swift exploration. + +### Directory Structure 📁 + +```txt +. +├── apps +│ ├── node-nestjs-app +│ │ ├── ... +│ │ ├── Dockerfile +│ │ └── README.md +│ └── python-fastapi-app +│ ├── ... +│ ├── Dockerfile +│ └── README.md +├── k8s +│ ├── node-nestjs-app +│ │ ├── deployment.yml +│ │ └── service.yml +│ ├── python-fastapi-app +│ │ ├── deployment.yml +│ │ └── service.yml +│ ├── ingress.yml +│ └── namespaces.yml +├── README.md +└── Tiltfile +``` + +## Getting Started 🚦 + +1. **Clone This Repository** +2. **Install Minikube**: Follow [Minikube's installation guide](https://minikube.sigs.k8s.io/docs/start/) if you haven't already. +3. **Install Tilt**: Refer to [Tilt's installation guide](https://docs.tilt.dev/install.html). + +### Starting Minikube and Tilt + +```sh +minikube start +tilt up +``` + +Once initiated, visit [http://localhost:10350/](http://localhost:10350/) to explore the Tilt dashboard. + +### Enable Ingress and Tunnel + +To access your microservices, you'll need to enable Ingress and tunnel to your cluster. Run the following commands to do so: + +```sh +minikube addons enable ingress +minikube tunnel +``` + +## Explore the Microservices + +Use the Tilt dashboard to explore your microservices, view logs, and more. Click the `View` button next to each service to access its Swagger UI. + +## Understanding Kubernetes ⚙️ + +### Ingress + +The `k8s/ingress.yml` routes traffic to the microservices. Enable it with: + +### Namespaces + +Organize microservices using the `k8s/namespaces.yml` file, making management a breeze. + +### Microservices + +Each microservice in `k8s/` has a Deployment and Service resource, handling deployment and exposure. + +## Tiltfile 📜 + +The `Tiltfile` configures Tilt. Customize your dev environment and add more microservices here. diff --git a/examples/kubernetes-tilt-dev/Tiltfile b/examples/kubernetes-tilt-dev/Tiltfile index ae04c2f..c26e5e5 100644 --- a/examples/kubernetes-tilt-dev/Tiltfile +++ b/examples/kubernetes-tilt-dev/Tiltfile @@ -1,21 +1,21 @@ version_settings(constraint='>=0.22.2') -k8s_yaml(['k8s/namespaces.yml']) +k8s_yaml(['k8s/namespace.yml']) docker_build( 'k8s-tilt-dev-example-node-nestjs-app', - './apps/node-nestjs-app/', + 'apps/node-nestjs-app/', target='development', ) -k8s_yaml(['k8s/node-nestjs-app/deployment.yml', 'k8s/node-nestjs-app/service.yml']) +k8s_yaml(['apps/node-nestjs-app/k8s/deployment.yml', 'apps/node-nestjs-app/k8s/service.yml']) docker_build( 'k8s-tilt-dev-example-python-fastapi-app', - './apps/python-fastapi-app/', + 'apps/python-fastapi-app/', target='development', ) -k8s_yaml(['k8s/python-fastapi-app/deployment.yml', 'k8s/python-fastapi-app/service.yml']) +k8s_yaml(['apps/python-fastapi-app/k8s/deployment.yml', 'apps/python-fastapi-app/k8s/service.yml']) k8s_yaml('k8s/ingress.yml') diff --git a/examples/kubernetes-tilt-dev/k8s/node-nestjs-app/deployment.yml b/examples/kubernetes-tilt-dev/apps/node-nestjs-app/k8s/deployment.yml similarity index 100% rename from examples/kubernetes-tilt-dev/k8s/node-nestjs-app/deployment.yml rename to examples/kubernetes-tilt-dev/apps/node-nestjs-app/k8s/deployment.yml diff --git a/examples/kubernetes-tilt-dev/k8s/node-nestjs-app/service.yml b/examples/kubernetes-tilt-dev/apps/node-nestjs-app/k8s/service.yml similarity index 100% rename from examples/kubernetes-tilt-dev/k8s/node-nestjs-app/service.yml rename to examples/kubernetes-tilt-dev/apps/node-nestjs-app/k8s/service.yml diff --git a/examples/kubernetes-tilt-dev/k8s/python-fastapi-app/deployment.yml b/examples/kubernetes-tilt-dev/apps/python-fastapi-app/k8s/deployment.yml similarity index 100% rename from examples/kubernetes-tilt-dev/k8s/python-fastapi-app/deployment.yml rename to examples/kubernetes-tilt-dev/apps/python-fastapi-app/k8s/deployment.yml diff --git a/examples/kubernetes-tilt-dev/k8s/python-fastapi-app/service.yml b/examples/kubernetes-tilt-dev/apps/python-fastapi-app/k8s/service.yml similarity index 100% rename from examples/kubernetes-tilt-dev/k8s/python-fastapi-app/service.yml rename to examples/kubernetes-tilt-dev/apps/python-fastapi-app/k8s/service.yml diff --git a/examples/kubernetes-tilt-dev/k8s/namespaces.yml b/examples/kubernetes-tilt-dev/k8s/namespace.yml similarity index 100% rename from examples/kubernetes-tilt-dev/k8s/namespaces.yml rename to examples/kubernetes-tilt-dev/k8s/namespace.yml