This paper is concerned with a chemotaxis-fluid model with realistic boundary conditions matching the experiments of Kessler et al. Different from the initial and boundary value problem, the existence of time periodic solution is proved under no any smallness assumptions on chemotactic coefficient. Subsequently, we investigate the reason of pattern formation. It is generally known that there is no pattern formation for the homogeneous boundary value problem. Therefore, the pattern formation is partly caused by non-homogeneous boundary conditions, but chemotaxis is also an indispensable condition. In fact, it is proved that the density of bacteria will tend to be evenly distributed when the chemotactic intensity tends to 0. At last, the idea of finding time periodic pattern is also applied to prove the steady-state pattern formation of chemotaxis-Navier-Stokes model.