How to test your code with Kubernetes

217 views
Skip to first unread message

Rami Shalom

unread,
Sep 9, 2017, 6:34:06 PM9/9/17
to Kubernetes user discussion and Q&A

Hi all, I am looking for ways to test my code before going through the cycles of integration tests in CI. 

The code i'm working on is part of a bigger project, 40-50 containers, some are Java based (memory consumption can be high); 


I can unit-test my code but it's out of the application context so it gets me so far. 

Run time of the entire application may be too long and require a lot of resources for me (others) to run quick code change cycles and test every change. 


I tried to "minimize" the app and used Minikube but it does not scale high enough for the tests i need to run. 


What other alternatives are available if the test requires more than one kubernetes node, or the load is greater than what a laptop can hold in a single node (which is what Minikube lets you run)?


Thanks.

Timo Reimann

unread,
Sep 10, 2017, 6:27:39 AM9/10/17
to Kubernetes user discussion and Q&A
FWIW, there's Mirantis' kubeadm-dind-cluster which lets you run a containerized version of a Kubernetes cluster on a single machine: https://github.com/Mirantis/kubeadm-dind-cluster

Itamar O

unread,
Sep 10, 2017, 6:44:58 AM9/10/17
to Kubernetes user discussion and Q&A
One option would be to have the entire project running on k8s, and just "swap in" the container you're developing locally (in place of the one on k8s), using Telepresence: https://www.telepresence.io/tutorials/kubernetes-rapid

On Sun, Sep 10, 2017 at 1:27 PM 'Timo Reimann' via Kubernetes user discussion and Q&A <kubernet...@googlegroups.com> wrote:
FWIW, there's Mirantis' kubeadm-dind-cluster which lets you run a containerized version of a  Kubernetes cluster on a single machine: https://github.com/Mirantis/kubeadm-dind-cluster

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Rodrigo Campos

unread,
Sep 10, 2017, 10:49:03 AM9/10/17
to kubernet...@googlegroups.com
Although Kubernetes can be involved, I think testing should also work as if you are not using Kubernetes. How did you test these before Kubernetes?

But one trick you can try in Kubernetes is minikube for the app you are running and a service type external pointing to the URL the other apps are running in some cluster.

But again, this, for example, shouldn't be different than doing normal deployment and just point to some other place to consume other applications (if your pod is really simple).
--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.

Rami Shalom

unread,
Sep 10, 2017, 5:36:13 PM9/10/17
to kubernet...@googlegroups.com
Thanks much for all the responses. Very helpful. So far I have tested not using K8s, it's now that would like to align my Dev process with the way things will run in prod. 
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/gzqu6UELsBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.

Mark Maglana

unread,
Sep 10, 2017, 5:58:38 PM9/10/17
to kubernet...@googlegroups.com
If you already have end-to-end (or similar) tests in place, it shouldn't have to change. What would change in your CI/CD pipeline is the part that deploys your app. Other parts remain the same.
On Sun, Sep 10, 2017 at 2:36 PM Rami Shalom <rami....@gmail.com> wrote:
Thanks much for all the responses. Very helpful. So far I have tested not using K8s, it's now that would like to align my Dev process with the way things will run in prod. 

On Sep 10, 2017, at 7:48 AM, Rodrigo Campos <rodr...@gmail.com> wrote:

Although Kubernetes can be involved, I think testing should also work as if you are not using Kubernetes. How did you test these before Kubernetes?

But one trick you can try in Kubernetes is minikube for the app you are running and a service type external pointing to the URL the other apps are running in some cluster.

But again, this, for example, shouldn't be different than doing normal deployment and just point to some other place to consume other applications (if your pod is really simple).

On Saturday, September 9, 2017, Rami Shalom <rami....@gmail.com> wrote:

Hi all, I am looking for ways to test my code before going through the cycles of integration tests in CI. 

The code i'm working on is part of a bigger project, 40-50 containers, some are Java based (memory consumption can be high); 


I can unit-test my code but it's out of the application context so it gets me so far. 

Run time of the entire application may be too long and require a lot of resources for me (others) to run quick code change cycles and test every change. 


I tried to "minimize" the app and used Minikube but it does not scale high enough for the tests i need to run. 


What other alternatives are available if the test requires more than one kubernetes node, or the load is greater than what a laptop can hold in a single node (which is what Minikube lets you run)?


Thanks.

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.

To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/gzqu6UELsBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-use...@googlegroups.com.

To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages