This commit is contained in:
ahmza committed 2026-10-31 20:41:04 +00:00
1 parent 0af896ab02
commit 6752379d80
7 files changed
+300

No files matched your search

+78
View File
@@ -0,0 +1,78 @@
# Hugo generates the complete site at image-build time. SWS serves only those
# immutable files, with no writable content volume or Kubernetes API access.
apiVersion: apps/v1
kind: Deployment
metadata:
name: blog
namespace: blog-ahmza-com
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
# Keep the existing site available while replacement Pods become ready.
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app: blog
template:
metadata:
labels:
app: blog
spec:
automountServiceAccountToken: false
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
# Ignore tainted control-plane nodes when balancing the two workers;
# otherwise a surge Pod could be blocked by an unusable third node.
nodeTaintsPolicy: Honor
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: blog
securityContext:
seccompProfile:
type: RuntimeDefault
containers:
- name: blog
# Bootstrap with the verified published amd64/arm64 index. CI updates
# this line to each build's digest, never a mutable latest tag.
# yamllint disable-line rule:line-length
image: tea.ahmza.com/ahmza/blog-ahmza-com@sha256:25dce7a45c8869879bbb6f056b3e4d18971c7da542255867ad83f1db26ffefc3
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 80
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
# SWS does not declare USER in the image. An explicit unprivileged
# identity lets Kubernetes enforce runAsNonRoot safely.
runAsUser: 10001
runAsGroup: 10001
capabilities:
drop:
- ALL
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 2
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 30
resources:
requests:
cpu: 10m
memory: 16Mi
limits:
cpu: 250m
memory: 128Mi
+27
View File
@@ -0,0 +1,27 @@
# Share ingress-nginx at 10.10.60.12. DNS and any external Caddy/NetBird
# hostname routing must also be pointed at this ingress before public cutover.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: blog
namespace: blog-ahmza-com
annotations:
# Reuse the production DNS-01 issuer already used by the cluster's sites.
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
ingressClassName: nginx
tls:
- hosts:
- blog.ahmza.com
secretName: blog-tls
rules:
- host: blog.ahmza.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: blog
port:
name: http
+5
View File
@@ -0,0 +1,5 @@
# Isolate the blog's lifecycle and access controls from unrelated applications.
apiVersion: v1
kind: Namespace
metadata:
name: blog-ahmza-com
+15
View File
@@ -0,0 +1,15 @@
# A stable in-cluster address for ingress-nginx; no extra MetalLB IP is needed.
apiVersion: v1
kind: Service
metadata:
name: blog
namespace: blog-ahmza-com
spec:
type: ClusterIP
selector:
app: blog
ports:
- name: http
port: 80
targetPort: http
protocol: TCP