Add Kubernetes deployment, service, ingress, and namespace configurations

This commit is contained in:
2025-10-02 14:20:05 +08:00
parent cf8ebd01d3
commit a258431020
5 changed files with 381 additions and 0 deletions

29
script/k8s/service.yaml Normal file
View File

@@ -0,0 +1,29 @@
# Kubernetes Service Configuration
# Service exposes pods to network traffic within the cluster
apiVersion: v1
kind: Service
metadata:
# Name of the service
name: ${CONTAINER_IMAGE_NAME}
# Namespace where service will be created
namespace: ${KUBERNETES_NAMESPACE}
labels:
app: ${CONTAINER_IMAGE_NAME}
spec:
# Type of service - ClusterIP is internal only
type: ClusterIP
# Service will route traffic to pods with these labels
selector:
app: ${CONTAINER_IMAGE_NAME}
# Port mapping
ports:
- name: http
# Port that service listens on
port: 80
# Port on the pod that receives traffic
targetPort: http
# Protocol to use
protocol: TCP