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:
parent
a7ba0a9dd6
commit
0442f6cde7
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,3 @@
|
||||
skaffold.yaml
|
||||
|
||||
# terraform
|
||||
*.tfstate*
|
||||
.terraform
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: gateway
|
||||
labels:
|
||||
app: gateway
|
||||
@ -19,7 +20,7 @@ spec:
|
||||
- name: gitea-registry
|
||||
containers:
|
||||
- name: gateway
|
||||
image: git.homelab.local/homelab/gateway:latest
|
||||
image: homelab/gateway
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: gateway-home
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.middlewares: auth-forward-auth@kubernetescrd
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: gateway
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: forward-auth
|
||||
spec:
|
||||
forwardAuth:
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: gateway
|
||||
labels:
|
||||
app: gateway
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: gateway
|
||||
labels:
|
||||
release: kps
|
||||
|
||||
28
apps/auth/services/gateway/skaffold.yaml
Normal file
28
apps/auth/services/gateway/skaffold.yaml
Normal 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: {}
|
||||
@ -2,6 +2,7 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: users
|
||||
labels:
|
||||
app: users
|
||||
@ -19,7 +20,7 @@ spec:
|
||||
- name: gitea-registry
|
||||
containers:
|
||||
- name: users
|
||||
image: git.homelab.local/homelab/users:latest
|
||||
image: homelab/users
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: users
|
||||
labels:
|
||||
app: users
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
namespace: auth
|
||||
name: users
|
||||
labels:
|
||||
release: kps
|
||||
|
||||
28
apps/auth/services/users/skaffold.yaml
Normal file
28
apps/auth/services/users/skaffold.yaml
Normal 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: {}
|
||||
@ -19,7 +19,7 @@ spec:
|
||||
- name: gitea-registry
|
||||
containers:
|
||||
- name: api
|
||||
image: git.homelab.local/admin/finance-api:latest
|
||||
image: homelab/finance-api
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
|
||||
28
apps/finance/services/api/skaffold.yaml
Normal file
28
apps/finance/services/api/skaffold.yaml
Normal 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: {}
|
||||
@ -20,7 +20,7 @@ spec:
|
||||
- name: gitea-registry
|
||||
containers:
|
||||
- name: example-service
|
||||
image: git.homelab.local/homelab/example-service:latest
|
||||
image: homelab/example-service
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
|
||||
28
apps/test/services/example-service/skaffold.yaml
Normal file
28
apps/test/services/example-service/skaffold.yaml
Normal 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
20
skaffold.yaml
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user