Multitenancy allows multiple tenants to access a single instance of a cloud offering. While several approaches exist for implementing multitenancy, little attention has been paid to implementing the required degree of isolation since there are varying degrees of isolation that can be implemented for each tenant. This paper presents a framework for achieving the required degree of isolation between tenants accessing a cloud offering so that the required performance, resource utilisation and access privilege of one tenant does not affect other tenants when there are workload changes. The framework is composed of two main constituents: 1) component-based approach to multitenancy isolation through request re-routing (COMITRE); 2) an optimisation model for providing optimal solutions for deploying components of a cloud-hosted service. We demonstrate using a case study of: 1) a cloud-hosted bug tracking system; 2) a synthetic dataset, the possibility of providing the required degree of isolation and optimal deployment solutions.