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

20190924_Kubernetes_Meetup_Osaka__1_Kubernetesの...

nezumisannn
September 24, 2019

 20190924_Kubernetes_Meetup_Osaka__1_KubernetesのマニフェストをHCLで書く.pdf

nezumisannn

September 24, 2019
Tweet

More Decks by nezumisannn

Other Decks in Technology

Transcript

  1. 自己紹介 resource “my_profile” “nezumisannn” { name = “Yuki.Teraoka” nickname =

    “ねずみさん家。” company = “beyond” job = “Site Reliability Engineer” twitter = “@yktr_sre” skills = [“terraform”,”packer”] }
  2. apiVersion: apps/v1 kind: Deployment metadata: name: k8s-meetup-sample spec: selector: matchLabels

    : app: nginx-app replicas: 3 template: metadata: labels: app: nginx-app spec: containers: - name: nginx image: nginx:latest ports: - containerPort : 80
  3. module "k8s-meetup-sample" { source = "./modules/k8s-meetup-sample" replicas = 3 }

    template { metadata { labels = { app = "nginx-app" } } spec { container { name = "nginx" image = "nginx:latest" port { container_port = 80 } } } } } } variable "replicas" { type = "string" } resource "kubernetes_deployment" "k8s-meetup-sample" { metadata { name = "k8s-meetup-sample" } spec { selector { match_labels = { app = "nginx-app" } } replicas = "${var.replicas}"
  4. END