You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Imesh Gunaratne <im...@apache.org> on 2014/12/24 19:29:53 UTC

[Discuss] Kubernetes API Client Methods Updated

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

Re: [Discuss] Kubernetes API Client Methods Updated

Posted by Imesh Gunaratne <im...@apache.org>.
*createReplicationController(String replicationControllerId, String
replicationControllerName,*
*                                            String dockerImage,
List<Integer> containerPorts,*
*                                            EnvironmentVariable[]
environmentVariables, int replicas)*

On Wed, Dec 24, 2014 at 11:59 PM, Imesh Gunaratne <im...@apache.org> wrote:

> 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
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos