• Posted on

    Use Helmfile for Deployment in Offline Environments

    Helmfile is an orchestrator tool for collecting, building, and deploying cloud-native apps. Basically it’s the packager for helm chart based applications.

    One of the interesting ideas I came along recently, is utilizing it for working in air-gapped environments, where access to the internet is not feasible.

    Use Case

    Let’s say you were deploying an application to a Kubernetes cluster. The idea is to package all dependencies and manifests beforehand in a local or control machine, then push the consolidated deployment directory to the offline machine.

    The diagram below depicts the flow.

  • Posted on

    Reflections on IaC using Terraform

    Terraform has emerged as one of the top open source infrastructure as code (IaC) tools, since its initial release by Hashicorp back in 2014.

    The design philosophy behind the tool is to have declarative, and stateful representation for the underlying IT infrastructure (whether it be on public, on-premise, or hybrid cloud), which in turns simplify the control, collaboration, and auditing of such resources.

    The classical example to provision compute VM to show the main principle.

  • Posted on

    Resolving Image Creation Failure on DockerD due Pool Size Limit


    Problem

    Sometimes, when working with docker engine on CI systems, certain type of errors could arise from the challenging restrictions in the environment. This is typical due the inherent server-client architecture in docker.

    Here’s one of the problems that I’ve seen recently. When a client is connecting to dockerd in order to build an image or pull external images:

    failed to prepare a4mv4dh8qcq283c7x47a4nwpg: devmapper: Thin Pool has 161986 free data blocks which is less than minimum required 163840 free data blocks. Create more free space in thin pool or use dm.min_free_space option to change behavior
    
  • Posted on

    Using UUIDs as Primary Key for Active Record Models

    Using universally unique identifiers (UUIDs) for exposed resource identifiers is more secure, and convenient for database distribution. It is relatively simple to configure Active Record to generate UUID primary keys in migrations.

    Setup

    Here are the steps:

    1. Setup the default generation inside config/application.rb:

       # config/application.rb
      
       module SampleApp
         class Application < Rails::Application
           ...
           # Change the primary key
           # default type to UUIDs.
           config.generators do |g|
             g.orm :active_record,
                   primary_key_type: :uuid
           end
         end
       end