Skip to content

Commit

Permalink
feat!: new gateway management (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
lostbean authored Sep 26, 2024
1 parent 54bdc21 commit b5a9916
Show file tree
Hide file tree
Showing 34 changed files with 1,223 additions and 628 deletions.
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Docker Hub](https://img.shields.io/badge/dockerhub-images-important.svg?logo=docker)](https://hub.docker.com/u/kurtosistech)
[![Docker Hub](https://img.shields.io/badge/dockerhub-images-important.svg?logo=docker)](https://hub.docker.com/u/kurtosistech)

# Kardinal

## What is Kardinal?
Expand All @@ -8,37 +9,45 @@ Kardinal is an open-source framework for creating extremely lightweight ephemera
In Kardinal, an environment is called a "[flow](https://kardinal.dev/docs/concepts/flows)" because it represents a path that a request takes through the cluster. Versions of services that are under development are deployed on-demand, and then shared across all development work that depends on that version. Read more about Kardinal in our [docs](https://kardinal.dev/docs).

### Why choose Kardinal?

- **Ephemeral Environments**: Spin up a new environment exactly when you need it, and just as quickly spin it down when you’re done.
- **Minimal Resource Usage**: Only deploy the services you’re actively working on. Kardinal takes care of the rest, so you don’t waste resources.
- **Flexible Environment Types**: Whether you need to test a single service or an entire application, Kardinal has you covered:
- Single-Service Flows: Perfect for when you’re tweaking just one service.
- Multi-Service Flows: Ideal for when your feature involves multiple services.
- State-Isolated Flows: Great for features that need their own isolated databases or caches.
- Full Application Flows: For those times when you need end-to-end testing with full isolation.
- Single-Service Flows: Perfect for when you’re tweaking just one service.
- Multi-Service Flows: Ideal for when your feature involves multiple services.
- State-Isolated Flows: Great for features that need their own isolated databases or caches.
- Full Application Flows: For those times when you need end-to-end testing with full isolation.
- **Cost Savings**: Kardinal can help you save big by avoiding unnecessary resource duplication. It’s a game-changer for teams looking to cut costs. Check out [this calculator](https://kardinal.dev/calculator) to run your own calculations.
- **Open Source**: Kardinal is open source, so use it however fits best within your workflows

### Want a demo?

Sign-up for a free demo of Kardinal below 👇

[![Get a demo](https://img.shields.io/badge/Get_a_demo-FC7444?style=for-the-badge)](https://calendly.com/d/cqhd-tgj-vmc/45-minute-meeting?month=2024-09)

## Installation

### **Step 1: Install Kardinal**

To install Kardinal, run the following command:

```
curl get.kardinal.dev -sL | sh
```

### **Step 2: Set up a development Kubernetes cluster**

All you need is a Kubernetes cluster with Istio enabled, and kubectl installed on your machine, pointing to your cluster. If you need help with this, read more [here](https://kardinal.dev/docs/getting-started/install)

### **Step 3: Deploy the Kardinal Manager to your cluster**

Make sure that kubectl is pointing to your cluster, and then run the following command:

```
kardinal manager deploy kloud-kontrol
```

Once installed check out our docs on [creating your first flow](https://kardinal.dev/docs/getting-started/own-app).

## Try it out in a Playground
Expand Down Expand Up @@ -133,6 +142,10 @@ Is it possible to develop your app with Kardinal + [Tilt](https://tilt.dev/). He
- [Tilt](https://docs.tilt.dev/install.html)
- Local K8s cluster, it could be [Minikube](https://minikube.sigs.k8s.io/docs/start) or [Docker desktop](https://docs.docker.com/desktop/kubernetes/) for instance
- [Istio](https://istio.io/latest/docs/setup/install/istioctl/#install-istio-using-the-default-profile)
- Gateway API
- ```bash
kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.1.0" | kubectl apply -f -;
```

### Deploy your application:

Expand All @@ -149,7 +162,7 @@ kardinal_topology_yaml_str = str(kardinal_topology_yaml)
if kardinal_topology_yaml_str != '':
k8s_yaml(kardinal_topology_yaml, allow_duplicates = True)
local_resource(
name='ingress-gateway-port-forward',
serve_cmd=['kubectl', 'port-forward', 'service/istio-ingressgateway', '80:80', '-n', 'istio-system']
Expand All @@ -175,7 +188,7 @@ kardinal_topology_yaml_str = str(kardinal_topology_yaml)
if kardinal_topology_yaml_str != '':
k8s_yaml(kardinal_topology_yaml, allow_duplicates = True)
local_resource(
name='ingress-gateway-port-forward',
serve_cmd=['kubectl', 'port-forward', 'service/istio-ingressgateway', '80:80', '-n', 'istio-system']
Expand Down Expand Up @@ -209,7 +222,7 @@ kardinal_topology_yaml_str = str(kardinal_topology_yaml)
if kardinal_topology_yaml_str != '':
k8s_yaml(kardinal_topology_yaml, allow_duplicates = True)
local_resource(
name='ingress-gateway-port-forward',
serve_cmd=['kubectl', 'port-forward', 'service/istio-ingressgateway', '80:80', '-n', 'istio-system']
Expand Down Expand Up @@ -241,6 +254,7 @@ The `delete-namespaces` flag is used to remove the application’s namespace, it
### More configuration examples:
For additional examples of configuring Kardinal with Tilt, refer to the [Tiltfile in the Kardinal Boutique demo app](https://github.com/kurtosis-tech/new-obd/blob/main/Tiltfile).
</details>
## Develop with Kardinal + Telepresence
Expand All @@ -266,7 +280,7 @@ Example:
1. Install Telepresence manager with Istio integration in your cluster (make sure that you have selected the targe cluster with kubectl before running it)
```shell
telepresence helm install --set trafficManager.serviceMesh.type=istio
telepresence helm install --set trafficManager.serviceMesh.type=istio
```
2. Create a dev flow with `Kardinal`.
```shell
Expand Down
40 changes: 22 additions & 18 deletions ci/obd-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,7 @@ spec:
protocol: TCP
appProtocol: HTTP
targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: frontend-external
annotations:
kardinal.dev.service/ingress: "true"
kardinal.dev.service/host: "prod.app.localhost"
spec:
type: LoadBalancer
selector:
app: frontend
ports:
- name: http
port: 80
targetPort: 8080
protocol: TCP
appProtocol: HTTP

---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -328,3 +311,24 @@ spec:
targetPort: 8070
protocol: TCP
appProtocol: HTTP

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kardinal.dev.service/ingress: "true"
name: ingress
spec:
rules:
- host: prod.app.localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 80
Loading

0 comments on commit b5a9916

Please sign in to comment.