Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Docker images for Kubernetes Application Upgrade

Docker Container

  1. Build Docker images:

    docker image build -t arungupta/app-upgrade:v1 app-v1
    docker image build -t arungupta/app-upgrade:v2 app-v2
  2. Run Docker container:

    docker container run -d -p 8080:8080 arungupta/app-upgrade:v1
    docker container run -d -p 8081:8080 arungupta/app-upgrade:v2
  3. Access v1 application:

    curl http://localhost:8080
    Hello World!
  4. Access v2 application:

    $ curl http://localhost:8081
    Howdy World!

Kubernetes

  1. Run pod:

    kubectl run app-v1 --image=arungupta/app-upgrade:v1
    kubectl run app-v2 --image=arungupta/app-upgrade:v2
  2. Publish service:

    kubectl expose deployment/app-v1 --target-port=8080 --port=8080 --name=app-v1
    kubectl expose deployment/app-v2 --target-port=8080 --port=8081 --name=app-v2
  3. Access v1 application (on minikube):

    curl http://localhost:8080
    Hello World!

    For a Kubernetes cluster running on AWS, you need to run proxy and access the application using http://localhost:8001/api/v1/proxy/namespaces/default/services/app-v1/.

  4. Access v2 application:

    curl http://localhost:8081
    Howdy World!