Skip to content

Commit

Permalink
Merge pull request #8 from WyriHaximusNet/add-docker-hub-exporter
Browse files Browse the repository at this point in the history
Add Docker Hub Exporter
  • Loading branch information
WyriHaximus authored May 20, 2020
2 parents 7337358 + 5e3bdf0 commit a5dd29e
Show file tree
Hide file tree
Showing 9 changed files with 1,050 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ Opinionated helm chats for my personal projects, and OSS Projects that either do

## Charts in this repository

* [`docker-hub-exporter`](https://hub.helm.sh/charts/wyrihaximusnet/docker-hub-exporter)
* [`redirect`](https://hub.helm.sh/charts/wyrihaximusnet/redirect)

22 changes: 22 additions & 0 deletions charts/docker-hub-exporter/.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/
11 changes: 11 additions & 0 deletions charts/docker-hub-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: docker-hub-exporter
description: Docker Hub exporter
home: https://github.com/jessestuart/docker-hub-exporter
icon: https://helm.wyrihaximus.net/images/charts/docker-hub-exporter.png
type: application
version: 0.1.0
appVersion: d05df48
maintainers:
- name: WyriHaximus
email: [email protected]
63 changes: 63 additions & 0 deletions charts/docker-hub-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define ".helm.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 ".helm.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 ".helm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define ".helm.labels" -}}
helm.sh/chart: {{ include ".helm.chart" . }}
{{ include ".helm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define ".helm.selectorLabels" -}}
app.kubernetes.io/name: {{ include ".helm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define ".helm.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include ".helm.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
38 changes: 38 additions & 0 deletions charts/docker-hub-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include ".helm.fullname" . }}
labels:
app: {{ include ".helm.fullname" . }}
release: {{ include ".helm.fullname" . }}
{{- include ".helm.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include ".helm.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.service.port | quote}}
labels:
app: {{ include ".helm.fullname" . }}
release: {{ include ".helm.fullname" . }}
{{- include ".helm.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: docker-hub-exporter
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: metrics
containerPort: {{ .Values.service.port }}
protocol: TCP
args:
- -listen-address=:{{ .Values.service.port }}
- -organisations={{ .Values.organisations }}
Loading

0 comments on commit a5dd29e

Please sign in to comment.