Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Understanding the Kubernetes Provider for Terra...

Understanding the Kubernetes Provider for Terraform

In this talk, Taylor Dolezal (Developer Advocate at HashiCorp) and I look at how to use Terraform to create Kubernetes Namespaces, Deployments and Services using Terraform.

This version of the presentation was given at an internal event in August 2020.

Kerim Satirli

August 11, 2020
Tweet

More Decks by Kerim Satirli

Other Decks in Technology

Transcript

  1. HashiCorp Configuration Language CODE EDITOR service "http" "web_proxy" { listen_addr

    = "127.0.0.1:8080" process "server" { command = ["proxy-app", "server"] } } variable "port" { description = "Port for web_proxy" default = 8080 }
  2. HashiCorp Configuration Language CODE EDITOR service "http" "web_proxy" { listen_addr

    = "127.0.0.1:${var.port}" process "server" { command = ["proxy-app", "server"] } } variable "port" { description = "Port for web_proxy" default = 8080 }
  3. Creating a Deployment CODE EDITOR resource "kubernetes_deployment" "beacon" { metadata

    { name = "beacon" namespace = kubernetes_namespace.beacon.id spec { container { image = "onlydole/beacon:1.19.1" name = "beacon" } } }
  4. Creating a Service CODE EDITOR resource "kubernetes_service" "beacon" { metadata

    { name = "beacon" namespace = kubernetes_namespace.beacon.id spec { selector { app = kubernetes_deployment.beacon.metadata.0.labels.app } } ...
  5. Creating a Service CODE EDITOR ... port { port =

    8080 target_port = 80 } type = "LoadBalancer" }