Skip to content

Commit

Permalink
modify readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brcnblc committed Mar 27, 2020
1 parent 10b0844 commit 8c90c01
Show file tree
Hide file tree
Showing 10 changed files with 2,047 additions and 61 deletions.
567 changes: 555 additions & 12 deletions README.md

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions app.auto.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"module_enabled": false,
"module_enabled": true,
"appConfig": {
"sec-app": {
"disabled": false,
Expand Down Expand Up @@ -175,13 +175,6 @@
}
}
}
},
"test-app":{
"k8s":{
"deployment":{
"importYaml" : "deployment.yml"
}
}
}
}
}
38 changes: 0 additions & 38 deletions d.json

This file was deleted.

180 changes: 180 additions & 0 deletions examples/basic-json-config/app.auto.tfvars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"module_enabled": true,
"appConfig": {
"sec-app": {
"disabled": false,
"k8s": {
"deployment": {
"disabled": false,
"metadata": {
"generateName": "sec-app-",
"labels": {
"app": "sec-app",
"env": "test"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "sec-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "sec-app",
"env": "test"
}
},
"spec": {
"containers": [
{
"name": "sample-app",
"image": "277341187485.dkr.ecr.eu-central-1.amazonaws.com/sample-app:latest",
"ports": [
{
"containerPort": 3000,
"name": "http"
}
],
"resources": {
"limits": {
"cpu": "0.5",
"memory": "512Mi"
},
"requests": {
"cpu": "250m",
"memory": "50Mi"
}
},
"livenessProbe": {
"httpGet": {
"path": "/",
"port": 3000,
"httpHeaders": [
{
"name": "X-Custom-Header-Znnn",
"value": "Awesome"
}
],
"initialDelaySeconds": 15,
"timeoutSeconds": 1
}
},
"restartPolicy": "always"
}
]
}
}
}
},
"service": {
"metadata": {
"generateName": "sec-app-"
},
"spec": {
"selector": {
"app": "sec-app"
},
"ports": [
{
"protocol": "TCP",
"port": 80,
"target_port": 3000
}
],
"type": "LoadBalancer"
}
}
}
},
"my-app": {
"disabled": false,
"k8s": {
"deployment": {
"metadata": {
"generateName": "my-app-",
"labels": {
"app": "my-app",
"env": "test"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app",
"env": "test"
}
},
"spec": {
"containers": [
{
"name": "my-app",
"image": "277341187485.dkr.ecr.eu-central-1.amazonaws.com/sample-app:latest",
"ports": [
{
"containerPort": 3000,
"name": "http"
}
],
"resources": {
"limits": {
"cpu": "0.5",
"memory": "512Mi"
},
"requests": {
"cpu": "250m",
"memory": "50Mi"
}
},
"livenessProbe": {
"httpGet": {
"path": "/",
"port": 3000,
"httpHeaders": [
{
"name": "X-Custom-Header-Znnn",
"value": "Awesome"
}
],
"initialDelaySeconds": 15,
"timeoutSeconds": 1
}
},
"restartPolicy": "always"
}
]
}
}
}
},
"service": {
"metadata": {
"generateName": "my-app-"
},
"spec": {
"selector": {
"app": "my-app"
},
"ports": [
{
"protocol": "TCP",
"port": 80,
"target_port": 3000
}
],
"type": "NodePort"
}
}
}
}
}
}
12 changes: 12 additions & 0 deletions examples/basic-json-config/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
provider "kubernetes" {
# Use your custom configuration here or leave it blank so that
# it uses your default configuration in kubeconfig file
}


module "k8s_yaml_tf" {
#source = "github.com/brcnblc/k8s-terraform-yaml"
source = "../.." # Use above source in your project

appConfig = var.appConfig
}
5 changes: 5 additions & 0 deletions examples/basic-json-config/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variable "appConfig" {
description = "Deployment Configurations"
type = any
default = {}
}
5 changes: 2 additions & 3 deletions examples/basic-yaml-sample/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ locals {
}

module "k8s_yaml_tf" {
source = "github.com/brcnblc/k8s-terraform-yaml"

#source = "github.com/brcnblc/k8s-terraform-yaml"
source = "../.."
appConfig = local.appConfig
module_enabled=true
}
Binary file added k8s-terraform-yaml-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed output.tf
Empty file.
Loading

0 comments on commit 8c90c01

Please sign in to comment.