{
    "componentChunkName": "component---src-pages-blog-post-tsx",
    "path": "/blog/2021-02-17/terraform-kubernetes-tutorial",
    "result": {"data":{"site":{"siteMetadata":{"siteUrl":"https://www.architect.io"}},"allMdx":{"edges":[{"node":{"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Get Started with the Terraform Kubernetes provider\",\n  \"description\": \"Follow this tutorial to deploy a load-balanced “Hello World” application to Kubernetes with Terraform.\",\n  \"keywords\": \"terraform kubernetes\",\n  \"slug\": \"terraform-kubernetes-tutorial\",\n  \"date\": \"2021-02-17T00:00:00.000Z\",\n  \"author\": \"Ryan Cahill\",\n  \"image\": \"./kubernetes-and-terraform.png\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"Kubernetes is a powerful yet complicated container orchestration system. It can be used to run\\nresilient workloads on virtually any cloud platform, including AWS, GCS, Azure, DigitalOcean, and\\nmore. In this tutorial, you'll explore some of the most commonly-used building blocks of a\\nKubernetes application \\u2013 Pods, Deployments, and Services. These resources could be created with\\nstandard Kubernetes manifests if desired, but the method of using manifests has faults, including\\none major drawback, which is that there's no state preservation.\"), mdx(\"p\", null, \"Terraform is an infrastructure-as-code tool created by Hashicorp to make handling infrastructure\\nmore straightforward and manageable. Terraform files use a declarative syntax where the user\\nspecifies resources and their properties such as pods, deployments, services, and ingresses. Users\\nthen leverage the Terraform CLI to preview and apply expected infrastructure. When changes are\\ndesired, a user simply updates and reapplies the same file or set of files; then, Terraform handles\\nresource creation, updates, and deletion as required.\"), mdx(\"p\", null, \"For this tutorial, start by creating a Kubernetes cluster. By following along, you'll learn how to\\ndefine Kubernetes resources using Terraform and apply the configuration to the cluster. When\\neverything is up and running, you'll have your own \\\"Hello World\\\" service running on the cloud!\"), mdx(\"h2\", {\n    \"id\": \"project-dependencies-for-kubernetes-and-terraform\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Project dependencies for Kubernetes and Terraform\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#project-dependencies-for-kubernetes-and-terraform\",\n    \"aria-label\": \"project dependencies for kubernetes and terraform permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"You'll be using \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://learn.hashicorp.com/tutorials/terraform/install-cli\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"terraform\")), \" to deploy\\nall of the required resources to the Kubernetes cluster.\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://kubernetes.io/docs/tasks/tools/install-kubectl/\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"kubectl\")), \" can optionally be installed if\\nyou'd like more insights into what has been created. Also, be sure to have an account with a cloud\\nprovider that has Kubernetes hosting. Once those requirements are met, you're ready to get started!\"), mdx(\"h2\", {\n    \"id\": \"define-kubernetes-resources-with-terraform\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Define Kubernetes Resources with Terraform\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#define-kubernetes-resources-with-terraform\",\n    \"aria-label\": \"define kubernetes resources with terraform permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Terraform requires that the user uses its special language called HCL, which stands for Hashicorp\\nConfiguration Language. Create a folder called \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform-example\"), \" where the HCL files will live,\\nthen change directories to that folder. Terraform providers will need to be defined and installed to\\nuse certain types of resources. This tutorial will use the\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://registry.terraform.io/providers/hashicorp/kubernetes/latest\"\n  }, \"Kubernetes\"), \" and the\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://registry.terraform.io/providers/hashicorp/helm/latest\"\n  }, \"Helm\"), \" providers. Providers are\\neasily downloaded and installed with a few lines of HCL and a single command. Be sure that you have\\ndownloaded your cluster's kubeconfig, as it will be necessary for the rest of the tutorial. Create a\\nfile called \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"versions.tf\"), \" where providers will be defined and add the following code:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"hcl\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"terraform\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"required_providers\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"kubernetes\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"source\"), \"  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hashicorp/kubernetes\\\"\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"version\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\">= 2.0.0\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"helm\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"source\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hashicorp/helm\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"provider\", mdx(\"span\", {\n    parentName: \"span\",\n    \"className\": \"token type variable\"\n  }, \" \\\"kubernetes\\\" \")), mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"config_path\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"<your_kubeconfig_path>\\\"\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"provider\", mdx(\"span\", {\n    parentName: \"span\",\n    \"className\": \"token type variable\"\n  }, \" \\\"helm\\\" \")), mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"kubernetes\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"config_path\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"<your_kubeconfig_path>\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\")))), mdx(\"p\", null, \"Be sure to replace \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"<your_kubeconfig_path>\"), \" in each \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"provider\"), \" block with the location of the\\nkubeconfig you've downloaded. Now that the required providers are defined, they can be installed by\\nrunning the command \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform init\"), \". Ensure that the command is run in the same folder that\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"versions.tf\"), \" is in. The command should print something like what's below, indicating success:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-text\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"Initializing the backend...\\n\\nInitializing provider plugins...\\n- Reusing previous version of hashicorp/kubernetes from the dependency lock file\\n- Reusing previous version of hashicorp/helm from the dependency lock file\\n- Installing hashicorp/kubernetes v2.0.1...\\n- Installed hashicorp/kubernetes v2.0.1 (signed by HashiCorp)\\n- Installing hashicorp/helm v2.0.2...\\n- Installed hashicorp/helm v2.0.2 (signed by HashiCorp)\\n\\nTerraform has been successfully initialized!\\n\\nYou may now begin working with Terraform. Try running \\\"terraform plan\\\" to see any changes that are required for your infrastructure. All Terraform commands should now work.\\n\\nIf you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.\"))), mdx(\"p\", null, \"Note that a folder has been created alongside \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"versions.tf\"), \" called \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".terraform\"), \". This folder is\\nwhere the installed providers are stored to be used for later \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform\"), \" processes. Now that the\\nprerequisites to run \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform\"), \" are out of the way, the resource definitions can be created. Add a\\nfile alongside \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"versions.tf\"), \" called \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main.tf\"), \". For simplicity, all resources will be created in the\\nsame file. Add the following resource definition to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main.tf\"), \":\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"hcl\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"resource \", mdx(\"span\", {\n    parentName: \"span\",\n    \"className\": \"token type variable\"\n  }, \"\\\"kubernetes_namespace\\\"\")), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello_world_namespace\\\"\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"metadata\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"labels\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"app\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"name\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-namespace\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\")))), mdx(\"p\", null, \"This block defines the Kubernetes namespace that will be created for all of the other resources to\\nlive in. A Kubernetes namespace helps separate resources into groups when certain things do not need\\nto interact. It's not truly necessary in this case, but using namespaces is a good practice to\\nensure that strange collisions don't occur down the line. Next, add the resource definition for a\\nsimple Kubernetes deployment to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main.tf\"), \":\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"hcl\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"resource \", mdx(\"span\", {\n    parentName: \"span\",\n    \"className\": \"token type variable\"\n  }, \"\\\"kubernetes_deployment\\\"\")), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello_world_deployment\\\"\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"metadata\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"name\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"kubernetes-example-deployment\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"namespace\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-namespace\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"labels\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"app\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"spec\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"replicas\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token number\"\n  }, \"1\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"selector\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"match_labels\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n        \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"app\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"template\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"metadata\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n        \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"labels\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n          \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"app\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n        \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"spec\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n        \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"container\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n          \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"image\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"heroku/nodejs-hello-world\\\"\"), \"\\n          \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"name\"), \"  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world\\\"\"), \"\\n        \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\")))), mdx(\"p\", null, \"The deployment spec is where a user defines the expected state of a set of pods. The deployment\\ncontroller in the cluster will then update pods to that expected state. Note that the deployment is\\nscoped to the namespace that has just been created, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"hello-world-namespace\"), \". The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"spec\"), \" block in the\\ndeployment is where the expected state of a pod or set of pods is defined and, in this case, where\\nthe single \\\"Hello World\\\" service is defined. All it takes is specifying the container that needs to\\nbe run because the pod will be running a public Docker image. The Kubernetes service is the next\\nresource that needs to be defined. Add the service to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main.tf\"), \" with the code below:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"hcl\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"resource \", mdx(\"span\", {\n    parentName: \"span\",\n    \"className\": \"token type variable\"\n  }, \"\\\"kubernetes_service\\\"\")), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello_world_service\\\"\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"depends_on\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"[\"), \"kubernetes_deployment.hello_world_deployment\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"]\"), \"\\n\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"metadata\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"labels\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"app\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"name\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"namespace\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-namespace\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"spec\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"port\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"name\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"api\\\"\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"port\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token number\"\n  }, \"3000\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"target_port\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token number\"\n  }, \"3000\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"selector\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"app\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"type\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"ClusterIP\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\")))), mdx(\"p\", null, \"A Kubernetes service defines how a group of pods should be accessed. It's important that the service\\nis created after the deployment and the pods are, so Terraform has the handy \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"depends_on\"), \" keyword to\\nhandle that. \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"depends_on\"), \" is an array that exists on many Terraform resource definitions that allows\\nthe user to specify what resources a service should be created after. Like the deployment, the\\nservice is also created in the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"hello-world-namespace\"), \" to only target pods running there. The\\nservice's \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"selector\"), \" defines labels of pods that it should be targeting to enable access. The\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"app = \\\"hello-world-example\\\"\"), \" selector is defined here because it matches the labels that are set on\\nthe deployment's pods. The service also defines what ports can be accessed. In this case, when\\ntraffic is sent to port 3000 of the service, it will then be routed to port 3000 of one of the\\nselected group\\u2019s pods.\"), mdx(\"h2\", {\n    \"id\": \"use-terraform-to-create-kubernetes-resources-that-enable-cluster-access\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Use Terraform to create Kubernetes resources that enable cluster access\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#use-terraform-to-create-kubernetes-resources-that-enable-cluster-access\",\n    \"aria-label\": \"use terraform to create kubernetes resources that enable cluster access permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"The Terraform resources that have been defined so far create everything that's needed to run an\\napplication accessible to the cluster, but more resources are needed to access the application from\\nthe outside world. Most importantly, a load balancer should be put in front of the \\\"Hello World\\\"\\nservice to handle the traffic. This tutorial uses the\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://kubernetes.github.io/ingress-nginx/\"\n  }, \"Nginx Ingress Controller\"), \" and the Helm Terraform\\nprovider to create it. Add the following to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main.tf\"), \" to create the Nginx ingress controller:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"hcl\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"resource \", mdx(\"span\", {\n    parentName: \"span\",\n    \"className\": \"token type variable\"\n  }, \"\\\"helm_release\\\"\")), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"ingress_nginx\\\"\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"name\"), \"       \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"ingress-nginx\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"repository\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"https://kubernetes.github.io/ingress-nginx\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"chart\"), \"      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"ingress-nginx\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"version\"), \"    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"3.15.2\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"namespace\"), \"  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-namespace\\\"\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"timeout\"), \"    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token number\"\n  }, \"300\"), \"\\n\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"values\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"[\"), mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token heredoc string\"\n  }, \"<<EOF\\ncontroller:\\n  admissionWebhooks:\\n    enabled: false\\n  electionID: ingress-controller-leader-internal\\n  ingressClass: nginx-hello-world-namespace\\n  podLabels:\\n    app: ingress-nginx\\n  service:\\n    annotations:\\n      service.beta.kubernetes.io/aws-load-balancer-type: nlb\\n  scope:\\n    enabled: true\\nrbac:\\n  scope: true\\nEOF\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"]\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\")))), mdx(\"p\", null, \"Using the Helm Terraform provider and, in turn, the Helm chart makes creating the required\\nKubernetes resource much easier because it's not necessary to add a bunch of boilerplate to the\\nTerraform file. If you'd like to explore more than is covered in this tutorial, feel free to check\\nout the Helm chart\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx\"\n  }, \"here\"), \". When Terraform\\ncreates the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"helm_release\"), \" resource, it will create an \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"ingress-nginx-controller\"), \" deployment, pod,\\nreplica set, and other resources required to run the load balancer within the cluster. One more\\nresource needs to be added to expose the Nginx controller to the outside world. Create a Kubernetes\\ningress for the Nginx controller by adding the following resource definition to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main.tf\"), \":\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"hcl\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-hcl\"\n  }, mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"resource \", mdx(\"span\", {\n    parentName: \"span\",\n    \"className\": \"token type variable\"\n  }, \"\\\"kubernetes_ingress\\\"\")), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"ingress\\\"\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"metadata\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"labels\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"app\"), \"                               \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"ingress-nginx\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"name\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"api-ingress\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"namespace\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-namespace\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"annotations\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"\\\"kubernetes.io/ingress.class\\\"\"), \": \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"nginx-hello-world-namespace\\\"\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"spec\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"rule\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"http\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n        \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"path\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n          \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"path\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"/\\\"\"), \"\\n          \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token keyword\"\n  }, \"backend\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"{\"), \"\\n            \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"service_name\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token string\"\n  }, \"\\\"hello-world-example\\\"\"), \"\\n            \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token property\"\n  }, \"service_port\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"=\"), \" \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token number\"\n  }, \"3000\"), \"\\n          \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n        \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n      \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n    \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n  \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\"), \"\\n\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token punctuation\"\n  }, \"}\")))), mdx(\"p\", null, \"Note that the ingress resource is created in the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"hello-world-namespace\"), \" namespace like all other\\nresources in this tutorial. It's also important that the annotation \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"kubernetes.io/ingress.class\"), \" is\\nnamed \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"nginx-<namespace_name>\"), \" so that the Nginx ingress controller knows to handle the ingress\\nrules. Finally, the spec portion of the ingress definition defines how Nginx should be configured.\\nIn this case, all traffic is routed to the service named \\\"hello-world-example\\\" at port 3000 and, in\\nturn, to the pods backing the service which are running the \\\"Hello World\\\" application. Now that all\\nrequired resources are defined, you're ready to run the Terraform deployment!\"), mdx(\"p\", null, \"Before running the deployment, it may be useful to see what exactly it is that Terraform will create\\nbased on the template. That's especially useful as the infrastructure grows. Run the command\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform plan -out=tfplan\"), \" to see what resources Terraform will add, change, or destroy. On the\\nfirst run, your output should look something like this:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-text\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"An execution plan has been generated and is shown below.\\nResource actions are indicated with the following symbols:\\n  + create\\n\\nTerraform will perform the following actions:\\n\\n  # helm_release.ingress_nginx will be created\\n  + resource \\\"helm_release\\\" \\\"ingress_nginx\\\" {\\n      + atomic                     = false\\n      + chart                      = \\\"ingress-nginx\\\"\\n\\n...\\n\\n+ port        = 3000\\n              + protocol    = \\\"TCP\\\"\\n              + target_port = \\\"3000\\\"\\n            }\\n        }\\n    }\\n\\nPlan: 5 to add, 0 to change, 0 to destroy.\\n\\n------------------------------------------------------------------------\\n\\nThis plan was saved to: tfplan\\n\\nTo perform exactly these actions, run the following command to apply:\\n    terraform apply \\\"tfplan\\\"\"))), mdx(\"p\", null, \"Each resource that will be created along with details about its properties is shown in the terminal.\\nOnce you're ready to actually create the resources in the cluster, run the command\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform apply tfplan\"), \" and wait for it to complete. The load balancer may take a couple minutes to\\nprovision. Once completed, you should have seen something like below:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-text\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"kubernetes_namespace.hello_world_namespace: Creating...\\nkubernetes_ingress.ingress: Creating...\\nkubernetes_deployment.hello_world_deployment: Creating...\\nhelm_release.ingress_nginx: Creating...\\nkubernetes_namespace.hello_world_namespace: Creation complete after 1s [id=hello-world-namespace]\\nkubernetes_ingress.ingress: Creation complete after 1s [id=hello-world-namespace/api-ingress]\\nkubernetes_deployment.hello_world_deployment: Creation complete after 9s [id=hello-world-namespace/kubernetes-example-deployment]\\nkubernetes_service.hello_world_service: Creating...\\nkubernetes_service.hello_world_service: Creation complete after 0s [id=hello-world-namespace/hello-world-example]\\nhelm_release.ingress_nginx: Still creating... [10s elapsed]\\nhelm_release.ingress_nginx: Still creating... [20s elapsed]\\n\\n...\\n\\nhelm_release.ingress_nginx: Still creating... [2m20s elapsed]\\nhelm_release.ingress_nginx: Still creating... [2m30s elapsed]\\nhelm_release.ingress_nginx: Creation complete after 2m36s [id=ingress-nginx]\\n\\nApply complete! Resources: 5 added, 0 changed, 0 destroyed.\\n\\nThe state of your infrastructure has been saved to the path\\nbelow. This state is required to modify and destroy your\\ninfrastructure, so keep it safe. To inspect the complete state\\nuse the `terraform show` command.\\n\\nState path: terraform.tfstate\"))), mdx(\"p\", null, \"And that's it; you now have an application running in the cloud! But how can it be accessed? You can\\nfind out how with one \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"kubectl\"), \" command. Enter the following command in a terminal and be sure to\\nreplace \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"<your_kubeconfig_file_path>\"), \":\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-bash\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"kubectl get \", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token function\"\n  }, \"service\"), \" ingress-nginx-controller -n hello-world-namespace --kubeconfig\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token operator\"\n  }, \"=\"), mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token operator\"\n  }, \"<\"), \"your_kubeconfig_file_path\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token operator\"\n  }, \">\")))), mdx(\"p\", null, \"Copy the IPv4 address under the header \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"EXTERNAL-IP\"), \", then on the command line, enter\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"curl -X GET <IPv4_address>\"), \" being sure to replace \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"<IPv4_address>\"), \" with the external IP of the\\nKubernetes service. You should see \\\"Hello World\\\" printed to the console. That's the response from\\nyour cloud application running on Kubernetes! Now, what happens when more and more people start\\nusing your service?\"), mdx(\"h2\", {\n    \"id\": \"use-terraform-to-modify-existing-kubernetes-resources\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Use Terraform to modify existing Kubernetes resources\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#use-terraform-to-modify-existing-kubernetes-resources\",\n    \"aria-label\": \"use terraform to modify existing kubernetes resources permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"There's only one replica of the application running right now, and more may be needed in the future\\nto handle traffic. Fortunately, Terraform can help add more replicas of the application. Confirm\\nthat only one replica exists by running the command\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"kubectl get pods -n hello-world-namespace --kubeconfig=<your_kubeconfig_file_path>\"), \" and notice that\\nonly one pod exists that is prefixed with \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"kubernetes-example-deployment\"), \". To increase the number of\\npods running the \\\"Hello World\\\" application, the deployment will need to be updated. Find the line in\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main.tf\"), \" where replicas for the applications are defined as \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"replicas = 1\"), \" and update \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"1\"), \" to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"3\"), \".\\nNow in a terminal, run the following command to see what will be updated in the cluster:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-bash\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"terraform plan -out\", mdx(\"span\", {\n    parentName: \"code\",\n    \"className\": \"token operator\"\n  }, \"=\"), \"tfplan\"))), mdx(\"p\", null, \"The output should look like the following:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-text\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"helm_release.ingress_nginx: Refreshing state... [id=ingress-nginx]\\nkubernetes_namespace.hello_world_namespace: Refreshing state... [id=hello-world-namespace]\\nkubernetes_ingress.ingress: Refreshing state... [id=hello-world-namespace/api-ingress]\\nkubernetes_deployment.hello_world_deployment: Refreshing state... [id=hello-world-namespace/kubernetes-example-deployment]\\nkubernetes_service.hello_world_service: Refreshing state... [id=hello-world-namespace/hello-world-example]\\n\\nAn execution plan has been generated and is shown below.\\nResource actions are indicated with the following symbols:\\n  ~ update in-place\\n\\nTerraform will perform the following actions:\\n\\n  # kubernetes_deployment.hello_world_deployment will be updated in-place\\n  ~ resource \\\"kubernetes_deployment\\\" \\\"hello_world_deployment\\\" {\\n        id               = \\\"hello-world-namespace/kubernetes-example-deployment\\\"\\n        # (1 unchanged attribute hidden)\\n\\n\\n      ~ spec {\\n          ~ replicas                  = \\\"1\\\" -> \\\"3\\\"\\n            # (4 unchanged attributes hidden)\\n\\n\\n\\n            # (3 unchanged blocks hidden)\\n        }\\n        # (1 unchanged block hidden)\\n    }\\n\\nPlan: 0 to add, 1 to change, 0 to destroy.\\n\\n------------------------------------------------------------------------\\n\\nThis plan was saved to: tfplan\\n\\nTo perform exactly these actions, run the following command to apply:\\n    terraform apply \\\"tfplan\\\"\"))), mdx(\"p\", null, \"Because Terraform knows the state of the existing Kubernetes resources, it will only need to change\\nthe deployment. Run the command \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform apply tfplan\"), \" to update the number of running replicas.\\nThey may take a few seconds to spin up, but re-running the command\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"kubectl get pods -n hello-world-namespace --kubeconfig=<your_kubeconfig_file_path>\"), \" should now show\\nthat there are three replicas of the application running! These can have traffic routed to them\\nthrough the load balancer and the service which was defined already.\"), mdx(\"p\", null, \"When you're ready to clean up the resources from this guide, Terraform offers another command that\\ncan help with that. Because it tracks state, it knows everything that needs to be removed. To see\\nwhat that would look like, enter \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform plan -destroy -out=tfplan\"), \" in a terminal and be sure to\\nstill be in the same working folder that contains \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform.tfstate\"), \". Something like what's below\\nshould be printed to the console:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-text\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"An execution plan has been generated and is shown below.\\nResource actions are indicated with the following symbols:\\n  - destroy\\n\\nTerraform will perform the following actions:\\n\\n  # helm_release.ingress_nginx will be destroyed\\n  - resource \\\"helm_release\\\" \\\"ingress_nginx\\\" {\\n      - atomic                     = false -> null\\n      - chart                      = \\\"ingress-nginx\\\" -> null\\n\\n...\\n\\n              - protocol    = \\\"TCP\\\" -> null\\n              - target_port = \\\"3000\\\" -> null\\n            }\\n        }\\n    }\\n\\nPlan: 0 to add, 0 to change, 5 to destroy.\\n\\n------------------------------------------------------------------------\\n\\nThis plan was saved to: tfplan\\n\\nTo perform exactly these actions, run the following command to apply:\\n    terraform apply \\\"tfplan\\\"\"))), mdx(\"p\", null, \"When you're sure that you're comfortable with everything being torn down, enter the command\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"terraform apply tfplan\"), \" and wait for it to complete. Every resource that was created by any apply\\nstep will now be gone. The output should look similar to what's below:\"), mdx(\"div\", {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }, mdx(\"pre\", {\n    parentName: \"div\",\n    \"className\": \"language-text\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"helm_release.ingress_nginx: Destroying... [id=ingress-nginx]\\nkubernetes_namespace.hello_world_namespace: Destroying... [id=hello-world-namespace]\\nkubernetes_service.hello_world_service: Destroying... [id=hello-world-namespace/hello-world-example]\\nkubernetes_ingress.ingress: Destroying... [id=hello-world-namespace/api-ingress]\\nkubernetes_ingress.ingress: Destruction complete after 1s\\nkubernetes_service.hello_world_service: Destruction complete after 1s\\nkubernetes_deployment.hello_world_deployment: Destroying... [id=hello-world-namespace/kubernetes-example-deployment]\\nkubernetes_deployment.hello_world_deployment: Destruction complete after 0s\\nhelm_release.ingress_nginx: Destruction complete after 3s\\nkubernetes_namespace.hello_world_namespace: Still destroying... [id=hello-world-namespace, 10s elapsed]\\nkubernetes_namespace.hello_world_namespace: Still destroying... [id=hello-world-namespace, 20s elapsed]\\n\\n...\\n\\nkubernetes_namespace.hello_world_namespace: Still destroying... [id=hello-world-namespace, 2m30s elapsed]\\nkubernetes_namespace.hello_world_namespace: Still destroying... [id=hello-world-namespace, 2m40s elapsed]\\nkubernetes_namespace.hello_world_namespace: Destruction complete after 2m47s\"))), mdx(\"h2\", {\n    \"id\": \"learn-more-about-how-architect-can-deploy-your-application-to-kubernetes-and-elsewhere\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Learn more about how Architect can deploy your application to Kubernetes and elsewhere\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#learn-more-about-how-architect-can-deploy-your-application-to-kubernetes-and-elsewhere\",\n    \"aria-label\": \"learn more about how architect can deploy your application to kubernetes and elsewhere permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Terraform can deploy your application to Kubernetes easily once templates are written, and all of\\nthe resources are defined. What happens when the next best thing comes along, though? Surely\\nTerraform would be able to handle deploying your application to another platform, but that would\\nrequire more maintenance, and likely an entire rewrite of all Terraform templates. With Architect,\\nyour application only needs to be defined once to be deployed anywhere. Find out more about\\ndeploying Architect components in our \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.architect.io/docs/\"\n  }, \"docs\"), \" and\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://cloud.architect.io/signup\"\n  }, \"try it out\"), \"!\"), mdx(\"p\", null, \"For more reading, have a look at some of our other tutorials!\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.architect.io/blog/rabbitmq-docker-tutorial\"\n  }, \"Implement RabbitMQ on Docker in 20 Minutes\")), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.architect.io/blog/kafka-docker-tutorial\"\n  }, \"Implement Kafka on Docker in 20 Minutes\")), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.architect.io/blog/gitops-developers-guide\"\n  }, \"A Developer\\u2019s Guide to GitOps\")), mdx(\"p\", null, \"If you have any questions or comments, don\\u2019t hesitate to reach out to the team on Twitter\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://twitter.com/architect_team\"\n  }, \"@architect_team\"), \"!\"));\n}\n;\nMDXContent.isMDXComponent = true;","excerpt":"Kubernetes is a powerful yet complicated container orchestration system. It can be used to run\nresilient workloads on virtually any cloud platform, including AWS, GCS, Azure, DigitalOcean, and\nmore…","tableOfContents":{"items":[{"url":"#project-dependencies-for-kubernetes-and-terraform","title":"Project dependencies for Kubernetes and Terraform"},{"url":"#define-kubernetes-resources-with-terraform","title":"Define Kubernetes Resources with Terraform"},{"url":"#use-terraform-to-create-kubernetes-resources-that-enable-cluster-access","title":"Use Terraform to create Kubernetes resources that enable cluster access"},{"url":"#use-terraform-to-modify-existing-kubernetes-resources","title":"Use Terraform to modify existing Kubernetes resources"},{"url":"#learn-more-about-how-architect-can-deploy-your-application-to-kubernetes-and-elsewhere","title":"Learn more about how Architect can deploy your application to Kubernetes and elsewhere"}]},"frontmatter":{"title":"Get Started with the Terraform Kubernetes provider","description":"Follow this tutorial to deploy a load-balanced “Hello World” application to Kubernetes with Terraform.","author":"Ryan Cahill","date":"2021-02-17","image":{"childImageSharp":{"gatsbyImageData":{"layout":"constrained","images":{"fallback":{"src":"/static/6a086a47f8eeec8379583d880c2fa6bd/7a23e/kubernetes-and-terraform.png","srcSet":"/static/6a086a47f8eeec8379583d880c2fa6bd/4ca58/kubernetes-and-terraform.png 250w,\n/static/6a086a47f8eeec8379583d880c2fa6bd/0251a/kubernetes-and-terraform.png 500w,\n/static/6a086a47f8eeec8379583d880c2fa6bd/7a23e/kubernetes-and-terraform.png 1000w,\n/static/6a086a47f8eeec8379583d880c2fa6bd/fca1d/kubernetes-and-terraform.png 2000w","sizes":"(min-width: 1000px) 1000px, 100vw"},"sources":[{"srcSet":"/static/6a086a47f8eeec8379583d880c2fa6bd/002ed/kubernetes-and-terraform.webp 250w,\n/static/6a086a47f8eeec8379583d880c2fa6bd/15bdf/kubernetes-and-terraform.webp 500w,\n/static/6a086a47f8eeec8379583d880c2fa6bd/27c85/kubernetes-and-terraform.webp 1000w,\n/static/6a086a47f8eeec8379583d880c2fa6bd/0dc98/kubernetes-and-terraform.webp 2000w","type":"image/webp","sizes":"(min-width: 1000px) 1000px, 100vw"}]},"width":1000,"height":563}}}}},"next":null,"previous":null}]}},"pageContext":{"slug":"terraform-kubernetes-tutorial"}},
    "staticQueryHashes": ["764694655"]}