Coder Social home page Coder Social logo

codemotion2017-workshop's Introduction

Codemotion 2017 Workshop - Microservices in production with Kubernetes

This repo corresponds to a workshop done in the Codemotion 2017 event. Slides can be found HERE slides

Initial steps

This workshop is based on Google Cloud Platform [Container Engine] which gives a very simple way of creating and managing Kubernetes clusters.

It is recomended to use the free trial that Google offers to try all its services. offer

Create Cluster on Google Cloud Platform

Cluster can be created through the Cloud Console or using the [gcloud] bash utility. (The )

gcloud container clusters create codemotion-cluster --num-nodes=3

offer

Install kubectl

Follow the instalation guide according to your OS.

Configure kubectl

Get the credentials needed for kubectl to authentikate and be able to manage your cluster. Note that you have to put your own data instead of codemotion-cluster or the project's name codemotion

gcloud container clusters get-credentials codemotion-cluster --project codemotion

Now, you should be able to access your cluster using kubectl.

kubectl get nodes
NAME                                                STATUS    AGE       VERSION
gke-codemotion-cluster-default-pool-548f897f-4d0p   Ready     51m       v1.7.8-gke.0
gke-codemotion-cluster-default-pool-548f897f-5sx5   Ready     51m       v1.7.8-gke.0
gke-codemotion-cluster-default-pool-548f897f-h18m   Ready     51m       v1.7.8-gke.0

Setup a custom namespace

Once kubctl works, it is a good practice to create a namespace in order to isolate your system from others in your cluster. In this case the namespace name will be chat.

kubectl create namespace chat
# set kubctl to use chat namespace as default
kubectl config set-context $(kubectl config current-context) --namespace=chat
# check current namespace
kubectl config view | grep namespace:

Syncronize docker-chat repo

The codebase of this workshop is based on another project called docker-chat, which is a very example of system using containers, microservices and a lot of other technologies.

It is needed to download the repo to get all the code that will be used through the workshop.

git clone https://github.com/ageapps/docker-chat

Now, copy the content of the repo into the demo directory. As an example you could use rsync.

rsync -r ../docker-chat/ ./demo/

ANY ADITIONAL INFORMATION NEEDED CAN BE FOUND IN THE docker-chat REPOSITORY.

Task 1

This task will use docker-compose as a tool to make a basic local deployment.

Jump to task 1 directory.

Task 2

This task will use docker-compose as a tool to make a deployment similar to the one deployed in Kubernetes.

Jump to task 2 directory.

Task 3

This is the actual Kuberentes deployment Jump to task 3 directory.

Resources

  • Docker: Software containerization platform
  • SocketIOChatDemo: Chat web application.
  • NodeJS: Server enviroment.
  • MongoDB: NoSQL database system.
  • mongoose: MongoDB object modeling for node.js.
  • docker-build: Automated build of Docker images.
  • docker-compose: Automated configuration and run of multi-container Docker applications.
  • Kubernetes: Open-source system for automating deployment, scaling, and management of containerized applications.

codemotion2017-workshop's People

Contributors

ageapps avatar

Stargazers

 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.