Skip to content

Commit

Permalink
Muescheli v1 (#4)
Browse files Browse the repository at this point in the history
* feat: chart muescheli added
  • Loading branch information
saikatharryc authored Apr 20, 2020
1 parent 6baa0c3 commit c7c9248
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 0 deletions.
18 changes: 18 additions & 0 deletions charts/muescheli/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v2
name: muescheli
version: 18.11.1
appVersion: 1.0.1
description: muescheli antivirus
keywords:
- muescheli
- antivirus
- scan
home: https://github.com/saikatharryc/muescheli
sources:
- https://github.com/saikatharryc/muescheli
- https://github.com/monostream/muescheli
- https://github.com/lastops/muescheli
maintainers:
- name: saikatharryc
email: [email protected]
url: https://github.com/saikatharryc/
22 changes: 22 additions & 0 deletions charts/muescheli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
muescheli
=========
muescheli antivirus

Current chart version is `18.11.1`

Source code can be found [here](https://github.com/saikatharryc/muescheli)



## Chart Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| image.registry | string | `"docker.io"` | Image registry |
| image.repository | string | `"saikatharryc/muescheli"` | Image Repository |
| image.tag | string | `"latest"` | Image Tag |
| service.annotations | string | `nil` | Service annotations done as key:value pairs |
| service.externalTrafficPolicy | string | `"Cluster"` | External Traffic Policy |
| service.nodePorts.http | string | `nil` | Nodepport if available |
| service.port | int | `8091` | HTTP Port |
| service.type | string | `"ClusterIP"` | Service Type (i.e LoadBalancer,NodePort etc) |
3 changes: 3 additions & 0 deletions charts/muescheli/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Thank you for installing {{ .Chart.Name }}.

Your release is named {{ .Release.Name }}.
84 changes: 84 additions & 0 deletions charts/muescheli/templates/_helper.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "muescheli.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 "muescheli.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 -}}

{{/*
Return the proper image name
*/}}
{{- define "muescheli.image" -}}
{{- $registryName := .Values.image.registry -}}
{{- $repositoryName := .Values.image.repository -}}
{{- $tag := .Values.image.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}


{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "muescheli.imagePullSecrets" -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
Also, we can not use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.global.imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- else if .Values.image.pullSecrets}}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return the appropriate apiVersion for deployment.
*/}}
{{- define "muescheli.deployment.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "extensions/v1beta1" -}}
{{- else -}}
{{- print "apps/v1" -}}
{{- end -}}
{{- end -}}
42 changes: 42 additions & 0 deletions charts/muescheli/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: {{ template "muescheli.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ .Release.Namespace }}-{{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Chart.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
spec:
selector:
matchLabels:
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
replicas: 1
template:
metadata:
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
spec:
restartPolicy: Always
{{- include "muescheli.imagePullSecrets" . | indent 6 }}
containers:
- name: {{ .Chart.Name }}-clamd
image: "lastops/clamav"
imagePullPolicy: Always
ports:
- containerPort: 3310
name: api
protocol: TCP
- name: {{ .Chart.Name }}-muescheli
image: {{ template "muescheli.image" . }}
imagePullPolicy: Always
env:
- name: CLAMD_HOST
value: localhost
- name: CLAMD_PORT
value: '3310'
ports:
- name: http-port
containerPort: 8091
33 changes: 33 additions & 0 deletions charts/muescheli/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
annotations:
labels:
app: {{ .Chart.Name }}-service
kubernetes.io/name: {{ .Chart.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
annotations:
{{- range $key, $value := .Values.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}

spec:
type: {{ .Values.service.type }}
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
{{- end }}
{{- if eq .Values.service.type "LoadBalancer" }}
loadBalancerIP: {{ default "" .Values.service.loadBalancerIP | quote }}
{{- end }}
ports:
- name: http
port: {{ default "http" .Values.service.port }}
targetPort: http-port
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}}
nodePort: {{ .Values.service.nodePorts.http }}
{{- end }}
selector:
app: {{ .Chart.Name }}
32 changes: 32 additions & 0 deletions charts/muescheli/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
image:
# image.registry -- Image registry
registry: docker.io
# image.repository -- Image Repository
repository: saikatharryc/muescheli
# image.tag -- Image Tag
tag: latest
## Kubernetes configuration
## For minikube, set this to NodePort, elsewhere use LoadBalancer
##
service:
# service.type -- Service Type (i.e LoadBalancer,NodePort etc)
type: ClusterIP
# service.port -- HTTP Port
port: 8091
## loadBalancerIP:
##
## nodePorts:
## http: <to set explicitly, choose port between 30000-32767>
nodePorts:
# service.nodePorts.http -- Nodepport if available
http:
## Enable client source IP preservation
## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
##
# service.externalTrafficPolicy -- External Traffic Policy
externalTrafficPolicy: Cluster
# service.annotations -- Service annotations done as key:value pairs
annotations:

0 comments on commit c7c9248

Please sign in to comment.