Kubernetes handles upgrades and versioning of microservices by providing built-in features for rolling updates and canary releases. These features enable microservices to be updated and rolled out gradually across the system, reducing the risk of downtime and ensuring smooth and reliable updates.