<p>This is first time I am using statefulsets in openshift and would like to understand how do you expose the services to outside world? Do you create two services headless and another normal one? How to get this working?</p>

user2636464
<p>It depends on your use case and what you are planning for.</p>
<p>If you are expecting your service to forward a request to any of the available <strong>POD</strong> of <strong>statefulset</strong> you can create a normal <strong>clusterIP</strong> service.</p>
<p>You have the requirement of getting specific <strong>DNS</strong> records or You need the <strong>IP</strong> of each available <strong>POD</strong> <strong>headless</strong> (with selector) service will do it for you.</p>
<p>There is also <strong>headless service</strong> without <strong>selector</strong> could be used with <strong>Endpointslice</strong> to forward traffic to other or <strong>External</strong> thrid party services.</p>
<p>Ref : <a href="https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors</a></p>
