Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm chart for chartmuseum-ui #1

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
.vscode/
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# charts
Helm charts for running ChartMuseum
Helm charts for all ChartMuseum components

## Chart Details

This is a global ChartMuseum helm chart containing its components as subcharts:
- chartmuseum-ui
11 changes: 11 additions & 0 deletions charts/chartmuseum-ui/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
name: chartmuseum-ui
version: 1.0
appVersion: 1.0
tillerVersion: ">=2.7.2-0"
description: ChartMuseum frontend UI
home: https://github.com/chartmuseum/ui
keywords:
- chartmuseum
- gui
- charts
45 changes: 45 additions & 0 deletions charts/chartmuseum-ui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "chartmuseum-ui.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 "chartmuseum-ui.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 "chartmuseum-ui.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "chartmuseum-ui.labels" -}}
app.kubernetes.io/name: {{ include "chartmuseum-ui.name" . }}
helm.sh/chart: {{ include "chartmuseum-ui.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
11 changes: 11 additions & 0 deletions charts/chartmuseum-ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "chartmuseum-ui.name" . }}-vars
data:
{{- range $key, $value := .Values.envVars }}
{{ $key }}: {{ tpl ($value | quote) $ }}
{{- end }}
{{- end }}
33 changes: 33 additions & 0 deletions charts/chartmuseum-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.enabled }}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: chartmuseum-ui
labels:
app: {{ template "chartmuseum-ui.name" . }}
chart: {{ template "chartmuseum-ui.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: chartmuseum-ui
annotations:
sidecar.istio.io/inject: "false"
spec:
initContainers:
- name: verify-dependencies
image: busybox
command: ['sh', '-c', 'until wget -q {{ .Values.envVars.CHART_MUSESUM_URL }} -o /dev/null; do echo waiting for chartmuseum backend...; sleep 2; done']
containers:
- name: chartmuseum-ui
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: {{ template "chartmuseum-ui.name" . }}-vars
{{- end }}
36 changes: 36 additions & 0 deletions charts/chartmuseum-ui/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: chartmuseum-ui
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "chartmuseum-ui.name" . }}
chart: {{ template "chartmuseum-ui.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- if .Values.ingress.hosts }}
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: {{ if $.Values.contextPath }} {{ $.Values.contextPath }} {{ else }} / {{ end }}
backend:
serviceName: chartmuseum-ui
servicePort: 3000
{{- end -}}
{{- else }}
- http:
paths:
- path: {{ if .Values.contextPath }} {{ .Values.contextPath }} {{ else }} / {{ end }}
backend:
serviceName: chartmuseum-ui
servicePort: 3000
{{- end }}
{{- end -}}
22 changes: 22 additions & 0 deletions charts/chartmuseum-ui/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.enabled }}
apiVersion: v1
kind: Service
metadata:
name: chartmuseum-ui
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "chartmuseum-ui.name" . }}
chart: {{ template "chartmuseum-ui.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 8080
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "chartmuseum-ui.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
26 changes: 26 additions & 0 deletions charts/chartmuseum-ui/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
enabled: true

replicaCount: 1
image:
repository: idobry/chartmuseumui
tag: latest

ingress:
enabled: true
hosts:
- chartmuseum-ui.local
annotations: {}
# kubernetes.io/ingress.class: nginx

nodeSelector: {}
tolerations: []
podAnnotations: {}

service:
type: ClusterIP
port: 8080

envVars:
CHART_MUSESUM_URL: "http://chartmuseum.svc.cluster.local"
CHART_MUSESUM_API_GET_CHARTS:
BASIC_AUTH_USERS: '[{"username":"admin", "password":"password"}, {"username":"user", "password":"s3cr3t"}]'