From 1d0148267aa66e13a80884f7f9599eef255ba29b Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 10 Dec 2025 07:47:41 +0100 Subject: [PATCH] feat: add local proxy configuration for development Adds local proxy configuration to facilitate traffic routing from the KinD cluster to the host machine for local development. Includes definitions for frontend and API services, allowing for easier access during development. This change enhances the development workflow and simplifies testing. --- kind/kustomization.yaml | 1 + kind/local-proxy.yaml | 71 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 kind/local-proxy.yaml diff --git a/kind/kustomization.yaml b/kind/kustomization.yaml index ecbd99b..34909ea 100644 --- a/kind/kustomization.yaml +++ b/kind/kustomization.yaml @@ -6,6 +6,7 @@ resources: - namespaces.yaml - certificates.yaml - secrets-store.yaml +- local-proxy.yaml helmCharts: - name: external-secrets namespace: external-secrets diff --git a/kind/local-proxy.yaml b/kind/local-proxy.yaml new file mode 100644 index 0000000..1c48861 --- /dev/null +++ b/kind/local-proxy.yaml @@ -0,0 +1,71 @@ +# Local development proxy configuration +# Proxies traffic from KinD cluster to host machine for local development +# +# Add to /etc/hosts: +# 192.168.228.2 staging-shiny.unbound.se staging-shiny-api.unbound.se +# +# Apply with: kubectl apply -f local-proxy.yaml +# Delete with: kubectl delete -f local-proxy.yaml + +--- +# Frontend proxy (port 3300) +apiVersion: v1 +kind: Service +metadata: + name: frontend-external +spec: + type: ExternalName + externalName: host.docker.internal + ports: + - port: 3300 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: frontend + annotations: + nginx.ingress.kubernetes.io/upstream-vhost: "localhost:3300" +spec: + ingressClassName: nginx + rules: + - host: staging-shiny.unbound.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: frontend-external + port: + number: 3300 +--- +# API proxy (port 4444) +apiVersion: v1 +kind: Service +metadata: + name: api-external +spec: + type: ExternalName + externalName: host.docker.internal + ports: + - port: 4444 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: api + annotations: + nginx.ingress.kubernetes.io/upstream-vhost: "localhost:4444" +spec: + ingressClassName: nginx + rules: + - host: staging-shiny-api.unbound.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: api-external + port: + number: 4444 -- 2.52.0