# How to specify whether the application must be deployment or statefulset

**URL:** <https://community.okteto.com/t/how-to-specify-whether-the-application-must-be-deployment-or-statefulset/279>\
**Category:** How Do I?\
**Created:** [October 3, 2022, 6:17am UTC](https://community.okteto.com/t/how-to-specify-whether-the-application-must-be-deployment-or-statefulset/279 "2022-10-03T06:17:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashkundar](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ashkundar/32/97_2.png) [@ashkundar](https://community.okteto.com/u/ashkundar)\
**Post date:** [October 3, 2022, 6:17am UTC](https://community.okteto.com/t/how-to-specify-whether-the-application-must-be-deployment-or-statefulset/279/1 "2022-10-03T06:17:03Z")

</div>

I have been deploying my application to okteto dev namespace using docker compose yaml…  
But the services are getting deployed as statefulset most of the time…  
How can I deploy them as deployment instead of statefulsets.  
Since my application uses same pvc for sharing the data, scaling stateful set is failing…

---

<div class="post-metadata">

**Author:** ![AgustinRamiroDiaz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/agustinramirodiaz/32/34_2.png) [@AgustinRamiroDiaz](https://community.okteto.com/u/AgustinRamiroDiaz)\
**Post date:** [October 3, 2022, 10:45am UTC](https://community.okteto.com/t/how-to-specify-whether-the-application-must-be-deployment-or-statefulset/279/2 "2022-10-03T10:45:01Z")

</div>

Hi ashkundar! I’m not sure I follow. Can you submit your `docker-compose.yml`?

If you have defined the [volumes section](https://www.okteto.com/docs/reference/compose/#volumes-object-optional), Okteto infers that your service must be deployed as a statefulset

---

<div class="post-metadata">

**Author:** ![ashkundar](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ashkundar/32/97_2.png) [@ashkundar](https://community.okteto.com/u/ashkundar)\
**Post date:** [October 3, 2022, 1:29pm UTC](https://community.okteto.com/t/how-to-specify-whether-the-application-must-be-deployment-or-statefulset/279/3 "2022-10-03T13:29:07Z")

</div>

Yes i have defined a volume with 5GiB and mounted to the 3 services…  
All the 3 services are deployed as statefulset  
Is there any way around (okteto inferring as statefulset), because stateful set require their own pvcs…

---

<div class="post-metadata">

**Author:** ![AgustinRamiroDiaz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/agustinramirodiaz/32/34_2.png) [@AgustinRamiroDiaz](https://community.okteto.com/u/AgustinRamiroDiaz)\
**Post date:** [October 3, 2022, 1:43pm UTC](https://community.okteto.com/t/how-to-specify-whether-the-application-must-be-deployment-or-statefulset/279/4 "2022-10-03T13:43:42Z")

</div>

Can you explain a bit more about the use case? Okteto transforms services with volumes into statefulsets to guarantee no data loss across redeploys.

If your services need to store information in volumes, why wouldn’t they be statefulsets?
