diff --git a/charts/radarr/radarr/.gitignore b/charts/radarr/radarr/.gitignore new file mode 100644 index 0000000..573bae7 --- /dev/null +++ b/charts/radarr/radarr/.gitignore @@ -0,0 +1,2 @@ +charts +.idea diff --git a/charts/radarr/radarr/.gitlab-ci.yml b/charts/radarr/radarr/.gitlab-ci.yml new file mode 100644 index 0000000..41b9e8e --- /dev/null +++ b/charts/radarr/radarr/.gitlab-ci.yml @@ -0,0 +1,4 @@ +include: + - project: alexander-chernov/pipelines + ref: main + file: charts/.gitlab-ci.yaml diff --git a/charts/radarr/radarr/.helmignore b/charts/radarr/radarr/.helmignore new file mode 100644 index 0000000..0330ca6 --- /dev/null +++ b/charts/radarr/radarr/.helmignore @@ -0,0 +1,27 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +.gitlab-ci.yml +.pre-commit-config.yaml +README.md.gotmpl +.prettierignore diff --git a/charts/radarr/radarr/.pre-commit-config.yaml b/charts/radarr/radarr/.pre-commit-config.yaml new file mode 100644 index 0000000..0741a76 --- /dev/null +++ b/charts/radarr/radarr/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +--- +repos: + # Check if the commit message has a valid sign-off. + - repo: https://github.com/gklein/check_signoff + rev: v1.0.5 + hooks: + - id: check-signoff + + - repo: https://github.com/gruntwork-io/pre-commit + rev: v0.1.23 + hooks: + - id: helmlint + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-case-conflict + - id: check-json + - id: end-of-file-fixer + - id: trailing-whitespace + - id: fix-byte-order-marker + - id: detect-private-key + - id: check-added-large-files + # - id: no-commit-to-branch + - id: mixed-line-ending + args: + - --fix=lf + + - repo: https://github.com/norwoodj/helm-docs + rev: v1.14.2 + hooks: + - id: helm-docs + + # Run commitlint check on the commit message. + - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook + rev: v9.16.0 + hooks: + - id: commitlint + stages: [commit-msg] + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier diff --git a/charts/radarr/radarr/.prettierignore b/charts/radarr/radarr/.prettierignore new file mode 100644 index 0000000..d3dfb1b --- /dev/null +++ b/charts/radarr/radarr/.prettierignore @@ -0,0 +1,3 @@ +templates +README.md +README.md.gotmpl diff --git a/charts/radarr/radarr/Chart.yaml b/charts/radarr/radarr/Chart.yaml new file mode 100644 index 0000000..1fdff40 --- /dev/null +++ b/charts/radarr/radarr/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v2 +name: radarr +description: A Radarr Helm chart for Kubernetes + +type: application + +version: 1.5.0 + +# renovate: image=hotio/radarr +appVersion: "release-5.8.3.8933" + +icon: https://avatars.githubusercontent.com/u/25025331 +annotations: + artifacthub.io/changes: | + - kind: changed + description: Bumped radarr version to release-5.8.3.8933 + artifacthub.io/links: | + - name: Helm Repo + url: https://gitlab.com/alexander-chernov/helm/radarr diff --git a/charts/radarr/radarr/README.md b/charts/radarr/radarr/README.md new file mode 100644 index 0000000..2782519 --- /dev/null +++ b/charts/radarr/radarr/README.md @@ -0,0 +1,55 @@ +# radarr + +![Version: 1.5.0](https://img.shields.io/badge/Version-1.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: release-5.8.3.8933](https://img.shields.io/badge/AppVersion-release--5.8.3.8933-informational?style=flat-square) + +A Radarr Helm chart for Kubernetes + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| deployment.strategy | object | `{"type":"Recreate"}` | Deployment strategy | +| env.PGID | string | `"1000"` | | +| env.PUID | string | `"1000"` | | +| env.TZ | string | `"Europe/London"` | | +| env.UMASK | string | `"002"` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"hotio/radarr"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| persistence.accessMode | string | `"ReadWriteOnce"` | | +| persistence.additionalMounts | list | `[]` | | +| persistence.additionalVolumes | list | `[]` | | +| persistence.enabled | bool | `true` | | +| persistence.existingClaim | string | `""` | | +| persistence.size | string | `"800Mi"` | | +| persistence.storageClass | string | `""` | | +| podAnnotations | object | `{}` | | +| podSecurityContext | object | `{}` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.port | int | `80` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/charts/radarr/radarr/templates/_helpers.tpl b/charts/radarr/radarr/templates/_helpers.tpl new file mode 100644 index 0000000..656bf9c --- /dev/null +++ b/charts/radarr/radarr/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "radarr.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 "radarr.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 "radarr.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "radarr.labels" -}} +helm.sh/chart: {{ include "radarr.chart" . }} +{{ include "radarr.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "radarr.selectorLabels" -}} +app.kubernetes.io/name: {{ include "radarr.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "radarr.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "radarr.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/radarr/radarr/templates/deployment.yaml b/charts/radarr/radarr/templates/deployment.yaml new file mode 100644 index 0000000..53a0add --- /dev/null +++ b/charts/radarr/radarr/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "radarr.fullname" . }} + labels: + {{- include "radarr.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + strategy: + {{- .Values.deployment.strategy | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "radarr.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "radarr.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "radarr.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: config + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default (include "radarr.fullname" .) }} + {{- else }} + emptyDir: { } + {{- end }} + {{- if .Values.persistence.additionalVolumes }} + {{- .Values.persistence.additionalVolumes | toYaml | nindent 8}} + {{- end }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + - mountPath: /config + name: config + {{- if .Values.persistence.additionalMounts }} + {{- .Values.persistence.additionalMounts | toYaml | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: 7878 + protocol: TCP + env: + {{- range $k,$v := .Values.env }} + - name: {{ $k }} + value: {{ $v | quote }} + {{- end }} + livenessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/radarr/radarr/templates/hpa.yaml b/charts/radarr/radarr/templates/hpa.yaml new file mode 100644 index 0000000..e89df84 --- /dev/null +++ b/charts/radarr/radarr/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "radarr.fullname" . }} + labels: + {{- include "radarr.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "radarr.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/radarr/radarr/templates/ingress.yaml b/charts/radarr/radarr/templates/ingress.yaml new file mode 100644 index 0000000..bb188b3 --- /dev/null +++ b/charts/radarr/radarr/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "radarr.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "radarr.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/radarr/radarr/templates/pvc.yaml b/charts/radarr/radarr/templates/pvc.yaml new file mode 100644 index 0000000..4a6c0a5 --- /dev/null +++ b/charts/radarr/radarr/templates/pvc.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "radarr.fullname" . }} + labels: + {{- include "radarr.labels" . | nindent 4 }} + annotations: + {{- if .Values.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} +{{- end }} diff --git a/charts/radarr/radarr/templates/service.yaml b/charts/radarr/radarr/templates/service.yaml new file mode 100644 index 0000000..47a7f40 --- /dev/null +++ b/charts/radarr/radarr/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "radarr.fullname" . }} + labels: + {{- include "radarr.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "radarr.selectorLabels" . | nindent 4 }} diff --git a/charts/radarr/radarr/templates/serviceaccount.yaml b/charts/radarr/radarr/templates/serviceaccount.yaml new file mode 100644 index 0000000..55f7951 --- /dev/null +++ b/charts/radarr/radarr/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "radarr.serviceAccountName" . }} + labels: + {{- include "radarr.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/radarr/radarr/templates/tests/test-connection.yaml b/charts/radarr/radarr/templates/tests/test-connection.yaml new file mode 100644 index 0000000..3faf6e9 --- /dev/null +++ b/charts/radarr/radarr/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "radarr.fullname" . }}-test-connection" + labels: + {{- include "radarr.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "radarr.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/radarr/radarr/values.yaml b/charts/radarr/radarr/values.yaml new file mode 100644 index 0000000..8e3b1f3 --- /dev/null +++ b/charts/radarr/radarr/values.yaml @@ -0,0 +1,107 @@ +# Default values for radarr. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +replicaCount: 1 + +image: + repository: hotio/radarr + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +deployment: + # -- Deployment strategy + strategy: + type: Recreate + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: + {} + # fsGroup: 2000 + +securityContext: + {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: + {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: + {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +env: + PUID: "1000" + PGID: "1000" + TZ: "Europe/London" + UMASK: "002" + +persistence: + storageClass: "" + existingClaim: "" + enabled: true + accessMode: ReadWriteOnce + size: 800Mi + # if you need any additional volumes, you can define them here + additionalVolumes: [] + # if you need any additional volume mounts, you can define them here + additionalMounts: []