Does kubernetes Deployment automatically create the service like openshift DeploymentConfig does?

Viewed 511

I created a deployment using kubernetes Deployment in openshift cluster. i expected it to create the service for all the container ports like openshift DeploymentConfig does. but i did not find any service created by the kubernetes Deployment.

does kubernetes Deployment not create the service automatically like openshift DeploymentConfig does ?

My openshift version is 3.11

2 Answers

Deployment and service are different kubernetes objects. Deployment doesnt automatically create service object. you need to define service definition in a YAML targeting the ports from the pod definition inside deployment manifests. You need to deploy both deployment and service objects. you can deploy then separately or bundle them together in a single YAML and deploy.

Further details follow the link --> https://kubernetes.io/docs/concepts/services-networking/service/

Related