tfc-operator

command module
v0.0.0-...-81b0bac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

TFC-Operator

TFC-Operator is the Kubenretes Native Operator with GitOPs of Terraform. Supports Github/Gitlab (Public/Private), and uses HCL (Hashicorp Configuration Language) to provision resources in Cloud Platform (e.g. AWS, Azure, GCP, vSphere.. etc)

Quick Start

This guide contains information on creating an EC2 instance on AWS through Terraform Claims (CR).

1. Public Repo

(1) Push the HCL (Hashicorp Configuration Language) code that defines Terraform resources to the git repository (Github / GitLab)

Example.
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.27"
    }
  }

  required_version = ">= 0.14.9"
}

provider "aws" {
  access_key = "<AWS_ACCESS_KEY_ID>"
  secret_key = "<AWS_SECRET_ACCESS_KEY>"
  region = "us-east-1"
}

resource "aws_instance" "app_server" {
  ami           = "ami-0003076ab1664cd23"
  instance_type = "t2.micro"

  tags = {
    Name = "ExampleAppServerInstance"
  }
}

(2) Create a Terraform claim based on the previously created Git Repo information

kubectl apply -f samples/public/01_claim.yaml

2. Private Repo

(1) Push the HCL (Hashicorp Configuration Language) code that defines Terraform resources to the git repository (Github / GitLab)

Example. (same as 1-(1))
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.27"
    }
  }

  required_version = ">= 0.14.9"
}

provider "aws" {
  access_key = "<AWS_ACCESS_KEY_ID>"
  secret_key = "<AWS_SECRET_ACCESS_KEY>"
  region = "us-east-1"
}

resource "aws_instance" "app_server" {
  ami           = "ami-0003076ab1664cd23"
  instance_type = "t2.micro"

  tags = {
    Name = "ExampleAppServerInstance"
  }
}

(2) Create a secret holding an access token that can access the private repo

kubectl apply -f samples/private/01_secret.yaml

(3) Create a Terraform claim based on the previously created Git Repo information

kubectl apply -f samples/private/02_claim.yaml

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the claim v1alpha1 API group +kubebuilder:object:generate=true +groupName=claim.tmax.io
Package v1alpha1 contains API Schema definitions for the claim v1alpha1 API group +kubebuilder:object:generate=true +groupName=claim.tmax.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL