No time to explain! or how to make terraform with minikube and kubernetes
How to start using terraform by expanding locally the application on top of minikube and then start it over kubernetes cloud.google.com
Minikube
first set up minikube and with terraform will deploy our application, this has prepared project. Remains only:
-
the
- Install VirtualBox the
- Install Vagrant the
- to Make the repository copy ultral/terraform-example the
- to Make
thevagrant up
On output, we have a virtual machine at 192.168.56.123 c login/password vagrant/vagrant and/or your public key for the users root and vagrant.
Google cloud
this is where things get interesting, we will connect to cloud.google.com there and launch our app.
-
the
- Register https://cloud.google.com to get $ 300 the
- On the deployed VM do
gcloud init
and follow instructions
thegcloud init
the - the instructions get the key in developer console and put in /root/.gcloud/terraform.json virtual machine the
- Creates a cluster cloud.google.com
thegcloud container clusters create gke-cluster gcloud container clusters list
the - Get turnout/passwords to connect to kubectl cloud.google.com
the[root@terraform-terraform adm]# gcloud container clusters get-credentials gke-cluster Fetching cluster endpoint and auth data. kubeconfig entry generated for gke-cluster.
the - Toggle context kubectl
the[root@terraform-terraform adm]# kubectl config use-context gke_tutorial-project-183818_europe-west1-d_gke-cluster Switched to context "gke_tutorial-project-183818_europe-west1-d_gke-cluster".
the - Rename the context kubectl (he's listed in terraform)
the[root@terraform-terraform adm]# kubectl config rename-context gke_tutorial-project-183818_europe-west1-d_gke-cluster gke_tutorial Context "gke_tutorial-project-183818_europe-west1-d_gke-cluster" was renamed to "gke_tutorial".
the - Prepare variables for image and likeness to terraform
thecp /vagrant/terraform/terraform.tfvars.example /vagrant/terraform/terraform.tfvars vi /vagrant/terraform/terraform.tfvars
the - Prepare and apply terraform
theworkspace terraform new prod terraform init terraform plan terraform apply
the - Now you can get the address of our application log through the browser. We're good.
theterraform output lb_ingress
the - dotting a few I's a
theterraform destroy gcloud container clusters delete gke-cluster
Conclusion
Terraform was not so terrible. Terraform open space to structure and sustain environments in identical condition.
Комментарии
Отправить комментарий