Hi Devs, In Kubernetes API client we have used following methods to create replication controllers, services and pods:
*createReplicationController(ReplicationController replicationController)* *createService(Service service)* *createPod(Pod pod)* Replication controller creation process involves series of steps before invoking the createReplicationController() method: - Create replication controller definition - Set replication controller state - Create pod template - Create container template - Set container ports - Set pod template labels - Set replication controller labels - Invoke the api to create the replicate controller: createReplicationController(ReplicationController replicationController) Due to this complexity unit/live tests may implement this logic differently than the actual Kubernetes implementation in the cloud controller. As s result we may not be able to guarantee that if unit/live tests passes the logic in cloud controller works similarly. The same applies to createService() and createPod() methods. Due to the above reason I have moved this logic into the Kubernetes API client and exposed below methods so that both tests and cloud controller behaves the same: *createPod(String podId, String podName, String dockerImage, List<Integer> containerPorts)* *createService(String serviceId, String serviceName, int servicePort, int containerPort, String publicIp)* *createPod(String podId, String podName, String dockerImage, List<Integer> containerPorts)* Thanks -- Imesh Gunaratne Technical Lead, WSO2 Committer & PMC Member, Apache Stratos