Skip to content

Commit

Permalink
[add] mychart helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
cnych committed Sep 29, 2018
1 parent 05f61b1 commit 71ef54a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mychart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: mychart
version: 0.1.0
9 changes: 9 additions & 0 deletions mychart/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Thank you for installing {{ .Chart.Name }}.

Your release is named {{ .Release.Name }}.

To learn more about the release, try:

$ helm status {{ .Release.Name }}
$ helm get {{ .Release.Name }}

7 changes: 7 additions & 0 deletions mychart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{/* 生成基本的lables标签 */}}
{{- define "mychart.labels" }}
from: helm
date: {{ now | htmlDate }}
chart: {{ .Chart.Name }}
version: {{ .Chart.Version }}
{{- end }}
26 changes: 26 additions & 0 deletions mychart/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
labels:
{{- include "mychart.labels" . | indent 4}}
data:
app: mychart
myvalue: {{ .Values.hello | default "Hello World" | quote }}
{{- $releaseName := .Release.Name }}
{{- with .Values.course }}
k8s: {{ .k8s | upper | quote }}
python: {{ .python | repeat 5 | quote }}
release: {{ $releaseName }}
{{- if eq .python "django" }}
web: true
{{- end }}
{{- end }}
courselist:
{{- range $index, $course := .Values.courselist }}
- {{ $index }}: {{ $course | title | quote }}
{{- end }}
{{- range $key, $val := .Values.course }}
{{ $key }}: {{ $val | upper | quote }}
{{- end }}
{{- include "mychart.labels" . | indent 2 }}
8 changes: 8 additions & 0 deletions mychart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
course:
k8s: devops
python: django
courselist:
- k8s
- python
- search
- golang

0 comments on commit 71ef54a

Please sign in to comment.