Add Kubernetes deployment, service, ingress, and namespace configurations
This commit is contained in:
29
script/k8s/service.yaml
Normal file
29
script/k8s/service.yaml
Normal 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
|
||||
Reference in New Issue
Block a user