Giter Site home page Giter Site logo

simple-go's Introduction

simple-go

starting the server locally

build

docker build -t miloofcroton/simple-go:1.0.1 .

or

GOOS=linux GOARCH=amd64 go build
docker build -t miloofcroton/simple-go:1.0.2 -f Dockerfile-v2 .

or

docker-compose build

push

(not necessary with docker-compose)

docker push miloofcroton/simple-go:1.0.2

run

(replace 9090 with any port number)

docker run \
    -it \
    -e "PORT=9090" \
    -p 9090:9090 \
    simple-go:1.0.1

or

docker-compose up

the k8s way, locally

start k8s

minikube start

start an object

note: make sure you have your docker images built and pushed to docker hub

kubectl create -f cluster/app-pod.yml
kubectl create -f cluster/app-pod.yml --namespace simple-go
kubectl create -f cluster/app-namespace.yml
kubectl apply -f cluster

forward a port

kubectl port-forward simple-go-pod 8080:8080

check objects

kubectl get pods
kubectl get pods -w
kubectl get pods,deployments,ns
kubectl get pods --show-labels
kubectl get pods -o wide -L env
kubectl get pods --namespace simple-go

add label

kubectl label pod simple-go-pod hello=world
kubectl label pod simple-go-pod env=prod --overwrite

remove an object

kubectl delete -f cluster/app-pod.yml
kubectl delete pod simple-go-pod
kubectl delete -f cluster/app-namespace.yml
kubectl delete -f cluster

scale

kubectl scale deployment simple-go --replicas=5

check history

kubectl rollout history deployment simple-go

update images

kubectl set image deployment simple-go simple-go=miloofcroton/simple-go:1.0.4

undo image update

kubectl rollout undo deployment simple-go

simple-go's People

Contributors

miloofcroton avatar

Watchers

James Cloos avatar  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.