diff --git a/charts/muescheli/Chart.yaml b/charts/muescheli/Chart.yaml new file mode 100644 index 0000000..1fd482e --- /dev/null +++ b/charts/muescheli/Chart.yaml @@ -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: saikatchakrabortty2@gmail.com + url: https://github.com/saikatharryc/ diff --git a/charts/muescheli/README.md b/charts/muescheli/README.md new file mode 100644 index 0000000..a31798c --- /dev/null +++ b/charts/muescheli/README.md @@ -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) | diff --git a/charts/muescheli/templates/NOTES.txt b/charts/muescheli/templates/NOTES.txt new file mode 100644 index 0000000..44448bd --- /dev/null +++ b/charts/muescheli/templates/NOTES.txt @@ -0,0 +1,3 @@ +Thank you for installing {{ .Chart.Name }}. + +Your release is named {{ .Release.Name }}. diff --git a/charts/muescheli/templates/_helper.tpl b/charts/muescheli/templates/_helper.tpl new file mode 100644 index 0000000..d209a9b --- /dev/null +++ b/charts/muescheli/templates/_helper.tpl @@ -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 -}} \ No newline at end of file diff --git a/charts/muescheli/templates/deployment.yaml b/charts/muescheli/templates/deployment.yaml new file mode 100644 index 0000000..5b84bc4 --- /dev/null +++ b/charts/muescheli/templates/deployment.yaml @@ -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 diff --git a/charts/muescheli/templates/service.yaml b/charts/muescheli/templates/service.yaml new file mode 100644 index 0000000..7301418 --- /dev/null +++ b/charts/muescheli/templates/service.yaml @@ -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 }} diff --git a/charts/muescheli/values.yaml b/charts/muescheli/values.yaml new file mode 100644 index 0000000..2ace1b1 --- /dev/null +++ b/charts/muescheli/values.yaml @@ -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: + 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: