Add initial Kubernetes deployment setup with GitHub Actions workflow, Dockerfile, and necessary Kubernetes manifests

This commit is contained in:
2025-10-01 13:51:33 +08:00
parent 24154f42d4
commit 00c02e8393
8 changed files with 471 additions and 0 deletions

46
k8s/deployment.yaml Normal file
View File

@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: www-cialloo-com
namespace: www-cialloo-com-{{ENVIRONMENT}}
labels:
app: www-cialloo-com
environment: {{ENVIRONMENT}}
spec:
replicas: 2
selector:
matchLabels:
app: www-cialloo-com
environment: {{ENVIRONMENT}}
template:
metadata:
labels:
app: www-cialloo-com
environment: {{ENVIRONMENT}}
spec:
containers:
- name: www-cialloo-com
image: {{IMAGE_NAME}}:{{IMAGE_TAG}}
ports:
- containerPort: 80
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "100m"
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 5
imagePullSecrets:
- name: docker-registry-secret

23
k8s/ingress.yaml Normal file
View File

@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: www-cialloo-com-ingress
namespace: www-cialloo-com-{{ENVIRONMENT}}
labels:
app: www-cialloo-com
environment: {{ENVIRONMENT}}
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
ingressClassName: traefik
rules:
- host: www.cialloo.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: www-cialloo-com-service
port:
number: 80

7
k8s/namespace.yaml Normal file
View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: www-cialloo-com-{{ENVIRONMENT}}
labels:
app: www-cialloo-com
environment: {{ENVIRONMENT}}

17
k8s/service.yaml Normal file
View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: www-cialloo-com-service
namespace: www-cialloo-com-{{ENVIRONMENT}}
labels:
app: www-cialloo-com
environment: {{ENVIRONMENT}}
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
selector:
app: www-cialloo-com
environment: {{ENVIRONMENT}}