Publish Helm chart

This commit is contained in:
Stefan Prodan
2018-09-26 20:31:35 +03:00
parent d562361694
commit dac0bfdb4c
15 changed files with 33 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Steerer installed
+32
View File
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "steerer.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "steerer.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "steerer.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+9
View File
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "steerer.name" . }}
labels:
app: {{ template "steerer.name" . }}
chart: {{ template "steerer.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
+58
View File
@@ -0,0 +1,58 @@
{{- if .Values.crd.create }}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: rollouts.apps.weave.works
spec:
group: apps.weave.works
version: v1beta1
versions:
- name: v1beta1
served: true
storage: true
names:
plural: rollouts
singular: rollout
kind: Rollout
shortNames:
- roll
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
required:
- primary
- canary
- virtualService
properties:
primary:
properties:
name:
type: string
host:
type: string
canary:
properties:
name:
type: string
host:
type: string
virtualService:
properties:
name:
type: string
weight:
type: number
metric:
properties:
type:
type: string
name:
type: string
interval:
type: string
pattern: "^[0-9]+(m)"
threshold:
type: number
{{- end }}
+71
View File
@@ -0,0 +1,71 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "steerer.fullname" . }}
labels:
app: {{ include "steerer.name" . }}
chart: {{ include "steerer.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: {{ include "steerer.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ include "steerer.name" . }}
release: {{ .Release.Name }}
spec:
serviceAccountName: steerer
containers:
- name: steerer
securityContext:
readOnlyRootFilesystem: true
runAsUser: 10001
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
command:
- ./steerer
- -log-level=info
- -control-loop-interval={{ .Values.controlLoopInterval }}
- -metrics-server={{ .Values.metricsServer }}
livenessProbe:
exec:
command:
- wget
- --quiet
- --tries=1
- --timeout=2
- --spider
- http://localhost:8080/healthz
readinessProbe:
exec:
command:
- wget
- --quiet
- --tries=1
- --timeout=2
- --spider
- http://localhost:8080/healthz
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
+35
View File
@@ -0,0 +1,35 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: {{ template "steerer.fullname" . }}
labels:
app: {{ template "steerer.name" . }}
chart: {{ template "steerer.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups: ['*']
resources: ['*']
verbs: ['*']
- nonResourceURLs: ['*']
verbs: ['*']
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: {{ template "steerer.fullname" . }}
labels:
app: {{ template "steerer.name" . }}
chart: {{ template "steerer.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "steerer.fullname" . }}
subjects:
- name: {{ template "steerer.name" . }}
namespace: {{ .Release.Namespace | quote }}
kind: ServiceAccount
{{- end }}