Code Monkey home page Code Monkey logo

eck-terraform's Introduction

Installing ECK with Terraform on GCP

On this page you will find a how to spin up ECK using terraform. The main idea is to have a Kubernetes cluster and ECK installed by running only 3 commands.

Demo

deployingeckwithterraform.mp4

Features

Every feature will be deployed via terraform

  • Install GKE (Google Kubernetes Enginee) cluster
  • It will contain 1 node pool with 3 nodes (One in each zone) running on region europe-west1
  • It contains a helm provider that will be responsible to install the ECK operator
  • Elasticsearch cluster with 3 nodes
  • One Kibana instance

Requirements

Before starting you should have the following commands installed:

Let's play

As you probably know, terraform is an infrastructure as code tool, which means we can describe our infrastructure desire into a file and apply it via terraform. Here, we are going to spin up a GKE cluster with 3 nodes running on europe-west1 region, the machines we are going to use is e2-standard-4 which will give us 4vCPU nad 16GB of memory in each node.

First, you have to authenticate into Google Cloud console, to so run the following command,

gcloud auth application-default login

Once you are logged it, you should export 2 variables, the Kubernetes config path AND the Google project you are going to use

export KUBE_CONFIG_PATH=~/.kube/config && export GOOGLE_PROJECT=<YOUR-PROJECT-NAME>

Now, you can run

terraform init

It will load the providers and configuration. Right after that, you should run

terraform plan

It will show you everything that will be created by terraform, take a moment to check this output. Once you are ready, you just need to run:

terraform apply -parallelism=1

It will apply your changes in sequence. Once everything was applied, you will get an output similar to this,

Apply complete! Resources: 7 added, 0 changed, 0 destroyed.

Outputs:

gke_name = "TO CONNECT TO KUBERNETES: gcloud container clusters get-credentials <KUBERNETES-NAME> --region europe-west1 --project <YOUR-PROJECT-NAME>"
kibana_endpoint = "TO CONNECT TO KIBANA: kubectl port-forward svc/<KIBANA-ENDPOINT> 5601:5601"
kubernetes_name = "fram-gke-eck"

Once you port-foward your kibana service, you can easily access it on your browser via localhost.

Wrapping up

Now, to clean up everything you just need to run

terraform destroy

Happy terraform!

eck-terraform's People

Contributors

framsouza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.