Skip to main content

Create Services

Updated at: 2025-11-19 12:00:25

In Kubernetes (K8s), a Service is a resource used to expose applications and provide network access to them. A Service offers a stable network endpoint that allows both internal and external clients to access applications running inside Pods. Using a selector, a Service routes traffic to backend Pods and provides load balancing and service discovery capabilities. In the Virtual Kubernetes Services (VKS), Services are only accessible within the cluster. To enable external access, you need to Publish Service to the public network.

Deploy Service

Deploying a Service in Kubernetes typically involves two main steps:

Example:

#Service exposure in VKS
apiVersion: v1
kind: Service
metadata:
name: your-service-name
namespace: your-namespace
spec:
selector:
app: your-app-name # Label value of the target Pod(s)
type: ClusterIP
ports:
- port: 8000 # Service port
protocol: TCP
targetPort: 8000 # Container port inside the Pod