From 7efc9213b09b3dc1bba54fab0a4fd37cdbf94706 Mon Sep 17 00:00:00 2001 From: Fabrizio Sestito Date: Tue, 3 Dec 2024 10:39:03 +0100 Subject: [PATCH] chore(Tiltfile): add a development registry to Tilt Signed-off-by: Fabrizio Sestito --- Tiltfile | 9 +++++++++ examples/registry.yaml | 2 +- hack/registry.yaml | 27 +++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 hack/registry.yaml diff --git a/Tiltfile b/Tiltfile index 022b0e5..29844ca 100644 --- a/Tiltfile +++ b/Tiltfile @@ -1,6 +1,15 @@ tilt_settings_file = "./tilt-settings.yaml" settings = read_yaml(tilt_settings_file) +# Setup a development registry so we can push images to it +# and use them to test the scanner. +k8s_yaml('./hack/registry.yaml') + +k8s_resource( + 'dev-registry', + port_forwards=5000, +) + # Create the sbombastic namespace # This is required since the helm() function doesn't support the create_namespace flag load("ext://namespace", "namespace_create") diff --git a/examples/registry.yaml b/examples/registry.yaml index f62317f..1216ffc 100644 --- a/examples/registry.yaml +++ b/examples/registry.yaml @@ -4,4 +4,4 @@ metadata: name: my-first-registry namespace: default spec: - uri: docker-registry.default.svc.cluster.local + uri: dev-registry.default.svc.cluster.local:5000 diff --git a/hack/registry.yaml b/hack/registry.yaml new file mode 100644 index 0000000..e6daba0 --- /dev/null +++ b/hack/registry.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Pod +metadata: + name: dev-registry + namespace: default + labels: + app: dev-registry +spec: + containers: + - name: registry + image: registry:2.8.3 + ports: + - containerPort: 5000 + name: http +--- +apiVersion: v1 +kind: Service +metadata: + name: dev-registry + namespace: default +spec: + selector: + app: dev-registry + ports: + - protocol: TCP + port: 5000 + targetPort: http