Code Monkey home page Code Monkey logo

examples's Introduction

Kubernetes Patterns

Kubernetes Patterns - Examples

Creative Commons License

This GitHub project contains the examples from Kubernetes Patterns - Reusable Elements for Designing Cloud-Native Applications book by Bilgin Ibryam and Roland Huß

Installation instructions for the example prerequisites are summarised in INSTALL. By default, you need access to a vanilla Kubernetes installation, like Minikube. If addons are required, the example description explains this additional requirement.

For feedback, issues or questions in general, please use the issue tracker to open issues. Also, we love contributions like spelling fixes, bug fixes, improvements, …​ Please open Pull Requests, we are happy to review them!

Patterns

All example are categorised according to the Book’s patterns category. Each of the examples is contained in an extra directory per pattern and is self-contained. [1]

Foundational Patterns

Predictable Demands

Our sample random generator dealing with hard requirements on ConfigMap and PersistentVolumeClaims as well as with resource limits.

Declarative Deployment

Rolling and fixed update of the random generator Deployment from version 1.0 to 2.0.

Health Probe

Liveness and Readiness probes for the random generator.

Managed Lifecycle

postStart and preStop hooks demonstrated with the random generator application.

Automated Placement

Example with node selector, pod and node affinity, taint and tolerations demonstrated.

Behavorial Patterns

Batch Job

Generate thousands of random numbers into a file with a batch job

Periodic Job

Reuses the Batch Job example, but runs it periodically at a configured schedule

Daemon Service

Sample maintenance script for maintenance jobs on every node of a cluster

Singleton Service

Example of a PodDisruptionBudget for controlling voluntary disruptions

Stateful Service

StatefulSet example for our random-generator

Service Discovery

Various ways how to access our random-generator REST service

Self Awareness

Using the Downward API for setting environment variables and mount resource fields as files with the random-generator service.

Structural Patterns

Init Container

Initialize a HTTP server’s HTML source from a remote git repository

Sidecar

Git polling example for a sidecar

Adapter

Adapter for exporting timing information from the sample random-generator application in a Prometheus format

Ambassador

Ambassador for moving on the log of the random-generator

Configuration Patterns

EnvVar Configuration

A simple example of how to use environment variables literally and from ConfigMaps and Secrets for our random-generator service.

Configuration Resource

Example how to configure the random-generator Spring Boot application with a ConfigMap

Immutable Configuration

Several examples of how to use immutable configuration containers for application configuration. This includes examples for the plain Docker case and for Kubernetes.

Configuration Template

Example how to use a template configuration standalone.xml which is processed with a template processed and filled with data from ConfigMap before a Wildfly server is started.

Advanced Patterns

Controller

Simple, pure shell based controller which watches ConfigMap resources for changes and restarts Pods by using a label selector provided as annotation. An additional example controller exposes an Ingress route when it detects an exposeService label attached to the service.

Operator

Operator based on the ConfigMap watch controller and introduces a CRD ConfigWatcher which connects a ConfigMap with a set of Pods to restart in case of a config change.

Elastic Scale

Horizontal and vertical scaling examples with the random-generator Service [*]

Image Builder

Setup a chained build on OpenShift and use Knative build for doing builds within the cluster.


1. Examples marked with an "*" are functional but still, lack the full instruction set for running the examples. If you feel adventurous, please try out the provided resource files yourself. Happy to take also PRs, did we already mention that we love contributions? ;)

examples's People

Contributors

bibryam avatar rhuss avatar sto avatar

Stargazers

 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.