Giter Club home page Giter Club logo

k8s-sample-app's Introduction

k8s-sample-app

Example app that uses k8s for deployment

Deployment

A kubernetes deployment descriptor is provided, if needed modify the VERSION property Makefile then run the following

make
kubectl create -f k8s-sample-app.yml

watch

watch -n 0.2 -d http --timeout 1 `minikube service k8s-sample-app --url`/foo

Deployment kubectl commands

Create deployment

kubectl create -f k8s-sample-app.yml

Update deployment after making a change to k8s-sample-app.yml

kubectl replace -f k8s-sample-app.yml

View deployment status

kubectl rollout stuats deployments k8s-sample-app

Rollback deployment

kubectl rollout undo deployment/k8s-sample-app

Scale deployment

kubectl scale deployment k8s-sample-app --replicas 10

Auto scale deployment

kubectl autoscale deployment k8s-sample-app --min=1 --max=10 --cpu-percent=80

SSH access container

kubectl exec -it <pod id> -- /bin/ash

Service Discovery

Kubernetes will automatically allow services to be addressable via their service name.

kubectl create -f k8s-sample-app2.yml

Get logs for app2

kubectl logs <pod id>

ConfigMaps

Kubernetes can manage application configuration using ConfigMaps

kubectl create -f k8s-sample-configmap.yml

Interact with the container

watch -n 0.2 http --timeout 1 `minikube service k8s-sample-configmap --url`/bar

Change the ConfigMap value

kubectl edit configmap sample-configmap

Restart the pod to pick up the changes

kubectl delete pod <pod id>

k8s-sample-app's People

Contributors

curtisallen 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.