The k-essence theory with a power-law function of (∂ϕ) 2 and Rastall’s non-conservative theory of gravity with a scalar field are shown to have the same solutions for the metric under the assumption that both the metric and the scalar fields depend on a single coordinate. This equivalence (called k–R duality) holds for static configurations with various symmetries (spherical, plane, cylindrical, etc.) and all homogeneous cosmologies. In the presence of matter, Rastall’s theory requires additional assumptions on how the stress-energy tensor non-conservation is distributed between different contributions. Two versions of such non-conservation are considered in the case of isotropic spatially flat cosmological models with a perfect fluid: one (R1) in which there is no coupling between the scalar field and the fluid, and another (R2) in which the fluid separately obeys the usual conservation law. In version R1 it is shown that k–R duality holds not only for the cosmological models themselves but also for their adiabatic perturbations. In version R2, among other results, a particular model is singled out that reproduces the same cosmological expansion history as the standard Λ CDM model but predicts different behaviors of small fluctuations in the k-essence and Rastall frameworks. © 2017, The Author(s).