Giter Site home page Giter Site logo

novarstar42 / kubernetes-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from containersolutions/kubernetes-examples

0.0 0.0 0.0 283 KB

Minimal self-contained examples of standard Kubernetes features and patterns in YAML

Home Page: https://k8s-examples.container-solutions.com/

License: MIT License

Shell 90.32% Makefile 9.68%

kubernetes-examples's Introduction

yamllint

Kubernetes Examples

A reference repository of YAML with canonical and as-simple-as-possible demonstrations of kubernetes functionality and features.

See here for a searchable front-end: https://k8s-examples.container-solutions.com/

Kubernetes Examples

Why?

At Container Solutions we find we regularly need chunks of YAML to demonstrate something specific, such as:

  • A simple deployment

  • A simple pod

  • A pod with a volume

This might be to do a basic test of an environment, find an example to tinker with, or send to someone to get them going.

Usage

The examples can be used by a kubectl plugin examples. This plugin can be installed by krew:

  • first install krew
  • Install a custom plugin index: kubectl krew index add cs https://github.com/ContainerSolutions/kubernetes-examples.git
  • Install this plugin: kubectl krew install cs/examples

Interactively discover by first selecting the resource type:

$ kubectl examples

filter by resource type

$ kubectl examples Service

filter by resource type and pattern

$ kubectl examples Pod res

If there is only a single match selected by the parameters, it is printed to the stdout. So you can deploy a modified version of a sample by:

$ export KUBE_EDITOR='code -w'
$ kubectl examples Ingress fanout | kubectl create -f - --edit

Sections

broken-* - yamls that exemplify broken kubernetes yaml states

[A-Z][a-zA-Z]* - Example yamls that correspond to resource types.

test - Scripts to test or validate the YAML

Within those folders are either simple/canonical examples, or examples in subfolders that expose particular items of functionality that are highlighted by their yaml path, eg Pod/spec.initContainers/.

If an example is an exemplar of a particular feature but tightly related to another resource, then an absolute folder might be added eg in Service there is Service/Pod.spec.subdomain.

Symlinks are also used to make finding things easier, eg Service/headless-service -> Service/spec.clusterIP.

plugins - a directory following the spec for a Custom krew plugin index

Principles

The examples seek to be:

  • As simple as possible to illustrate the functionality

  • Self-contained (ie limited to one .yaml file)

  • Non-conflicting (eg resource names are unique)

  • Clear (eg resource names are verbose and unambiguous)

Release Process

See here

Sources / Thanks To

Official Kubernetes docs

Kubernetes by Example

Practical Kubernetes

Security Examples

kubernetes-examples's People

Contributors

ianmiell avatar sebagomez avatar lalyos avatar knelasevero avatar eliottha avatar anoopmsivadas avatar melihc1 avatar amouat avatar chris-cmsoft avatar actions-user avatar gt-sun avatar 3t8 avatar shteou avatar ttarczynski 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.