Creating a Service
POST {{kube-api-server}}/api/v1/namespaces/default/services?fieldManager=kubectl-client-side-apply
Let's check the request body for this request.
Selectors: The selectors help the service map to the pods that have the matching label.
Exposing: Services can be exposed within the cluster for other services(frontend) to access the pods or outside the cluster for the public to access the service. By default a service would be of ClusterIP type (this would expose the service inside the cluster). We want to expose this externally, so we chose the LoadBalancer type.
Send and view the Visualization tab. You should see a congratulations message 👏🏻

Request Params
Key | Datatype | Required | Description |
---|---|---|---|
fieldManager | string |
Request Body
{"apiVersion"=>"v1", "kind"=>"Service", "metadata"=>{"name"=>"{{project-name}}-service"}, "spec"=>{"type"=>"LoadBalancer", "selector"=>{"app"=>"{{project-name}}-pod"}, "ports"=>[{"protocol"=>"TCP", "port"=>4444, "targetPort"=>4444}]}}