Homebrew install specific version of formula?

  1. Go to homebrew git repo: https://github.com/Homebrew/homebrew-core/
  2. Identify the commit specific to kubernetes 1.11.x version
  3. Go to Formula folder
  4. Open raw version of kubernetes-cli.rb file
  5. Copy the raw link of the file https://raw.githubusercontent.com/Homebrew/homebrew-core/3e8f5503dde7069c5ff49b82d5e1576e6ebe3a5d/Formula/kubernetes-cli.rb
  6. Run brew install <raw_link>

I dont have enough rep to make a comment on the answer that helped me. So writing here to be more specific about point 2 from @urpalreloaded

  1. brew search --pull-request [email protected]
  2. It will say that it did not find the cask but should give you a link to a closed pull request that matches the version you searched for. Follow the link to the pull request and the follow steps 3-5.
  3. brew unlink kubernetes-cli
  4. brew install <raw-link>

FWIW, I think brew doesnt keep versions because it will make the repo too big? This workaround is inconvenient and perhaps they could find a way around this issue on their end?