Add linkerd chart (#200)

* Add linkerd chart

* Add prometheus config to linkerd

* linkerd: Disambiguate NOTES wrt port name

* linkerd: Add --namespace in NOTES

* linkerd: Use resources

* linkerd: Fix duplicate service type

* Add docs to values file

* linkerd: Bump to version 0.8.3

* linkerd: add README.md

* Bump linkerd to version 0.8.4

* linkerd: Add metadata to Chart.yaml

* linkerd: Remove YAML separator

* linkderd: Added app label to confimap
This commit is contained in:
Vic Iglesias
2016-12-21 10:21:59 -08:00
committed by GitHub
parent 4341efdead
commit c7bdccafc3
9 changed files with 241 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
+10
View File
@@ -0,0 +1,10 @@
apiVersion: v1
description: Service mesh for cloud native apps
name: linkerd
version: 0.1.0
home: https://linkerd.io/
sources:
- https://github.com/BuoyantIO/linkerd
maintainers:
- name: Vic Iglesias
email: viglesias@google.com
+30
View File
@@ -0,0 +1,30 @@
# linkerd Chart
[linkerd](https://linkerd.io/) is a resilient service mesh for cloud native apps
## Chart Details
This chart will do the following:
* Install a daemonset that provisions the linkerd [per-host architecture](https://linkerd.io/in-depth/deployment#per-host)
## Installing the Chart
To install the chart with the release name `my-release`:
```bash
$ helm install --name my-release stable/linkerd
```
## Configuration
Configurable values are documented in the `values.yaml`.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```bash
$ helm install --name my-release -f values.yaml stable/linkerd
```
> **Tip**: You can use the default [values.yaml](values.yaml)
+31
View File
@@ -0,0 +1,31 @@
Add named ports to your services that have the name '{{ .Values.linkerd.portName }}'
and linkerd will act as a proxy for them.
For example:
apiVersion: v1
kind: Service
metadata:
name: my-http-service
spec:
type: ClusterIP
ports:
- name: {{ .Values.linkerd.portName }}
port: 8080
selector:
app: my-http-service
1. Get the linkerd admin interface URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/login
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace= {{ .Release.Namespace }} -w {{ template "fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:9990
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:9990 to use your application"
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 9990:9990 4140:4140
{{- end }}
+16
View File
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- end -}}
+29
View File
@@ -0,0 +1,29 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}-config
labels:
app: {{ template "fullname" . }}
data:
config.yaml: |-
admin:
port: 9990
namers:
- kind: io.l5d.k8s
# kubectl proxy forwards localhost:8001 to the Kubernetes master API
host: localhost
port: 8001
routers:
- protocol: http
# Incoming requests to linkerd with a Host header of "hello" get assigned
# a name like /http/1.1/GET/hello. This dtab transforms that into
# /#/io.l5d.k8s/{{ .Release.Namespace }}/{{ .Values.linkerd.portName }}/hello which indicates that the kubernetes
# namer should query the API for ports named "{{ .Values.linkerd.portName }}" on pods in the
# "{{ .Release.Namespace }}" namespace named "hello". linkerd will then load balance over
# those pods.
baseDtab: |
/http/1.1/* => /#/io.l5d.k8s/{{ .Release.Namespace }}/{{ .Values.linkerd.portName }}
servers:
- ip: 0.0.0.0
port: 4140
+48
View File
@@ -0,0 +1,48 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
app: {{ template "fullname" . }}
name: {{ template "fullname" . }}
spec:
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
volumes:
- name: {{ template "fullname" . }}-config
configMap:
name: "{{ template "fullname" . }}-config"
containers:
- name: l5d
image: {{ .Values.image.linkerd.repository }}:{{ .Values.image.linkerd.tag }}
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
args:
- /io.buoyant/linkerd/config/config.yaml
ports:
- name: incoming
containerPort: 4141
hostPort: 4141
- name: outgoing
containerPort: 4140
hostPort: 4140
- name: admin
containerPort: 9990
hostPort: 9990
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: "{{ template "fullname" . }}-config"
mountPath: "/io.buoyant/linkerd/config"
readOnly: true
- name: kubectl
image: {{ .Values.image.kubectl.repository }}:{{ .Values.image.kubectl.tag }}
args:
- "proxy"
- "-p"
- "8001"
+22
View File
@@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
annotations:
prometheus.io/scrape: {{ .Values.prometheus.scrape | quote }}
prometheus.io/probe: {{ .Values.prometheus.probe | quote }}
prometheus.io/path: {{ .Values.prometheus.path | quote }}
prometheus.io/port: "9990"
spec:
type: {{ .Values.service.type }}
ports:
- name: outgoing
port: 4140
- name: incoming
port: 4141
- name: admin
port: 9990
selector:
app: {{ template "fullname" . }}
+34
View File
@@ -0,0 +1,34 @@
# Default values for linkerd.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
linkerd:
# Image repository and tag to use for linkerd
repository: buoyantio/linkerd
tag: 0.8.4
kubectl:
# Image repository and tag to use for kubectl sidecar
repository: buoyantio/kubectl
tag: v1.4.0
pullPolicy: IfNotPresent
linkerd:
# Port name that linkerd will use for endpoint discovery
portName: http
prometheus:
# Enable Prometheus service metrics
scrape: true
# Enable Prometheus endpoint metrics
probe: true
# Path for Prometheus metrics
path: /admin/metrics/prometheus
service:
# Type of service to use for linkerd
type: ClusterIP
resources:
# Memory limits and requests for linkerd container
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 500m
memory: 512Mi