The trend of economy globalization leads to a more competitive environment for companies to survive. In particular, in a customer-centric market, the customers' expectation on product quality and order fulfillments becomes even higher. At the same time, the uncertainties existed in supply and demand make the decisions of capacity planning more difficult to execute than ever before. From the perspective of order fulfillments, this paper explores capacity planning and allocation policies for a multi-location production system with random yield loss and uncertain demand. Specifically, we propose to investigate the capacity allocation mechanism that can satisfy different requirements of fill rates and cost constraints in the production network. We introduce a two-stage online gradient descent algorithm to solve the optimal capacity configuration problem. In addition, we provide the safe ranges of optimal capacities via a distributionally robust optimization method which allow us to only possess a limited distribution information. The results show that the firm's capacity decisions are dependent of both cost and fill rate constraints. We prove that long chains or 3-chains are almost as good as fully flexible networks, i.e., partial flexibility can effectively mitigate the risks, even under a bilateral uncertainty from supply and demand. Finally, numerical experiments are conducted to further deliver some insights for practitioners.