Skip to main content

Posts

How to encrypt your home with guestfs

Continued from http://teknoarticles.blogspot.com.es/2016/12/start-using-whole-disk-images-with.html For security reasons, there may be the need of encrypting several partitions of volumes on your images. And you can have a pre-created image with that encryption on place, instead of having to do manually after boot. This can be done with guestfs and luks . The following script will show how to perform that encryption and mount it automatically: #!/usr/bin/env python import binascii import guestfs import os # remove old generated drive try:     os.unlink("/tmp/overcloud-full-partitioned.qcow2") except:     pass g = guestfs.GuestFS(python_return_dict=True) # import old and new images print("Creating new repartitioned image") g.add_drive_opts("/tmp/overcloud-full.qcow2", format="qcow2", readonly=1) g.disk_create("/tmp/overcloud-full-partitioned.qcow2", "qcow2", 10 * 1024 * 1024 * 1024) #10G g.add_drive_opts("/tmp/o...

Start using whole disk images with TripleO

What are the differences between flat partition image and whole disk image? In order to understand this article, you first need to know what a flat partition image and a whole disk image are, and the differences between each other. flat partition image: disk image that just contains all the desired content in a filesystem, but does not carry any information about partitions on it, and it does not include a bootloader. In order to boot from a whole disk image, the kernel and ramdisk images need to be passed independently when booting, relying on an external system to mount. whole disk image: image that contains all the information about partitions, bootloaders... as well as all the desired content. It can boot independently, without the need of external kernels or systems to mount it. Right now, OpenStack Ironic   supports both kind of images, but OpenStack TripleO was only supporting flat partition images. TripleO added support for whole disk images Since python-triple...

Generate Fedora Atomic images using diskimage-builder

About Atomic project - http://www.projectatomic.io Atomic is a lightweight operating system, assembled from RPM content. It is mainly designed to run applications in Docker containers. Hosts based on RHEL, Fedora and CentOS are available with Atomic. Project Atomic includes the following components: Docker , Kubernetes , rpm-ostree , systemd What are the advantages of Atomic? Using Atomic distributions limits the patch frequency for administrators. The usage of Docker containers offers a clear path to deliver consistent and fully tested stacks. Containers secured with Linux namespaces, cGroups, and SELinux give isolation close to that of a VM, with much greater flexibility and efficiency. About diskimage-builder - http://docs.openstack.org/developer/diskimage-builder/ Diskimage-builder is a tool for building disk images, file system images and ramdisk images. It is the tool used in OpenStack projects to generate base images for deployments and testing. The problem: ...

Kubestack: dynamic jenkins slaves using Kubernetes

In this article I will show KubeStack, a python daemon and command line tool to spin un dynamic Jenkins slaves using Kubernetes: https://github.com/kubestack/kubestack How to install it KubeStack is currently a POC, so it's not still published as a package. To install it, you can clone from the upper url. KubeStack project is divided on three directories: ansible : a set of scripts and documentation explaining how to setup a Kubernetes cluster on OpenStack images : Dockerfile and scripts used to generate Jenkins slaves app : KubeStack application to interact with Kubernetes and Jenkins To install the KubeStack application, you need to go the the app/kubestack directory, and install the requirements listed on requirements.txt file. You can run the daemon using: python kubestack/cmd/kubestackd.py (-d if you don't want as a daemon).  Also a CLI tool is available on kubestack/cmd/kubestackcmd.py How to configure KubeStack relies on a configuration file, that li...

Dynamically add Jenkins slaves using Kubernetes

CI is a very interesting area where Kubernetes can be applied. It's a common use case to have a demand of containers to be able to run tests of code changes, or to create some build artifacts. In this post I will be explaining how to use Kubernetes to spin up Jenkins slaves and connect them to a Jenkins master, allowing to run tests on demand, and have a very easy and fast way to scale depending on our needs. Pre-requisites needed on Jenkins master Installing Jenkins plugin This approach relies on Jenkins Swarm Plugin. So you need to ensure that you have installed this module on your master: https://wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin For Jenkins Swarm Plugin to work, you need to enable CSRF. You need to visit http://url.to.master/configureSecurity/ and check the Prevent Cross Site Request Forgery exploits option. Configure security Also consider that Jenkins uses a random port to enable connection to slaves using JNLP. If you are under a protected e...