Giter Site home page Giter Site logo

hello-world-gke's Introduction

hello-world-gke

Hello world application deployed to Google Cloud Kubernetes Engine

Prerequisites

Google Cloud SDK

This demo application will be deployed to Google Cloud Platform. As such, you will need a Google Cloud account in order to deploy this to your own project.

You can click here to create a Google Cloud account and receive $300 in promotional credits.

Note: This demo exercise will cost money to run, so it is highly recommended to sign up for the $300 free credit. While Google Cloud does have an "always free" tier, this will not completely cover the resources used for this exercise.

After signing up, a billing account called "My Billing Account" with $300 promotional credits should have been created for you. This account will be used for the duration of this exercise.

The next step is to download the Google Cloud SDK. This tool will allow you to obtain credentials for your Google account that will be provided to the tools / scripts used to provision this environment. It will also allow you to query for information about your Google Cloud project(s) using a command line interface.

Once your gcloud CLI is set up, the following command can be used to authenticate yourself with your Google account:

$ gcloud auth login

Optionally, you can also run the following command to authenticate any applications that you run locally to use your Google account when communicating to Google APIs:

gcloud auth application-default login

Docker

The only other prerequisite required for this exercise is Docker. While this exercise takes advantage of several different tools to provision infrastructure, such as Terraform, Helm, and the Kubernetes CLI, each of these tools will be wrapped within a Docker image that can be built and used locally.

Deploying the exercise

The following command can be used to deploy this exercise:

$ make up

This command will build the image used for this exercise, and use it to run terraform, helm, and kubectl to provision the environment for you.

When you run this, you will be prompted to enter a value for your Google Cloud Project ID. This is a string value that must be unique across all of Google Cloud.

You will also be prompted to type the string yes during the terraform apply step.

Cleaning up

The following command can be used to clean up all resources deployed within this exercise:

$ make down

You will be prompted to enter the string yes to confirm that you want to destroy the resources provisioned during this exercise.

Tools used

  • Terraform - used to provision and configure all of the Google Cloud infrastructure. The code for this can be found in the tf folder.
  • Helm - used to deploy the demo application and the cert-manager and nginx-ingress charts.
  • kubectl - used to interact with the provisioned Kubernetes cluster
  • jq - used to parse JSON output from various commands

Helm charts used

  • cert-manager - used to create a CA and SSL certificate to enable HTTPS communication with our app.
  • nginx-ingress - used to enable ingress into our cluster using the Ingress API. This ingress controller consumes the certificate created by cert-manager and handles SSL termination for our application.

Demo application

The application that will be deployed to your Kubernetes cluster during this exercise is a Node.js based app that returns a JSON payload at /. The source code can be found within the app folder. This code has already been packaged into a Docker container that can be found at mrparkers/hello-world-gke.

The helm chart used for this application can be found within the k8s/app folder.

hello-world-gke's People

Contributors

mrparkers avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.