Giter Club home page Giter Club logo

cloud-native-go's Introduction

Prerequisites

In order to build and run this showcase you need to have a couple of things installed:

Building the showcase

In case you have make installed you can simply issue the following command to build and install the application:

$ go env -w CGO_ENABLED=0
$ go install -a ./... # or make install

In case you want to give Wercker a try (make sure you have the Wercker CLI installed) you can issue the following command:

$ wercker dev --publish 8080 

This will build and run the microservice, and also watch for changes to the sources. If you only want to run the Wercker build pipeline use the following command:

$ wercker build 

Running the showcase

You have two options. Either build and run the showcase locally, or build and run the Docker image.

$ docker build -t cloud-native-go:1.0.2 . # or make docker
$ docker run --name cloud-native-go -it -p 18080:8080 cloud-native-go:1.0.2

Now open a browser or use somethin like curl or HTTPie and issue a GET request on the URL http://localhost:18080/api/hello

Deploying to Kubernetes

We will be using Minikube to run a small Kubernetes cluster locally. Make sure you have build the Docker image locally.

$ kubectl create -f k8s-deployment.yml
$ kubectl get deployments pods
$ kubectl scale deployment cloud-native-go --replicas=3
$ kubectl get pods
$ kubectl get services

If you want to access the Go microservice you need to use the node port displayed by the last command, e.g. http GET localhost:32278/api/hello

License

This software is provided under the MIT open source license.

This is a ported version of M.-Leander Reimer (@lreimer), read LICENSE file for details.

cloud-native-go's People

Contributors

hiveminded avatar kataras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cloud-native-go's Issues

Breaking change made in Iris

Iris made a breaking change which in turn leads to a failure in make docker. The issue is discussed here.
the output of make docker is:

# github.com/kataras/iris/core/errgroup
src/github.com/kataras/iris/core/errgroup/errgroup.go:109:9: undefined: errors.Unwrap
src/github.com/kataras/iris/core/errgroup/errgroup.go:118:8: undefined: errors.Is
src/github.com/kataras/iris/core/errgroup/errgroup.go:125:10: undefined: errors.Is
src/github.com/kataras/iris/core/errgroup/errgroup.go:137:8: undefined: errors.As
src/github.com/kataras/iris/core/errgroup/errgroup.go:150:10: undefined: errors.As
# github.com/kataras/iris/context
src/github.com/kataras/iris/context/context.go:2859:6: undefined: errors.Is

Not able to run in docker

I get the error with this command.

docker run --name butt-native-go -it -p 18080:8080 butt-native-go:1.0.0

listen tcp: address ::8080: too many colons in address

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.