This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: myapp | |
| namespace: mynamespace | |
| --- | |
| kind: ClusterRole | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| metadata: | |
| namespace: mynamespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| locals { | |
| policies_arns = { | |
| for item in aws_iam_policy.policy : | |
| item.name => item.arn | |
| } | |
| users_attachment = distinct( | |
| flatten([ | |
| for item in var.policies : [ | |
| for user in item.users_to_attach : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # terraform.tfvars | |
| policies = [ | |
| { | |
| policy_name = "policy-alpha", | |
| roles_to_attach = [] | |
| users_to_attach = ["user1", "user2"] | |
| content = {} | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # variables.tf | |
| variable "myapp_conf" { | |
| type = map | |
| } | |
| # terraform.tfvars | |
| myapp_conf = { | |
| REPLICAS = 0 | |
| LIMIT_CPU = "50m" | |
| LIMIT_MEMORY = "96Mi" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| "os" | |
| "strconv" | |
| ) | |
| func main() { | |
| tc := 1 | |
| if temp := os.Getenv("THREADS"); temp != "" { | |
| number, err := strconv.Atoi(temp) | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "kubernetes_ingress" "node0_ingress" { | |
| metadata { | |
| name = local.node0 | |
| namespace = local.namespace | |
| annotations = { | |
| "kubernetes.io/ingress.class" = "nginx" | |
| "nginx.ingress.kubernetes.io/backend-protocol" = "HTTP" | |
| "nginx.ingress.kubernetes.io/enable-cors" = "true" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "kubectl_manifest" "node0_deployment" { | |
| apply_only = true | |
| wait_for_rollout = false | |
| yaml_body = <<YAML | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: ${local.node0} | |
| namespace: ${local.namespace} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: node0 | |
| namespace: namespace | |
| labels: | |
| app: node0 | |
| spec: | |
| replicas: 3 | |
| selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install lxde xorg lxdm --no-install-recommends |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # File: main.tf | |
| locals { | |
| # Static variables | |
| domain = "domain.com" | |
| name_list = [ | |
| "name1", | |
| "name2", | |
| "name3" | |
| ] |