Giter VIP home page Giter VIP logo

common-chart's Introduction

Common: The Helm Helper Chart

One little-know feature of Helm charts is the ability to share chart definitions among all templates in a chart, including any of the subchart templates.

The common chart is a chart that defines commonly used Chart primitives that can be used in all of your charts.

See the Documentation for complete API documentation and examples.

Repository

The Common chart is served out of a GitHub Pages Repository. To register the repository, do this:

$ helm repo add common https://technosophos.github.io/common-chart/

Example Usage

Create a new chart:

$ helm create mychart

Include the common chart as a subchart:

$ cd mychart/charts
$ helm fetch common

Use the common.* definitions in your code. For example, we could add this to a chart's templates/service.yaml.

apiVersion: v1
kind: Service
metadata:
  name: {{ include "common.fullname" . }} # <--- THE IMPORTANT PART
  labels:
{{ include "common.labels.standard" . | indent 4 }} # <--- Ooo... look.
spec:
  type: {{ .Values.service.type }}
  ports:
  # common.port handles formatting of port numbers.
  - port: {{ include "common.port" .Values.service.externalPort }}
    targetPort: {{ include "common.port" .Values.service.internalPort }}
    protocol: TCP
    name: {{ .Values.service.name }}
  selector:
    app: {{ template "common.fullname" . }} # Another way to accomplish this

Above, we use three of the common tools:

  • common.fullname to generate a full name for our service
  • common.labels.standard to generate the standard labels for us
  • common.port to format port numbers for us

The above will produce something like this:

metadata:
  name: release-name-mychart
  labels:
    app: "release-name-mychart"
    chart: "mychart-0.1.0"
    heritage: "Tiller"
    release: RELEASE-NAME
spec:
  type: ClusterIP
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: nginx
  selector:
    app: release-name-mychart

The Common chart has many other utilities.

Developers

If you are developing on this project, you can use make build to build the charts. Note that the makefile requires signing your chart.

common-chart's People

Contributors

technosophos avatar

Watchers

James Cloos avatar Brandon B. Jozsa avatar  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.