Karnataka agrees to give Tamil Nadu Water