Adhesion robots have broad application prospects in the field of spacecraft inspection, repair, and maintenance, but the stable adhesion and climbing on the flexible surface covering the spacecraft has not been achieved. The flexible surface is easily deformed when subjected to external force, which makes it difficult to ensure a sufficient contact area and then detach from it. To achieve stable attachment and easy detachment on the flexible surface under microgravity, an adhesion model is established based on the applied adhesive material, and the relationship between peeling force and the rigidity of the base material, peeling angle, and working surface stiffness is obtained. Combined with the characteristics of variable stiffness structure, the adhesion and detachment force of the foot is asymmetric. Inspired by the adhesion-detachment mechanism of the foot of the gecko, an active adhesion-detachment control compliant mechanism is designed to achieve the stable attachment and safe detachment of the foot on the flexible surface and to adapt to surfaces with different rigidity. The experimental results indicate that a maximum normal adhesion force of 7.66 N can be generated when fully extended, and the safe detachment is achieved without external force on a flexible surface. Finally, an air floating platform is used to build a microgravity environment, and the crawling experiment of a gecko-inspired robot on a flexible surface under microgravity is completed. The experimental results show that the gecko-inspired foot with variable stiffness can satisfy the requirements of stable crawling on flexible surfaces.