Skip to main content

Create Services

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

In Kubernetes (commonly abbreviated as K8s), a Service is a resource object used to expose and provide access to applications. 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, 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:
Create a Deployment to manage the application's Pods.
Create a Service to expose those Pods.

Example:

#Service exposure in VKS (Virtual Kubernetes Services)
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