Files
tech-log-frontend/deploy/production/network-policies.yaml
T
DongHyeonka 23e230e368 chore(deploy): 운영 hyeonworks.com 매니페스트를 지금 상태 그대로 기록한다
hyeonworks-prod의 앱 객체는 kubectl apply로만 들어가 있고 어느 repo에도
정본이 없다. 그래서 무엇이 운영에 떠 있는지 Git으로 볼 수 없고, 이미지나
설정을 바꿀 때 기준이 되는 파일도 없다.

live 객체 16개를 deploy/production에 그대로 옮긴다. backend·frontend·redis
Deployment, Service 넷, ServiceMonitor, logging ConfigMap, Ingress,
NetworkPolicy 여섯이다. 각 객체의 last-applied 설정을 쓰고, 서버가 채우는
칸(uid, resourceVersion, status, clusterIP 등)은 뺐다. 정본 위치는 소유자
결정(2026-11-11, 「앱 쪽은 tech-log repo deploy/」)을 따른다.
Namespace, techlog DB Role·Database, 다른 namespace의 NetworkPolicy·Probe·
규칙은 platform-core services/tenants/techlog가 맡는다.
hyeonworks-secrets Secret은 Git에 두지 않는다.

위험·한계: 동작은 바뀌지 않는다. 운영 source commit(frontend 7a4e201,
backend 46b1cc7)은 아직 Gitea에 없어서, 이 파일들이 가리키는 이미지를 이
repo의 main에서 다시 만들 수는 없다.

검증: kubectl kustomize deploy/production을 live 클러스터에 대고
kubectl diff를 돌렸다. 16개 객체 모두 차이가 0줄이다. 값을 하나씩 보고
비밀 값은 secretKeyRef 참조뿐인 것을 확인했다.
2026-11-12 07:33:12 +09:00

162 lines
3.2 KiB
YAML

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: techlog-backend-egress
spec:
egress:
- ports:
- port: 5432
protocol: TCP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: platform-data
podSelector:
matchLabels:
cnpg.io/cluster: platform-postgres
- ports:
- port: 9000
protocol: TCP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: object-storage
podSelector:
matchLabels:
aistor.min.io/objectStore: minio-aistor
- ports:
- port: 6379
protocol: TCP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: hyeonworks-prod
podSelector:
matchLabels:
app: redis
- ports:
- port: 443
protocol: TCP
to:
- ipBlock:
cidr: 192.168.0.107/32
podSelector:
matchLabels:
app: techlog-backend
policyTypes:
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: techlog-backend-ingress
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
app.kubernetes.io/name: traefik
ports:
- port: 8080
protocol: TCP
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: observability
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: observability
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus-blackbox-exporter
ports:
- port: 9001
protocol: TCP
podSelector:
matchLabels:
app: techlog-backend
policyTypes:
- Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: techlog-default-deny
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: techlog-dns-egress
spec:
egress:
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
podSelector: {}
policyTypes:
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: techlog-frontend-ingress
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
app.kubernetes.io/name: traefik
ports:
- port: 80
protocol: TCP
podSelector:
matchLabels:
app: techlog-frontend
policyTypes:
- Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: techlog-redis-ingress
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: hyeonworks-prod
podSelector:
matchLabels:
app: techlog-backend
ports:
- port: 6379
protocol: TCP
podSelector:
matchLabels:
app: redis
policyTypes:
- Ingress