Code Monkey home page Code Monkey logo

deploy-game's Introduction

In this example you will learn:

How to write a pod definition in Kubernetes. 

How to expose the pod by writing a service

Why writing a pod directly is a bad idea and how Replicaset solves it

Drawbacks of Replicaset

How Deployment solves issue with replicaset

Docker commands to build image of the application:

docker build -t webserver-image:v1 .

docker images

docker run -d -p 80:80 webserver-image:v1

Make sure the main file is named index.html

Steps:

Have the game in folder Create Dockerfile Create image Deploy the image in a pod Write Deployment yaml Deploy in gcloud

Steps to create docker image and push it to registry:

docker login

docker build -t "game:v0" .

docker images

docker tag game:v0 emailtovamos/game-repo

docker push emailtovamos/game-repo

Ensure you have VirtualBox running and the current-context of kubectl is set to be minikube:

minikube start

kubectl config get-contexts

kubectl config use-context minikube

Run the yaml files:

kubectl apply -f pod.yaml

kubectl apply -f service.yaml

kubectl apply -f deployment1.yaml

Test:

A test might be to check if setting a highscore gets reflected while you try to get the highscore. CircleCI can be included with this test. Also to deploy to Google Cloud.

Backend:

Make the game harder by making shapes smaller if a user plays well. These decisions can be made in another service running on Go backend. There can be gRPC connections between this service, the highscore service and the BFF service.

deploy-game's People

Contributors

emailtovamos avatar satyajituk avatar deveshjoshi101 avatar

Forkers

prernarawat7

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.