0
votes

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
No, we need to create Kubernetes service separatelyRajesh Gupta
could you please point to a doc that say openshift DeploymentConfig create the service for all the container ports or if you could elaborate what is it that you mean.Tarun Khosla

2 Answers

1
votes

Both Deployment and DeploymentConfig does not create the Service component in OpenShift. These component are used for creation of Replication Control of the Pod.

Service has to be configured separately with the selector parameter to point to the specific Pods.

selector: name: as in the deployment or in deploymentConfig.

This link would help you on the same.

https://docs.openshift.com/container-platform/3.3/dev_guide/deployments/how_deployments_work.html#creating-a-deployment-configuration

0
votes

Deployment and service are different kubernetes objects. Deployment doesnt automatically 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/