and are two well known foundational open source instruments for building infrastructure. They are very different by nature and application scenarios but also have lots similarities and intersections. I’m going to skip philosophical aspects and show practical example of the two technologies can augment each other. Kubernetes Terraform What is Common? and span infrastructure, applications and services. Multipurpose Provide and hide complexity of underlying infrastructure. abstraction and enable hybrid cloud development. Cloud agnostic allow to focus on the end result, bypassing interim steps programming. Desired state and Development Experience Terraform Configurations vs Kubernetes Manifests At the lowest level, working with both tools assumes writing DSL manifests in / or , verifying and submiting them for execution with or cli tools. While this approach is good for ad-hock tasks or as a “quickstart”, it lacks iterative deployment, stacks lifecycle management and 3rd party automation reuse. YAML HCL JSON terraform kubectl Modules and Helm packages The above limitation is partially addressed by using and with public for terraform. For Kubernetes, it’s improved by using with numerous . However, development on this level, assumes spending lot’s of manual efford in order to get things done and enable continuous deployment. workspaces modules registry helm charts available Out of the box CI/CD That’s the most interesting part, where terraform ecosystem is missing a lot comparing to kubernetes and you need to make your hands dirty to get basic CI/CD. opensource Some examples: is critical since you need to communicate with different cloud platform APIs and you cannot keep sensitive data in the code. While enabled in Kubernetes by design via encrypted secrets, and , you spend some valuable time integrating into your CI for terraform. Managing Secretes vault integration service catalog Out of the box continuous development for dev and prod. Simply saying, terraform is missing “Day 0" tools similar to , , or even , which implement typical development flows and form a basement of you pipelines. automated workflow skaffold draft gitkube metaparticle What if we could use Kubernetes tools for Terraform? Apart from levereging the largest and biggest ecosystem, we could unify tooling and development experience for the both, hence, minimize maintenance efforts. Prototype I have created draft pack, which illustrates the above and automates terraform development using skaffold, helm and has built-in , integrations. Essentially, each Terraform change results into an upgrade of helm release and it can be easily integrated with . Packer Vault Jenkins X Jenkins X Terraform pipeline reference architecture Quickstart Prerequesites: installed draft, skaffold, helm, kubernetes Clone repository and install draft pack: git clone cd infrapackcd tests/ && make addpack https://github.com/odzhu/infrapack.git Run Packer and Terraform build and deploy against sample code using skaffold make test Under the hood, it will: Create temp dir and copy sample terraform and packer code the. Execure draft create and enreaching the code with helm charts. Build and deploy. NAME: infrapackLAST DEPLOYED: Wed May 30 18:58:11 2018NAMESPACE: defaultSTATUS: DEPLOYED RESOURCES:==> v1/ServiceAccountNAME SECRETS AGEinfrapack-infrapack 1 0s ==> v1/RoleNAME AGEstate-writer-infrapack 0s ==> v1/RoleBindingNAME AGEstate-writer-infrapack 0s ==> v1/JobNAME DESIRED SUCCESSFUL AGEinfrapack-infrapack1 1 0 0s ==> v1/Pod(related)NAME READY STATUS RESTARTS AGEinfrapack-infrapack1-97r8t 0/1 Pending 0 0s ==> v1/SecretNAME TYPE DATA AGEstate-infrapack Opaque 1 0s ==> v1/ConfigMapNAME DATA AGEscripts-infrapack1 3 0s Deploy complete in 585.116428ms0 tests$ helm listNAME REVISION UPDATED STATUS CHART NAMESPACEinfrapack 1 Wed May 30 18:58:11 2018 DEPLOYED hcl-v0.1.0 default Switch to temp dir and start skaffold. cd /tmp/sandbox/ && skaffold dev The environment is ready for sandboxing, any code change will be automatically applied and you can inspect helm release for the details!