Create a local custom testing environment through Minikube - kubernetes

I'm currently creating a Minikube cluster for the developers, they will each have their own Minikube cluster in their local machine for testing, assuming the developers don't know anything about Kubernetes, is creating a bash script to handle all the installations and the setup of the pod the recommended way? Is it possible to do it through Terraform instead?Or there's other way to do this easier? Thanks!

Depending on what your requirements are, choosing Minikube may or may not be the best way to go.
Just to give you some other options you might want to take a look at the following tools when it comes to local enviornments for developers (depending on their needs):
kind
k8s-vagrant-multi-node
Since you do not seem to care about Windows or other users (at least they weren't mentioned), a bash script may be the simplest way to go. However, usually that's were tools like Ansible come into play. They help you with automating things in a clear fashion and allow for proper testing. Some tools (like Ansible) even have support for certain Windows features that may be useful.
TL;DR
A Bash script is not the recommended way as it has lots of pain points that come with it, however, it may be the fastest approach depending on your skillset.
If you want to do it properly use tools like Ansible, Chef, Puppet, etc.

Related

Is there a way to package scripts in a container to run for diagnostic purposes against kubernetes?

The idea is instead of installing these scripts they can instead be applied via yaml perhaps and ran with access to kubectl and host tools to find potential issues with the running environment.
I figure the pod would need special elevated permissions, etc. I'm not quite sure if there is an example or even a better way of accomplishing the same idea.
Is there a way to package scripts in a container to run for diagnostic purposes against kubernetes?
It's an Alpha feature and not recommended for production use, but check out the ephemeral containers system: https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/
It's designed for exactly this, having a bundle of debugging tools that you can connect in to an existing file/pid namespace. However the feature is still incomplete as it is being added incrementally.

virtual machines automatic deployment and provisioning

In the recent times, I tend to set-up and configure more and more VMs daily with very similar or the very same configuration, and due to the time consumption caused by that, I'm looking for a way to automate the whole process.
I have started looking around and I have found Vagrant which could be a very good starting point.
I would like to create a custom build of a VMWare VM ( vagrant box if not mistaken ), and I would like to use that box as my base and deploy it on my servers.
The trouble starts here:
On my servers I use VMWare vSphere and I see that Vagrant can support it via an external plugin, but, as I read along, I see that vSphere only supports VMs created from template or cloned from an existing one.
Is there any change to run my VMWare Workstation boxes with it ?
Also, I would be very grateful if you could provide me with some more info on the same matter using other ( maybe better suited ) solutions.
I know there are also Chef and Puppet, but are they maybe an overkill for my needs ?Thank you for your time and help,Best regards.
Have you looked into Ansible? http://www.ansible.com/home
There is an opensource one available it is extremly easy to use. Might be what you're looking for.

Build RPM to deploy

I would like to know what is the best method to deploy applications like Django, Flask etc.. is by building RPM files or by using a tool like fabric which more or less does the same thing.. I'm trying to figure out the best approach to handle deployment and automation.
After considering the requirements I believe in my situation fabric will work best for basic deployments to multiple servers. While rpms can do similar things every time there is a change in source a new RPM must be created which for my environment will not work since the source code changes frequently. Any input from anyone is welcome. But I feel at least for me this will work best in the current situation.

VM automatic installation

I would love to have an idea on how to automatically install a Windows XP virtual machine on Virtualbox/VmWare. Is this feasable via a programming language, for example ? Or maybe an automated script ? I need this to avoid manual installation each time one of my VMs crashes.
I am not asking for a full program that does this, but I just needs technical hints on how to do this, then I will perform your suggestions myself.
Yes it's possible.
Can't you just make a snapshot to when the VM is working, or at least a "Clean Install" snapshot that saves having to reinstall your OS and common applications every time?
Yes, it is possible to do this via script. Actually, all IaaS cloud companies now try to do the deployment of VMs (and also physical servers) via automation. First of all, it's cheap a quick. And there is little human factor in it.
Not sure about VirtualBox, but if it works with VMware, KVM etc., there is no reason it shouldn't with VB.
As for the script itself, there are big money in this, so finding something may prove difficult. Try to check openStack, AFAIK it should be open source.

Deploying Go App

I have a REST API endpoint written in Go and I am wondering what is the best way to deploy it. I know that using Google App Engine would probably make my life easier in terms of deployment. But, suppose that I want to deploy this on AWS. What options/process/procedures do I have. What are some of the best practices out there? Do I need to write my own task to build, SCP and run it?
One option that I am interested in trying is using Fabric to create deployment tasks.
Just got back from Mountain West DevOps today where we talked about this, a lot. (Not for Go specifically, but in general.)
To be concise, all I can say is: it depends.
For a simple application that doesn't receive high use, you might just manually spin up an instance, plop the binary onto it, run it, and then you're done. (You can cross-compile your Go binary if you're not developing on the production platform.)
For slightly more automation, you might write a Python script that uploads and runs the latest binary to an EC2 instance for you (using boto/ssh).
Even though Go programs are usually pretty safe (especially if you test), for more reliability, you might daemonize the binary (make it a service) so that it will run again if it crashes for some reason.
For even more autonomy, use a CI utility like Jenkins or Travis. These can be configured to run deployment scripts automatically when you commit code to a certain branch or apply tags.
For more powerful automation, you can take it up another notch and use tools like Packer or Chef. I'd start with Packer unless your needs are really intense. The Packer developer talked about it today and it looks simple and powerful. Chef serves several enterprises, but might be overkill for you.
Here's the short of it: the basic idea with Go programs is that you just need to copy the binary onto the production server and run it. It's that simple. How you automate that or do it reliably is up to you, depending on your needs and preferred workflow.
Further reading: http://www.reddit.com/r/golang/comments/1r0q79/pushing_and_building_code_to_production/ and specifically: https://medium.com/p/528af8ee1a58