Join us
@sam1474u ・ Dec 11,2021 ・ 1 min read ・ 1761 views ・ Originally posted on medium.com
Provisioning Kubernetes cluster using terraform. In this article, I am going describe the requirements to provision a Kubernetes cluster on OCI using terraform and deploying an application on Kubernetes cluster
The next-generation cloud is designed to run any application, faster and more securely, for less. Try Oracle Cloud for free
Oracle Cloud Infrastructure Container Engine for Kubernetes is a fully-managed, scalable, and highly available service that you can use to deploy your containerized applications to the cloud. Use Container Engine for Kubernetes (OKE) when your development team wants to reliably build, deploy, and manage cloud-native applications
Terraform is an infrastructure as code (IaC) tool that allows you to build, change, and version infrastructure safely and efficiently. This includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc.
PART 1
OCI Terraform Module https://github.com/oracle-terraform-modules/terraform-oci-oke
For creating a OKE cluster what you need
Step 1: Clone the terraform from git and cd terraform-oci-oke folder
Step 2: cp terraform.tfvars.example terraform.tfvars
Step 3: Finish Prerequisites or Check my Video(coming soon..)
Create a provider.tf file in root add 2 providers
Provider 1 -home regions
Provider 2- the current region where you want to provision your cluster.
provider "oci" {
fingerprint = var.api_fingerprint
private_key_path = var.api_private_key_path
region = var.region
tenancy_ocid = var.tenancy_id
user_ocid = var.user_id
}
provider "oci" {
fingerprint = var.api_fingerprint
private_key_path = var.api_private_key_path
region = var.home_region
tenancy_ocid = var.tenancy_id
user_ocid = var.user_id
alias = "home"
}
step 4: Run terraform init command in the root folder
Step 4: Modify terraform.tfvars and add the fields copied in the prerequisites
For example:
Step 5: Run terraform plan command in the root folder to check any actions are required.
Step 6: Run terraform apply command in the root folder. This would create your OKE Cluster
Join other developers and claim your FAUN account now!
Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.