Git Product home page Git Product logo

go-http's Introduction

The goal

To create a simplest http web-server in Golang, package it in the Docker image and deploy to k8s as a container.

Usage cases

Build and deploy to GKE or locally. Access the created host with :8080/helloworld. All the other URLs give the 404 error.

Dependencies

Build

The code supposed to be run only in container. Ensure, you have all the dependencies in place.

Makefile for local builds

make -f makefile

Builds and runs the code in the docker container locally. You shouldn't run binaries locally, if you suppose to run container in the cloud. Brings some other non-executing by default commands as well.

Docker run for local build and IDE

docker build -t latest . && docker run -p localhost:8080:8080 --name endocode latest -rm

Deploy

Deployment pipelines are defined in .github/workflows. There are kustomize - based pipeline, which utilizes the overlay way of making updates and helm-based pipeline, templating all the values. kust-pipeline.yml is set up to be run on push to master. helm-pipeline.yaml must be triggered manually.

When creating the pipelines priority was given to a predefined tasks over the inline scripts.

Debug

To debug the Go-code in the container, you want to run it with the following command, see k8s/base/deployment.yaml:

- tail - "-f" - /dev/null

then, open the bash in it:

kubectl exec --stdin --tty <POD-NAME> -- /bin/bash

go-http's People

Contributors

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