Skip to content
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
21 changes: 13 additions & 8 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,32 @@ jobs:

runs-on: ubuntu-latest
container:
image: docker/tilt:latest
image: tiltdev/tilt:latest

steps:
- uses: actions/checkout@v6

- uses: azure/setup-helm@v5.0.1

- name: Create k8s Kind Cluster
run: ctlptl create cluster kind --registry=ctlptl-registry

- name: Cache Helm Output
- name: Cache Helm and Registry
id: cache-helm-output
uses: actions/cache@v5
with:
path: .helm-cache
path: |
.helm-cache
${{ env.GITHUB_WORKSPACE }}/.registry
key: ${{ github.ref_name }}-${{ hashFiles('apps/**/*.yaml', 'cluster/traefik/**/*.yaml', 'cluster/storage/**/*.yaml', 'infra/**/*.yaml', 'ops/monitoring/**/*.yaml') }}
restore-keys: |
${{ github.ref_name }}
develop
${{ github.base_ref }}

- uses: azure/setup-helm@v5.0.1

- name: Create Registry
run: docker run -d -p "127.0.0.1:5000:5000" --network bridge --name kind-registry --env REGISTRY_STORAGE_DELETE_ENABLED=true -v $GITHUB_WORKSPACE/.registry:/var/lib/registry registry:3

- name: Create k8s Kind Cluster
run: ctlptl apply -f tilt/ctlptl.yaml

- name: Test Using Local Config
run: tilt ci --timeout "5m"

Expand Down
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ for object in decode_yaml_stream(traefik_yaml):
traefik_crds.append(name + ":" + kind)

k8s_resource(new_name="traefik-crds", objects=traefik_crds, labels=["traefik"])
agnostic_local_resource("wait-for-traefik-crd", cmd=["kubectl", "wait", "--for=condition=established", "--timeout=60s", "crd/ingressroutes.traefik.io"], resource_deps=["traefik-crds"], labels=["traefik"])
agnostic_local_resource("wait-for-traefik-crd", cmd=["./tilt/scripts/wait-for.sh", "--for=condition=established", "--timeout=60s", "crd/ingressroutes.traefik.io"], resource_deps=["traefik-crds"], labels=["traefik"])
k8s_resource(new_name="traefik-setup", objects=traefik_identifiers, resource_deps=["namespaces", "wait-for-traefik-crd"], labels=["traefik"])
k8s_resource(workload="traefik", port_forwards=["443:8443", "80:8000"], resource_deps=["traefik-setup"], labels=["traefik"], links=[link("http://traefik.{}".format(base_domain), "FAF Traefik")])

Expand Down Expand Up @@ -295,7 +295,7 @@ k8s_resource(new_name="monitoring-setup", objects=monitoring_accounts + monitori
k8s_resource(workload="monitoring-grafana", objects=["grafana:ingressroute"], resource_deps=["monitoring-setup"], labels=["monitoring"], links=[link("http://grafana.{}".format(base_domain), "FAF Grafana")])
k8s_resource(workload="monitoring-kube-state-metrics", resource_deps=["monitoring-setup"], labels=["monitoring"])
k8s_resource(workload="monitoring-loki", resource_deps=["monitoring-setup"], labels=["monitoring"])
agnostic_local_resource("wait-for-alloy-crd", cmd=["kubectl", "wait", "--for=condition=established", "--timeout=60s", "crd/alloys.collectors.grafana.com"], resource_deps=["monitoring-crds"], labels=["monitoring"])
agnostic_local_resource("wait-for-alloy-crd", cmd=["./tilt/scripts/wait-for.sh", "--for=condition=established", "--timeout=60s", "crd/alloys.collectors.grafana.com"], resource_deps=["monitoring-crds"], labels=["monitoring"])
k8s_resource(new_name="monitoring-alloy-logs", objects=["monitoring-alloy-logs:alloy"], resource_deps=["monitoring-setup", "wait-for-alloy-crd"], labels=["monitoring"])
k8s_resource(workload="monitoring-loki-gateway", resource_deps=["monitoring-setup"], labels=["monitoring"])
k8s_resource(workload="monitoring-loki-results-cache", resource_deps=["monitoring-setup"], labels=["monitoring"])
Expand Down
9 changes: 9 additions & 0 deletions tilt/ctlptl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: ctlptl.dev/v1alpha1
kind: Registry
name: kind-registry
port: 5000
---
apiVersion: ctlptl.dev/v1alpha1
kind: Cluster
product: kind
registry: kind-registry
6 changes: 6 additions & 0 deletions tilt/scripts/wait-for.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

until kubectl wait "$@" 2>/dev/null; do
echo "Waiting for resources to be created and ready..."
sleep 2
done