Skip to content

Several k8s & container tools for development of Go services

License

Notifications You must be signed in to change notification settings

delineateio/k8s-go-tool-example

Repository files navigation

PRs Welcome Contributors Forks Stargazers Issues MIT License


delineate.io

delineate.io

portray or describe (something) precisely.

k8s Go Tooling Example

Demonstrates a combination of k8s related tools for efficient build, test and deployment of Go microservices.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

This repo demonstrates a combination of k8s related tools that when used in combination provide an efficient build, test and deployment pipeline for developing Go microservices.

  • Using ko to create distroless images from go source code
  • Using kustomize to dyanmically transform k8s manifests before deployment
  • Using skaffold to manage a build, test and deploy opinionated pipeline

In addition to this DevContainer has been used to package the local development environment.

What's been built

Two "unique" services have been containerised that run in the background with no API, one is English and one is Spainish 🇬🇧🇪🇸, and print hello to the stdout.

logs

In addition to these two services, they have been packaged in a pod with a k8s echo server container. When running, the echo server can be accessed using http :8080 either from the host of from within the dev container.

Built With

Syntax Description
pre-commit Pre-commit git hooks that perform checks before pushes
GitHub Source control management platform
Go Writing of the example containerised services
Docker Used to providr the devcontainer
Kubernetes Provide the hosting of the containerised applications

Local Setup

Dev Container

The local development environment is provided using devcontainer which is natively supported in VSCode as described here. This has been used to show how this approach signficantly reduces local requirements.

Kubernetes

This examples repo relies on having access to a running local or remote k8s cluster, correctly setup and accessible with kubectl using kubectl cluster-info.

As part of the development container provisioning the [kube-config](.devcontainer/.kube-config.sh) script replicates the hosts $HOME/.kube/config` within the container.

This particular implementation has only been tested using minikube configured to use the VMWare driver.

Usage

Inside the container using the VSCode integrated terminal the following commands can be used...

# builds, deploys (1 pod) and watches for changes
task single:dev

#  alternatively, this builds and deploys once
task single:run

# cleans up the cluster
task cleanup

# builds, deploys a scaled example (3 pods)
task scaled:dev

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

If you would like to contribute to any delineate.io OSS projects please read:

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

About

Several k8s & container tools for development of Go services

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published