Coder Social home page Coder Social logo

ghw-december's Introduction

GHW-December ๐ŸŽ…๐ŸŽ…

Notes and resources for GHW December stream on Deploying your first Kubernetes Cluster

Setting up ๐Ÿ–ฅ๏ธ

  1. Install Git
  2. Install Node
  3. Install Docker Desktop
  4. Create an account on Docker Hub
    1. Login to Docker Desktop with your docker account
    2. Login to Docker CLI docker login (more info)
  5. Clone this repo
    1. https: https://github.com/ashwinexe/GHW-December.git
    2. ssh: [email protected]:ashwinexe/GHW-December.git

Conterize your app ๐Ÿš€

  1. Check out the Dockerfile to understand what's happening
  2. Login to your docker account in your shell docker login
  3. Run `docker build -t <docker_username>/<image_name>:<version_number> .
  4. It shoudl look like this:
   โžœ  GHW-December git:(main) โœ— docker build -t ashwinexe/ghw:1.0 .
Sending build context to Docker daemon  9.639MB
Step 1/6 : FROM node:current-slim
 ---> b131f467b9ea
Step 2/6 : LABEL MAINTAINER="[email protected]"
 ---> Running in ad644f733bb0
Removing intermediate container ad644f733bb0
 ---> 80536b85f226
Step 3/6 : COPY . /src
 ---> a0d5b1092b14
Step 4/6 : RUN cd /src; npm install
 ---> Running in 69961af002d6

up to date, audited 97 packages in 5s

12 packages are looking for funding
  run `npm fund` for details
Successfully built 1f2bfa5b0245
Successfully tagged ashwinexe/ghw:1.0

Notice the "." in the end is crucial, it tells docker that all the files in the local directory get compressed and sent to the Docker daemon.

  1. Run your docker image with port exposed:
    1. docker run -p 8080:8080 ashwinexe/ghw:1.0
    2. Check localhost:8080 in your browser

Fact: 8080:8080 means any request coming for port 8080 will be forwarded to service running on port 8080 inside your container. simply put
docker run -p Port for Outside World: Actual Port of service in container ashwinexe/ghw:1.0

Enable Kuberenetes ๐Ÿ•น๏ธ

There are several ways to run kubernetes locally on your machine. Docker Desktop is the easier way to get started

Still curious? Check out Kind, minikube and kubeadm which are also popular choice to run kubernetes locally

  • Run Docker Desktop -> Settings -> Kubernetes -> Toggle Enable Kubernetes -> Check Kubernetes status at the bottom

  • Open command terminal and run kubectl get nodes your output should look like:
kubectl get nodes
NAME             STATUS   ROLES           AGE     VERSION
docker-desktop   Ready    control-plane   5d11h   v1.25.2

Hurray! You got your own Kubernetes cluster running! ๐Ÿฅณ

Extra Resources ๐Ÿ’ƒ

ghw-december's People

Contributors

ashwinexe avatar

Stargazers

 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.