Posts

Showing posts from January 3, 2019

setting up deployment on multi-node kubernetes

Image
1 I'm just starting to explore Kubernetes, and there is one thing I find unclear. Suppose I have a master node that I have set up with kubeadm , and another two worker nodes that I had joined to master. Now I have a yaml file that specifies the details of a Deployment and I need to run: kubectl create -f dep.yaml Do I need to run this command on master only? and then the master may or may not decide to use both worker nodes for the deployment according to optimal load distribution? Or do I need to run this in all worker nodes? kubernetes share | improve this question edited Nov 12 '18 at 15:59 Anthon

Recursion Problem - given array n and a number k

Image
4 Given an array size n, and a positive number max(max represent the range of the numbers that we can use to place in the array). I would like to count how many combinations of sorted numbers I can place in the array. For example : If n = 3, max = 2 .(the only numbers we can use is 1/2 as max is 2) so there are 4 combinations of sorted arrays 1. {1,1,1} 2. {1,1,2} 3. {1,2,2} 4. {2,2,2} I wrote some code and succeed to pass this specific example but any other example that max > 2 doesn't return the correct answer. the problem as I identify it is when the recursion reaches the last index it doesn't try a third number it just folds back. my code : private static int howManySorted(int n, int max, int index, int numToMax, int prevNum) { // If the value is bigger then max return