The agreement was first reported by The Athletic.
Gallardo was 5-10 with a 5.72 ERA in 28 games (22 starts) with the Seattle Mariners last season.
Seattle declined an option on Gallardo in November, making him a free agent.
The 31-year-old Gallardo spent the first eight seasons of his career with the Brewers before one-year stays with the Texas Rangers, Baltimore Orioles and Mariners. He has a career record of 113-93 with a 3.93 ERA.