GithubHelp home page GithubHelp logo

isabella232 / terraform-provider-kustomization Goto Github PK

View Code? Open in Web Editor NEW

This project forked from containersolutions/terraform-provider-kustomization

0.0 0.0 0.0 258 KB

Terraform provider for Kustomize

Home Page: https://www.kubestack.com

License: Apache License 2.0

Go 94.21% HCL 5.62% Makefile 0.16% Shell 0.02%

terraform-provider-kustomization's Introduction

Terraform Provider Kustomize

Run Tests

This provider aims to solve 3 common issues of applying a kustomization using kubectl by integrating Kustomize and Terraform.

  1. Lack of feedback what changes will be applied.
  2. Resources from a previous apply not in the current apply are not purged.
  3. Immutable changes like e.g. changing a deployment's selector cause the apply to fail mid way.

To solve this the provider uses the Terraform state to show changes to each resource individually during plan as well as track resources in need of purging.

It also uses server side dry runs to validate changes to the desired state and translate this into a Terraform plan that will show if a resource will be updated in-place or requires a delete and recreate to apply the changes.

As such it can be useful both to replace kustomize/kubectl integrated into a Terraform configuration as a provisioner as well as standalone kubectl diff/apply steps in CI/CD.

Using the Provider

The Terraform provider for Kustomize is available from the Terraform registry. Please refert to the documentation for information on how to use the kustomization_build and kustomization_overlay data sources, or the kustomization_resource resource.

Development Requirements

  • Terraform 0.12.x
  • Go 1.13 (to build the provider plugin)

Building and Developing the Provider

To work on the provider, you need go installed on your machine (version 1.13.x tested). The provider uses go mod to manage its dependencies, so GOPATH is not required.

To compile the provider, run make build as shown below. This will build the provider and put the provider binary in the terraform.d/plugins/linux_amd64/ directory.

$ make build

In order to test the provider, you can simply run the acceptance tests using make test. You can set the KUBECONFIG environment variable to point the tests to a specific cluster or set the context of your current config accordingly. The tests create namespaces on the current context. Kind or Minikube clusters work well for testing.

$ make test

terraform-provider-kustomization's People

Contributors

alapidas avatar maxiaohao avatar pst avatar rvaidya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.