GithubHelp home page GithubHelp logo

docker-k8s-helloworld's Introduction

docker-k8s-helloworld

A 'Hello World' example of building containers and deploying in Docker runtime & k8s (minikube)

Pre-req:

Build Docker Container

Build the Docker container and run it as 'hello-app'

docker build --tag hello .
docker run -d --name hello-app -p 5000:5000 hello

Confirm status with

docker images
docker ps

Test with browser or curl: localhost:5000

Build & Deploy on Minikube

  1. Start Minikube
minikube start
  1. Set Docker env
eval $(minikube docker-env)
  1. Build image again
docker build --tag hello .
  1. Enable ingress in minikube

Confirm that the ingress pod is running in 'kube-system' namespace.

minikube addons enable ingress
kubectl get pods -n kube-system
  1. Run the deployment and create a service for nodeport 5000
kubectl run hello --image=hello:latest --image-pull-policy=Never --port=5000
kubectl expose deployment hello --type=NodePort --port=5000
  1. Get IP address to reach the pod via minikube url
minikube service hello --url

Test with browser or curl: <ip:port> from the last command above

docker-k8s-helloworld's People

Contributors

5abeel avatar

Watchers

 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.