feat: add Skaffold for local k3d development

- Root skaffold.yaml composes all services; local profile auto-activates
  on k3d-homelab context (push: false, k3d image import); ci profile
  pushes to registry with git-commit tags
- Per-service skaffold.yaml for per-service dev (run from service dir)
- Add finance-api skaffold.yaml (was missing)
- Deployment images use bare name (homelab/<svc>) — Skaffold substitutes
  the correct tagged image; no registry prefix needed for local dev
- Add namespace: auth to all auth service manifests
- Remove skaffold.yaml from .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gonçalo Rodrigues 2026-06-20 16:30:24 +01:00
parent a7ba0a9dd6
commit 0442f6cde7
17 changed files with 145 additions and 6 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
skaffold.yaml
# terraform # terraform
*.tfstate* *.tfstate*
.terraform .terraform

View File

@ -2,6 +2,7 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
namespace: auth
name: gateway name: gateway
labels: labels:
app: gateway app: gateway
@ -19,7 +20,7 @@ spec:
- name: gitea-registry - name: gitea-registry
containers: containers:
- name: gateway - name: gateway
image: git.homelab.local/homelab/gateway:latest image: homelab/gateway
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- name: http - name: http

View File

@ -1,6 +1,7 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
namespace: auth
name: gateway-home name: gateway-home
annotations: annotations:
traefik.ingress.kubernetes.io/router.middlewares: auth-forward-auth@kubernetescrd traefik.ingress.kubernetes.io/router.middlewares: auth-forward-auth@kubernetescrd

View File

@ -1,6 +1,7 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
namespace: auth
name: gateway name: gateway
spec: spec:
ingressClassName: traefik ingressClassName: traefik

View File

@ -1,6 +1,7 @@
apiVersion: traefik.io/v1alpha1 apiVersion: traefik.io/v1alpha1
kind: Middleware kind: Middleware
metadata: metadata:
namespace: auth
name: forward-auth name: forward-auth
spec: spec:
forwardAuth: forwardAuth:

View File

@ -2,6 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
namespace: auth
name: gateway name: gateway
labels: labels:
app: gateway app: gateway

View File

@ -1,6 +1,7 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
namespace: auth
name: gateway name: gateway
labels: labels:
release: kps release: kps

View File

@ -0,0 +1,28 @@
apiVersion: skaffold/v4beta13
kind: Config
metadata:
name: gateway
build:
artifacts:
- image: homelab/gateway
context: ../../../../
docker:
dockerfile: apps/auth/services/gateway/Dockerfile
manifests:
rawYaml:
- k8s/*.yaml
deploy:
kubectl: {}
profiles:
- name: local
activation:
- kubeContext: k3d-homelab
build:
local:
push: false
- name: ci
build:
local:
push: true
tagPolicy:
gitCommit: {}

View File

@ -2,6 +2,7 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
namespace: auth
name: users name: users
labels: labels:
app: users app: users
@ -19,7 +20,7 @@ spec:
- name: gitea-registry - name: gitea-registry
containers: containers:
- name: users - name: users
image: git.homelab.local/homelab/users:latest image: homelab/users
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- name: http - name: http

View File

@ -2,6 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
namespace: auth
name: users name: users
labels: labels:
app: users app: users

View File

@ -1,6 +1,7 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
namespace: auth
name: users name: users
labels: labels:
release: kps release: kps

View File

@ -0,0 +1,28 @@
apiVersion: skaffold/v4beta13
kind: Config
metadata:
name: users
build:
artifacts:
- image: homelab/users
context: ../../../../
docker:
dockerfile: apps/auth/services/users/Dockerfile
manifests:
rawYaml:
- k8s/*.yaml
deploy:
kubectl: {}
profiles:
- name: local
activation:
- kubeContext: k3d-homelab
build:
local:
push: false
- name: ci
build:
local:
push: true
tagPolicy:
gitCommit: {}

View File

@ -19,7 +19,7 @@ spec:
- name: gitea-registry - name: gitea-registry
containers: containers:
- name: api - name: api
image: git.homelab.local/admin/finance-api:latest image: homelab/finance-api
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- name: http - name: http

View File

@ -0,0 +1,28 @@
apiVersion: skaffold/v4beta13
kind: Config
metadata:
name: finance-api
build:
artifacts:
- image: homelab/finance-api
context: ../../../../
docker:
dockerfile: apps/finance/services/api/Dockerfile
manifests:
rawYaml:
- k8s/*.yaml
deploy:
kubectl: {}
profiles:
- name: local
activation:
- kubeContext: k3d-homelab
build:
local:
push: false
- name: ci
build:
local:
push: true
tagPolicy:
gitCommit: {}

View File

@ -20,7 +20,7 @@ spec:
- name: gitea-registry - name: gitea-registry
containers: containers:
- name: example-service - name: example-service
image: git.homelab.local/homelab/example-service:latest image: homelab/example-service
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- name: http - name: http

View File

@ -0,0 +1,28 @@
apiVersion: skaffold/v4beta13
kind: Config
metadata:
name: example-service
build:
artifacts:
- image: homelab/example-service
context: ../../../../
docker:
dockerfile: apps/test/services/example-service/Dockerfile
manifests:
rawYaml:
- k8s/*.yaml
deploy:
kubectl: {}
profiles:
- name: local
activation:
- kubeContext: k3d-homelab
build:
local:
push: false
- name: ci
build:
local:
push: true
tagPolicy:
gitCommit: {}

20
skaffold.yaml Normal file
View File

@ -0,0 +1,20 @@
apiVersion: skaffold/v4beta13
kind: Config
metadata:
name: homelab
requires:
- path: apps/auth/services/gateway
configs: [gateway]
- path: apps/auth/services/users
configs: [users]
- path: apps/test/services/example-service
configs: [example-service]
- path: apps/finance/services/api
configs: [finance-api]
profiles:
- name: local
activation:
- kubeContext: k3d-homelab
- name: ci