From 5537d65dd5983078784b4c8da21b5ab41ba2453a Mon Sep 17 00:00:00 2001 From: phenix3443 Date: Tue, 25 Jul 2023 22:32:11 +0800 Subject: [PATCH] add aria2 chart (#5) add aria2 chart --- .vscode/settings.json | 3 + charts/alist/Chart.yaml | 2 +- charts/alist/templates/deployment.yaml | 2 +- charts/aria2/.helmignore | 23 +++ charts/aria2/Chart.yaml | 27 +++ charts/aria2/README.md | 28 +++ charts/aria2/templates/NOTES.txt | 22 +++ charts/aria2/templates/_helpers.tpl | 74 ++++++++ charts/aria2/templates/deployment.yaml | 96 ++++++++++ charts/aria2/templates/hpa.yaml | 32 ++++ charts/aria2/templates/ingress-ui.yaml | 61 +++++++ charts/aria2/templates/ingress.yaml | 61 +++++++ charts/aria2/templates/pvc.yaml | 36 ++++ charts/aria2/templates/service-ui.yaml | 15 ++ charts/aria2/templates/service.yaml | 15 ++ charts/aria2/templates/serviceaccount.yaml | 12 ++ .../templates/tests/test-connection.yaml | 15 ++ charts/aria2/values.yaml | 166 ++++++++++++++++++ 18 files changed, 688 insertions(+), 2 deletions(-) create mode 100644 charts/aria2/.helmignore create mode 100644 charts/aria2/Chart.yaml create mode 100644 charts/aria2/README.md create mode 100644 charts/aria2/templates/NOTES.txt create mode 100644 charts/aria2/templates/_helpers.tpl create mode 100644 charts/aria2/templates/deployment.yaml create mode 100644 charts/aria2/templates/hpa.yaml create mode 100644 charts/aria2/templates/ingress-ui.yaml create mode 100644 charts/aria2/templates/ingress.yaml create mode 100644 charts/aria2/templates/pvc.yaml create mode 100644 charts/aria2/templates/service-ui.yaml create mode 100644 charts/aria2/templates/service.yaml create mode 100644 charts/aria2/templates/serviceaccount.yaml create mode 100644 charts/aria2/templates/tests/test-connection.yaml create mode 100644 charts/aria2/values.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json index 704a7d3..be3c731 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,13 @@ { "cSpell.words": [ + "ariang", "artifacthub", "fullchain", "fullname", + "Metalink", "pheix", "Solidjs", + "terx", "xhofe" ] } diff --git a/charts/alist/Chart.yaml b/charts/alist/Chart.yaml index 91ae669..231c392 100644 --- a/charts/alist/Chart.yaml +++ b/charts/alist/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: alist -version: 0.1.3 +version: 0.1.4 kubeVersion: ^1.8.0-0 description: A file list program that supports multiple storage, powered by Gin and Solidjs. type: application diff --git a/charts/alist/templates/deployment.yaml b/charts/alist/templates/deployment.yaml index 47d3719..50aa3f0 100644 --- a/charts/alist/templates/deployment.yaml +++ b/charts/alist/templates/deployment.yaml @@ -89,7 +89,7 @@ spec: - name: storage persistentVolumeClaim: claimName: {{ tpl (.Values.persistence.existingClaim | default (include "alist.fullname" .)) . }} - {{- else}} + {{- else }} - name: storage {{- if .Values.persistence.inMemory.enabled }} emptyDir: diff --git a/charts/aria2/.helmignore b/charts/aria2/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/aria2/.helmignore @@ -0,0 +1,23 @@ +# 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/ diff --git a/charts/aria2/Chart.yaml b/charts/aria2/Chart.yaml new file mode 100644 index 0000000..01c227d --- /dev/null +++ b/charts/aria2/Chart.yaml @@ -0,0 +1,27 @@ +apiVersion: v2 +name: aria2 +version: 0.1.0 +kubeVersion: ^1.8.0-0 +description: aria2 is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces. +type: application +home: https://aria2.github.io/ +sources: + - https://github.com/aria2/aria2 +maintainers: + - email: phenix3443@gmail.com + name: phenix3443 + url: https://blog.panghuli.cn/ +icon: https://img.downkuai.com/logo/191116/201911161545122887.jpg +appVersion: "1.36.0" +# https://artifacthub.io/docs/topics/annotations/helm/ +annotations: + artifacthub.io/category: download + artifacthub.io/changes: | + - kind: added + description: init + artifacthub.io/license: AGPL-3.0-only + artifacthub.io/links: | + - name: support + url: https://github.com/phenix3443/charts + - name: Upstream Project + url: https://hub.docker.com/r/p3terx/aria2-pro diff --git a/charts/aria2/README.md b/charts/aria2/README.md new file mode 100644 index 0000000..c6ce84d --- /dev/null +++ b/charts/aria2/README.md @@ -0,0 +1,28 @@ +# aria2 Helm Chart + +- Installs the lightweight multi-protocol & multi-source command-line download utility -- [aria2](https://aria2.github.io/)。 + +## Get Repo Info + +```console +helm repo add panghuli https://charts.panghuli.cn +helm repo update +``` + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +helm install my-release panghuli/aria2 +``` + +## Uninstalling the Chart + +To uninstall/delete the my-release deployment: + +```console +helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. diff --git a/charts/aria2/templates/NOTES.txt b/charts/aria2/templates/NOTES.txt new file mode 100644 index 0000000..72af02e --- /dev/null +++ b/charts/aria2/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "aria2.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "aria2.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "aria2.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aria2.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/aria2/templates/_helpers.tpl b/charts/aria2/templates/_helpers.tpl new file mode 100644 index 0000000..b875e47 --- /dev/null +++ b/charts/aria2/templates/_helpers.tpl @@ -0,0 +1,74 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "aria2.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 "aria2.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 "aria2.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "aria2.labels" -}} +helm.sh/chart: {{ include "aria2.chart" . }} +{{ include "aria2.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aria2.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aria2.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "aria2.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "aria2.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + + +{{/* +Allow the release namespace to be overridden for multi-namespace deployments in combined charts +*/}} +{{- define "aria2.namespace" -}} +{{- if .Values.namespaceOverride }} +{{- .Values.namespaceOverride }} +{{- else }} +{{- .Release.Namespace }} +{{- end }} +{{- end }} diff --git a/charts/aria2/templates/deployment.yaml b/charts/aria2/templates/deployment.yaml new file mode 100644 index 0000000..c356d07 --- /dev/null +++ b/charts/aria2/templates/deployment.yaml @@ -0,0 +1,96 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "aria2.fullname" . }} + namespace: {{ include "aria2.namespace" . }} + labels: + {{- include "aria2.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "aria2.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "aria2.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "aria2.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: RPC_SECRET + value: {{ .Values.config.rpc_secret }} + - name: RPC_PORT + value: {{ .Values.config.rpc_listen_port | quote }} + - name: LISTEN_PORT + value: {{ .Values.config.listen_port | quote }} + ports: + - name: {{ .Values.podPortName }} + containerPort: {{ .Values.service.targetPort }} + protocol: TCP + volumeMounts: + - name: storage + mountPath: "/downloads" + resources: + {{- toYaml .Values.resources | nindent 12 }} + - name: {{ .Values.ui.name }} + image: "{{ .Values.ui.repository }}:{{ .Values.ui.tag }}" + imagePullPolicy: {{ .Values.ui.pullPolicy }} + ports: + - name: webui + containerPort: {{ .Values.ui_service.targetPort }} + protocol: TCP + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + {{- if and .Values.persistence.enabled (eq .Values.persistence.type "pvc") }} + - name: storage + persistentVolumeClaim: + claimName: {{ tpl (.Values.persistence.existingClaim | default (include "aria2.fullname" .)) . }} + {{- else }} + - name: storage + {{- if .Values.persistence.inMemory.enabled }} + emptyDir: + medium: Memory + {{- with .Values.persistence.inMemory.sizeLimit }} + sizeLimit: {{ . }} + {{- end }} + {{- else }} + emptyDir: {} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/aria2/templates/hpa.yaml b/charts/aria2/templates/hpa.yaml new file mode 100644 index 0000000..f42151f --- /dev/null +++ b/charts/aria2/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "aria2.fullname" . }} + labels: + {{- include "aria2.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "aria2.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/aria2/templates/ingress-ui.yaml b/charts/aria2/templates/ingress-ui.yaml new file mode 100644 index 0000000..2e609a5 --- /dev/null +++ b/charts/aria2/templates/ingress-ui.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ui_ingress.enabled -}} +{{- $fullName := .Values.ui.name -}} +{{- $svcPort := .Values.ui_service.port -}} +{{- if and .Values.ui_ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ui_ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ui_ingress.annotations "kubernetes.io/ingress.class" .Values.ui_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 "aria2.labels" . | nindent 4 }} + {{- with .Values.ui_ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ui_ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ui_ingress.className }} + {{- end }} + {{- if .Values.ui_ingress.tls }} + tls: + {{- range .Values.ui_ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ui_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/aria2/templates/ingress.yaml b/charts/aria2/templates/ingress.yaml new file mode 100644 index 0000000..ae9d07a --- /dev/null +++ b/charts/aria2/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "aria2.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 "aria2.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/aria2/templates/pvc.yaml b/charts/aria2/templates/pvc.yaml new file mode 100644 index 0000000..c8c0a3e --- /dev/null +++ b/charts/aria2/templates/pvc.yaml @@ -0,0 +1,36 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) (eq .Values.persistence.type "pvc")}} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "aria2.fullname" . }} + namespace: {{ include "aria2.namespace" . }} + labels: + {{- include "aria2.labels" . | nindent 4 }} + {{- with .Values.persistence.extraPvcLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.persistence.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.persistence.finalizers }} + finalizers: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- with .Values.persistence.storageClassName }} + storageClassName: {{ . }} + {{- end }} + {{- with .Values.persistence.selectorLabels }} + selector: + matchLabels: + {{- toYaml . | nindent 6 }} + {{- end }} +{{- end }} diff --git a/charts/aria2/templates/service-ui.yaml b/charts/aria2/templates/service-ui.yaml new file mode 100644 index 0000000..79b5e09 --- /dev/null +++ b/charts/aria2/templates/service-ui.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.ui.name }} + labels: + {{- include "aria2.labels" . | nindent 4 }} +spec: + type: {{ .Values.ui_service.type }} + ports: + - port: {{ .Values.ui_service.port }} + targetPort: {{ .Values.ui_service.targetPort }} + protocol: TCP + name: http + selector: + {{- include "aria2.selectorLabels" . | nindent 4 }} diff --git a/charts/aria2/templates/service.yaml b/charts/aria2/templates/service.yaml new file mode 100644 index 0000000..e8a20e2 --- /dev/null +++ b/charts/aria2/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aria2.fullname" . }} + labels: + {{- include "aria2.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.targetPort }} + protocol: TCP + name: http + selector: + {{- include "aria2.selectorLabels" . | nindent 4 }} diff --git a/charts/aria2/templates/serviceaccount.yaml b/charts/aria2/templates/serviceaccount.yaml new file mode 100644 index 0000000..f918130 --- /dev/null +++ b/charts/aria2/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "aria2.serviceAccountName" . }} + labels: + {{- include "aria2.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/aria2/templates/tests/test-connection.yaml b/charts/aria2/templates/tests/test-connection.yaml new file mode 100644 index 0000000..6879672 --- /dev/null +++ b/charts/aria2/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "aria2.fullname" . }}-test-connection" + labels: + {{- include "aria2.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "aria2.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/aria2/values.yaml b/charts/aria2/values.yaml new file mode 100644 index 0000000..f234cf3 --- /dev/null +++ b/charts/aria2/values.yaml @@ -0,0 +1,166 @@ +# Default values for aria2. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: p3terx/aria2-pro + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +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: 6800 + targetPort: 6800 + +ingress: + enabled: false + className: "" + annotations: + {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: Prefix + 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: {} + +## Override the deployment namespace +## +namespaceOverride: "" +## Deployment labels +labels: {} +## Deployment annotations +annotations: {} + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + enabled: false + type: pvc + storageClassName: default + accessModes: + - ReadWriteOnce + size: 10Gi + # annotations: {} + finalizers: + - kubernetes.io/pvc-protection + # selectorLabels: {} + ## Sub-directory of the PV to mount. Can be templated. + # subPath: "" + ## Name of an existing PVC. Can be templated. + # existingClaim: + ## Extra labels to apply to a PVC. + extraPvcLabels: {} + + ## If persistence is not enabled, this allows to mount the + ## local storage in-memory to improve performance + ## + inMemory: + enabled: true + ## The maximum usage on memory medium EmptyDir would be + ## the minimum value between the SizeLimit specified + ## here and the sum of memory limits of all containers in a pod + ## + # sizeLimit: 300Mi + +podPortName: aria2 +## aria2's primary configuration +## NOTE: values in map will be converted to json format +## ref: https://aria2.github.io/manual/en/html/aria2c.html#aria2-conf +## +config: + rpc_secret: aria2_token + listen_port: 6888 + rpc_listen_port: 6800 + +ui: + name: ariang + repository: p3terx/ariang + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +ui_service: + type: ClusterIP + port: 80 + targetPort: 6880 + +ui_ingress: + enabled: false + className: "" + annotations: + {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: Prefix + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local