Giter Club home page Giter Club logo

kapitan-reference's Introduction

Kapitan Reference Setup

This repository is meant to be a way to bootstrap your Kapitan setup to get you up and running.

It is meant to help you make use of best practices and libraries that can make Kapitan the ultimate tool for all your configuration needs.

Quickstart

$ git clone [email protected]:kapicorp/kapitan-reference.git kapitan-templates
$ cd kapitan-templates

$ ./kapitan compile
Compiled postgres-proxy (1.51s)
Compiled tesoro (1.70s)
Compiled echo-server (1.64s)
Compiled mysql (1.67s)
Compiled gke-pvm-killer (1.17s)
Compiled prod-sockshop (4.74s)
Compiled dev-sockshop (4.74s)
Compiled tutorial (1.68s)
Compiled global (0.76s)
Compiled examples (2.60s)
Compiled pritunl (2.03s)
Compiled sock-shop (4.36s)

Slow walk-through

Manifest Generator Documentation

Tools

This repo comes already with some helper tools. We will expand it as the time goes.

For now, you can see that the ./kapitan file is a wrapper script that allows you to run kapitan without installing any binary (it does depends on docker!)

Note: For speed, if kapitan is already installed, it will prefer the non-docker version.

Script Description
./kapitan Wrapper script to invoke kapitan
generate_sa_secrets.sh Templated script to automatically inject service accounts into refs
import_kubernetes_cluster.sh Helper scripts that looks for GKE cluster and automatically imports them into the inventory

Libraries

This repo already packs some important libraries that you will want to have when working with kapitan.

Name Description Inventory file
kube-libsonnet bitnami-labs kube library kube.yml
kubernetes-generator Synthace manifests generator generators/kubernetes.yml
ingresses-generator Synthace ingresses generator generators/ingresses.yml
utils helpful utilites
kap Kapitan boilerplate in one file

Kapitan allows you to manage external dependencies like the above libraries. For instance, in the spinnaker.yml file, the "dependencies" directive tells Kapitan where to find the library.

To update them, run:

./kapitan compile --fetch
Dependency lib/kube.libjsonnet : already exists. Ignoring
./kapitan compiledd
Compiled tesoro (1.70s)
Compiled echo-server (1.64s)
Compiled mysql (1.67s)
Compiled gke-pvm-killer (1.17s)
Compiled prod-sockshop (4.74s)
Compiled dev-sockshop (4.74s)
Compiled tutorial (1.68s)
Compiled global (0.76s)
Compiled examples (2.60s)
Compiled pritunl (2.03s)
Compiled sock-shop (4.36s)

Generators

As explained in the blog post Keep your ship together with Kapitan. generators are a powerful idea to simplify the management your setup.

We will release initially generators for kubernetes manifests, terraform and spinnaker pipelines.

For now, only the manifests and ingresses generators are available

Manifests generator

The manifests generator allows you to quickly generate Kubernetes manifests from a much simpler yaml configuration.

The aim for this approach is to allow you to cover the vast majority of the needs you will have for your components. More complex scenarios can also be achieved by expanding the library, or implementing your own template.

Examples

To help you get started, please look at the following examples:

source description output
mysql Example MySQL statefulset manifests
echo-server Example using echo-server manifests
gke-pvm-killer Example using estafette-gke-preemptible-killer manifests
postgres-proxy Example using cloud-sql-proxy to connect to a Cloud SQL Postgres instance manifests
logstash Example of Logstash configuration manifests
tesoro Example of tesoro configuration manifests
pritunl Example of pritunl configuration manifests

Please find the generated manifests in the compiled folder

Ingresses generator

The ingresses generator adds to the manifests generator the ability to easily define ingress resources.

Examples

To help you get started, please look at the following examples:

source description output
echo-server Defining ingress paths using echo-server manifests

Documentation

Request or submit your examples

We have used this generator extensively, and we know it covers the majority of the use cases. If you want a specific example, please let us know (or submit your PR)

By adding more example we will be able to stress test the library to make sure we really satisfy all the most common use cases.

kapitan-reference's People

Contributors

ademariag avatar moep90 avatar alanhughes 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.