From b20cf68cfc5f843c9eb8aee4d319e3a953082995 Mon Sep 17 00:00:00 2001 From: "M. Rehan" Date: Mon, 8 Aug 2022 23:47:32 +0500 Subject: [PATCH] Add storj application --- test/storj/1.0.0/Chart.lock | 6 + test/storj/1.0.0/Chart.yaml | 16 + test/storj/1.0.0/README.md | 3 + test/storj/1.0.0/app-readme.md | 3 + test/storj/1.0.0/charts/common-2207.0.0.tgz | Bin 0 -> 4972 bytes test/storj/1.0.0/ix_values.yaml | 5 + test/storj/1.0.0/questions.yaml | 273 ++++++++++++++++++ test/storj/1.0.0/templates/_helpers.tpl | 6 + test/storj/1.0.0/templates/deployment.yaml | 97 +++++++ .../1.0.0/templates/initial_scripts.yaml | 18 ++ .../1.0.0/templates/pre-install-job.yaml | 28 ++ test/storj/1.0.0/templates/service.yaml | 11 + test/storj/1.0.0/templates/storj-secrets.yaml | 9 + test/storj/1.0.0/test_values.yaml | 26 ++ test/storj/item.yaml | 6 + 15 files changed, 507 insertions(+) create mode 100644 test/storj/1.0.0/Chart.lock create mode 100644 test/storj/1.0.0/Chart.yaml create mode 100644 test/storj/1.0.0/README.md create mode 100644 test/storj/1.0.0/app-readme.md create mode 100644 test/storj/1.0.0/charts/common-2207.0.0.tgz create mode 100644 test/storj/1.0.0/ix_values.yaml create mode 100644 test/storj/1.0.0/questions.yaml create mode 100644 test/storj/1.0.0/templates/_helpers.tpl create mode 100644 test/storj/1.0.0/templates/deployment.yaml create mode 100644 test/storj/1.0.0/templates/initial_scripts.yaml create mode 100644 test/storj/1.0.0/templates/pre-install-job.yaml create mode 100644 test/storj/1.0.0/templates/service.yaml create mode 100644 test/storj/1.0.0/templates/storj-secrets.yaml create mode 100644 test/storj/1.0.0/test_values.yaml create mode 100644 test/storj/item.yaml diff --git a/test/storj/1.0.0/Chart.lock b/test/storj/1.0.0/Chart.lock new file mode 100644 index 0000000000..31e49e590e --- /dev/null +++ b/test/storj/1.0.0/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../library/common/2207.0.0 + version: 2207.0.0 +digest: sha256:f17f3d458ca0210a52e39da0dce35034e900b36f2040d4b19bed46a7aae91506 +generated: "2022-08-02T17:37:09.365219548+05:00" diff --git a/test/storj/1.0.0/Chart.yaml b/test/storj/1.0.0/Chart.yaml new file mode 100644 index 0000000000..bf7f1db2cf --- /dev/null +++ b/test/storj/1.0.0/Chart.yaml @@ -0,0 +1,16 @@ +apiVersion: v2 +appVersion: 1.17.5 +icon: https://assets-global.website-files.com/602eda09fc78afc76e9706b6/60917835a05862243e7de9af_logo.svg +description: Share you storage on internet and earn. +name: storj +version: 1.0.0 +dependencies: +- name: common + repository: file://../../../library/common/2207.0.0 + version: 2207.0.0 +home: https://www.storj.io/ +keywords: +- storage +- dapps +- networking +- financial diff --git a/test/storj/1.0.0/README.md b/test/storj/1.0.0/README.md new file mode 100644 index 0000000000..8b4b4718fd --- /dev/null +++ b/test/storj/1.0.0/README.md @@ -0,0 +1,3 @@ +# storj + +[storj](https://www.storj.io/) share you extra storage and earn money diff --git a/test/storj/1.0.0/app-readme.md b/test/storj/1.0.0/app-readme.md new file mode 100644 index 0000000000..8b4b4718fd --- /dev/null +++ b/test/storj/1.0.0/app-readme.md @@ -0,0 +1,3 @@ +# storj + +[storj](https://www.storj.io/) share you extra storage and earn money diff --git a/test/storj/1.0.0/charts/common-2207.0.0.tgz b/test/storj/1.0.0/charts/common-2207.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..b0fc2dcb6bf97dd69a3ffd767cdd28596cb032ee GIT binary patch literal 4972 zcmV-y6O-&8iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<$bKAC-{j6VcmPzN@*_wLzwd0x2tk=%H^)z)daVGb6c6MBd zge24?zyP2eZR-8)J9v@cOOowaNm}89Es_TZ2f%sp-~fzRnljoyn;|a41xl0eK7Sbu z27{x61O0z67}Wm{MuWk3!-LWBXf!+=9vyx+7>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b8<&<*_1>u#_|?p z^YN3L{}BH z8C+1wS)A*X9Xp`r@LQXiBV4bG&4M$WWS9%Mosnn;5u(MZ&XPfl=Qv>*P<-pi%5}Pt qo}k8*>^g%0=CcSq{1)`wwrtC`Y|FM(%l`)e0RR7(xF_2HiU0tX9mG2T literal 0 HcmV?d00001 diff --git a/test/storj/1.0.0/ix_values.yaml b/test/storj/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..9d1be478c0 --- /dev/null +++ b/test/storj/1.0.0/ix_values.yaml @@ -0,0 +1,5 @@ +image: + pullPolicy: IfNotPresent + repository: storjlabs/storagenode + tag: 6a69f0345-v1.57.5-go1.17.5 +identityCreationMountPath: "/root/.local/share/storj/identity/storagenode" diff --git a/test/storj/1.0.0/questions.yaml b/test/storj/1.0.0/questions.yaml new file mode 100644 index 0000000000..ce95893778 --- /dev/null +++ b/test/storj/1.0.0/questions.yaml @@ -0,0 +1,273 @@ +groups: + - name: "Configuration" + description: "Storj application configuration" + - name: "Storage" + description: "Configure storage for storj" + - name: "Networking" + description: "Networking Configuration for storj" + - name: "Advanced DNS Settings" + description: "Configure DNS settings" + - name: "Resource Limits" + description: "Set CPU/memory limits for Kubernetes Pod" + +portals: + web_portal: + protocols: + - "http" + host: + - "$node_ip" + ports: + - "$variable-webPort" + path: "/" + +questions: + - variable: webPort + label: "Web Port for Storj" + group: Networking + schema: + type: int + min: 9000 + max: 65535 + default: 20909 + required: true + - variable: nodePort + label: "Node Port for Storj" + group: Networking + schema: + type: int + min: 9000 + max: 65535 + default: 20988 + required: true + + - variable: dnsConfig + label: "DNS Configuration" + group: "Advanced DNS Settings" + schema: + type: dict + attrs: + - variable: options + label: "DNS Options" + schema: + type: list + items: + - variable: optionsEntry + label: "Option Entry Configuration" + schema: + type: dict + attrs: + - variable: name + label: "Option Name" + schema: + type: string + required: true + - variable: value + label: "Option Value" + schema: + type: string + required: true + + - variable: wallet + label: "Configure Wallet for Storj" + group: "Configuration" + schema: + type: string + required: true + + - variable: authToken + label: "Configure Auth token for Storj Node" + group: "Configuration" + schema: + type: string + required: true + + - variable: email + label: "Configure Email for Storj" + group: "Configuration" + schema: + type: string + required: true + + - variable: domainAddress + label: "Add Your Storage Domain for Storj" + group: "Configuration" + schema: + type: string + required: true + + - variable: storageSize + label: "Configure Storage Size You Want To Share in GB's" + group: Storage + schema: + type: int + min: 500 + default: 500 + + - variable: runAsUser + label: "Owner User ID" + group: "Configuration" + schema: + immutable: true + type: int + default: 568 + min: 1 + max: 65535 + + - variable: runAsGroup + label: "Owner Group ID" + group: "Configuration" + schema: + immutable: true + type: int + default: 568 + min: 1 + max: 65535 + + + - variable: environmentVariables + label: "Storj Extra Environment Variables" + group: "Configuration" + schema: + type: list + default: [] + items: + - variable: environmentVariable + label: "Environment Variable" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + - variable: appVolumeMounts + label: "Storj Configuration" + group: "Storage" + schema: + type: dict + attrs: + - variable: data + label: "Configuration Data Volume to Share on Storj" + schema: + type: dict + attrs: + - variable: datasetName + label: "Configuration Volume Dataset Name" + schema: + type: string + hidden: true + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix_data" + editable: false + - variable: mountPath + label: "Configuration Mount Path" + description: "Path Where the Volume Will be Mounted Inside the Pod" + schema: + type: path + hidden: true + editable: false + default: "/app/config" + - variable: hostPathEnabled + label: "Enable Custom Host Path for Storj Configuration Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Storj Configuration Volume" + schema: + type: hostpath + required: true + - variable: identity + label: "Configure Identity Volume for Storage Node" + schema: + type: dict + attrs: + - variable: datasetName + label: "Configure Storj Identity Volume to Allocate" + schema: + type: string + hidden: true + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix_identity" + editable: false + - variable: mountPath + label: "Configure Storj Identity Volume to Allocate" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + hidden: true + editable: false + default: "/app/identity" + - variable: hostPathEnabled + label: "Enable Custom Host Path for Storj Identity Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Storj identity Volume" + schema: + type: hostpath + required: true + + - variable: extraAppVolumeMounts + label: "Extra Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: extraAppVolume + label: "Host Path Volume" + description: "Add an extra host path volume for storj" + schema: + type: dict + attrs: + - variable: mountPath + label: "Mount Path in Pod" + description: "Path where the volume will be mounted inside the pod." + schema: + type: path + required: true + - variable: hostPath + label: "Host Path" + description: "Host path" + schema: + type: hostpath + required: true + + - variable: enableResourceLimits + label: "Enable Pod resource limits" + group: "Resource Limits" + schema: + type: boolean + default: false + - variable: cpuLimit + label: "CPU Limresource limitsit" + description: "CPU resource limit allow plain integer values with suffix m(milli) e.g 1000m, 100." + group: "Resource Limits" + schema: + type: string + show_if: [["enableResourceLimits", "=", true]] + valid_chars: "^\\d+(?:\\.\\d+(?!.*m$)|m?$)" + default: "4000m" + - variable: memLimit + label: "Memory Limit" + group: "Resource Limits" + description: "Memory limits is specified by number of bytes. Followed by quantity suffix like E,P,T,G,M,k and Ei,Pi,Ti,Mi,Gi,Ki can also be used. e.g 129e6, 129M, 128974848000m, 123Mi" + schema: + type: string + show_if: [["enableResourceLimits", "=", true]] + valid_chars: "^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + default: "8Gi" diff --git a/test/storj/1.0.0/templates/_helpers.tpl b/test/storj/1.0.0/templates/_helpers.tpl new file mode 100644 index 0000000000..e0d5ef1a59 --- /dev/null +++ b/test/storj/1.0.0/templates/_helpers.tpl @@ -0,0 +1,6 @@ +{{/* +Retrieve cert path +*/}} +{{- define "certPath" -}} +{{ printf }} +{{- end -}} diff --git a/test/storj/1.0.0/templates/deployment.yaml b/test/storj/1.0.0/templates/deployment.yaml new file mode 100644 index 0000000000..51c782b4f2 --- /dev/null +++ b/test/storj/1.0.0/templates/deployment.yaml @@ -0,0 +1,97 @@ +{{ include "common.storage.hostPathValidate" .Values }} +apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} +kind: Deployment +metadata: + name: {{ template "common.names.fullname" . }} + labels: + app: {{ template "common.names.name" . }} + chart: {{ template "common.names.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + rollme: {{ randAlphaNum 5 | quote }} +spec: + replicas: {{ (default 1 .Values.replicas) }} + strategy: + type: "Recreate" + selector: + matchLabels: + app: {{ template "common.names.name" . }} + release: {{ .Release.Name }} + template: + metadata: + name: {{ template "common.names.fullname" . }} + labels: + app: {{ template "common.names.name" . }} + release: {{ .Release.Name }} + {{- include "common.labels.selectorLabels" . | nindent 8 }} + annotations: {{ include "common.annotations" . | nindent 8 }} + spec: + initContainers: + - name: generate-identity + image: "alpine/curl:latest" + securityContext: + runAsUser: 0 + runAsGroup: 0 + command: + - ./init_script/init_config.sh + env: + {{ $envListIdentity := (default list) }} + {{ $envListIdentity = mustAppend $envListIdentity (dict "name" "DEFAULT_CERT_PATH" "value" (printf "%s/ca.cert" .Values.identityCreationMountPath)) }} + {{ $envListIdentity = mustAppend $envListIdentity (dict "name" "DEFAULT_IDENTITY_CERT_PATH" "value" (printf "%s/identity.cert" .Values.identityCreationMountPath)) }} + {{ $envListIdentity = mustAppend $envListIdentity (dict "name" "AUTH_KEY" "valueFromSecret" true "secretName" "storj-credentials" "secretKey" "authToken") }} + {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envListIdentity) | nindent 12 }} + volumeMounts: + - name: initial-scripts + mountPath: /init_script/ + - name: identity + mountPath: {{ .Values.identityCreationMountPath }} + - name: setup + {{ include "common.containers.imageConfig" .Values.image | nindent 8 }} + command: + - /bin/sh + - -c + - 'test ! -f {{ .Values.appVolumeMounts.data.mountPath }}/config.yaml && export SETUP="true"; /entrypoint;' + {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 8 }} + securityContext: + runAsUser: {{ .Values.runAsUser }} + runAsGroup: {{ .Values.runAsGroup }} + containers: + - name: {{ .Chart.Name }} + {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} + {{ include "common.resources.limitation" . | nindent 10 }} + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + mountPath: {{ $hostPathConfiguration.mountPath }} + {{ end }} + securityContext: + runAsUser: {{ .Values.runAsUser }} + runAsGroup: {{ .Values.runAsGroup }} + ports: + - name: web + containerPort: 14002 + - name: tcp + containerPort: 28967 + protocol: TCP + - name: udp + containerPort: 28967 + protocol: UDP + env: + {{ $envList := (default list .Values.environmentVariables) }} + {{ $envList = mustAppend $envList (dict "name" "WALLET" "valueFromSecret" true "secretName" "storj-credentials" "secretKey" "wallet") }} + {{ $envList = mustAppend $envList (dict "name" "ADDRESS" "value" (printf "%s:%d" (.Values.domainAddress) (.Values.nodePort | int))) }} + {{ $envList = mustAppend $envList (dict "name" "EMAIL" "value" (printf "%s" (.Values.email))) }} + {{ $envList = mustAppend $envList (dict "name" "STORAGE" "value" (printf "%dGB" (.Values.storageSize | int))) }} + {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} +{{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} + {{ end }} + - name: initial-scripts + configMap: + defaultMode: 0755 + name: "initial-scripts" diff --git a/test/storj/1.0.0/templates/initial_scripts.yaml b/test/storj/1.0.0/templates/initial_scripts.yaml new file mode 100644 index 0000000000..3c13ae5e25 --- /dev/null +++ b/test/storj/1.0.0/templates/initial_scripts.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "initial-scripts" + annotations: + rollme: {{ randAlphaNum 5 | quote }} + +data: + init_config.sh: |- + #!/bin/sh + if ! [ -f ${DEFAULT_CERT_PATH} ] && ! [ -f ${DEFAULT_IDENTITY_CERT_PATH} ]; then + curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip -o identity_linux_amd64.zip + unzip -o identity_linux_amd64.zip + chmod +x identity + ./identity create storagenode + ./identity authorize storagenode ${AUTH_KEY} + chown -R {{ .Values.runAsUser }}:{{ .Values.runAsGroup }} {{ .Values.identityCreationMountPath }} + fi diff --git a/test/storj/1.0.0/templates/pre-install-job.yaml b/test/storj/1.0.0/templates/pre-install-job.yaml new file mode 100644 index 0000000000..7a51d08121 --- /dev/null +++ b/test/storj/1.0.0/templates/pre-install-job.yaml @@ -0,0 +1,28 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: "{{ template "common.names.fullname" . }}-preinstall-job" + labels: + app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + helm.sh/chart: {{ template "common.names.chart" . }} + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: "{{ template "common.names.fullname" . }}-preinstall-hook" + labels: + app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + helm.sh/chart: {{ template "common.names.chart" . }} + spec: + restartPolicy: Never + containers: + - name: pre-install-job + image: "alpine:latest" + command: ["chown", "-R", "{{ .Values.runAsUser }}:{{ .Values.runAsGroup }}", "{{ .Values.appVolumeMounts.data.mountPath }}", "{{ .Values.appVolumeMounts.identity.mountPath }}"] + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} diff --git a/test/storj/1.0.0/templates/service.yaml b/test/storj/1.0.0/templates/service.yaml new file mode 100644 index 0000000000..085c55f344 --- /dev/null +++ b/test/storj/1.0.0/templates/service.yaml @@ -0,0 +1,11 @@ +{{ $selectors := list }} +{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }} +{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "web" "port" .Values.webPort "nodePort" .Values.webPort "targetPort" 14002) }} +{{ $ports = mustAppend $ports (dict "name" "tcp" "port" .Values.nodePort "nodePort" .Values.nodePort "targetPort" 28967) }} +{{ $ports = mustAppend $ports (dict "name" "udp" "port" .Values.nodePort "nodePort" .Values.nodePort "targetPort" 28967 "protocol" "UDP") }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} +{{ $_1 := set .Values "extraSelectorLabels" $selectors }} +{{ include "common.classes.service" $params }} diff --git a/test/storj/1.0.0/templates/storj-secrets.yaml b/test/storj/1.0.0/templates/storj-secrets.yaml new file mode 100644 index 0000000000..f72579549f --- /dev/null +++ b/test/storj/1.0.0/templates/storj-secrets.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: storj-credentials + labels: {{ include "common.labels" . | nindent 4 }} +type: Opaque +data: + authToken: {{ .Values.authToken | b64enc | quote }} + wallet: {{ .Values.wallet | b64enc | quote }} diff --git a/test/storj/1.0.0/test_values.yaml b/test/storj/1.0.0/test_values.yaml new file mode 100644 index 0000000000..e7f319d802 --- /dev/null +++ b/test/storj/1.0.0/test_values.yaml @@ -0,0 +1,26 @@ +image: + pullPolicy: IfNotPresent + repository: storjlabs/storagenode + tag: 6a69f0345-v1.57.5-go1.17.5 +environmentVariables: [] +extraAppVolumeMounts: [] +webPort: 30000 +nodePort: 30002 +storageSize: 500 +wallet: "0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +email: "user@example.com" +dnsConfig: + options: [] +emptyDirVolumes: true +appVolumeMounts: + data: + emptyDir: true + mountPath: /app/config + identity: + emptyDir: true + mountPath: /app/identity +authToken: "user:sasjkadkjhakdlaskdlkajsd" +identityCreationMountPath: "/root/.local/share/storj/identity/storagenode" +domainAddress: "localhost" +runAsUser: 568 +runAsGroup: 568 diff --git a/test/storj/item.yaml b/test/storj/item.yaml new file mode 100644 index 0000000000..14f5edd11b --- /dev/null +++ b/test/storj/item.yaml @@ -0,0 +1,6 @@ +icon_url: https://assets-global.website-files.com/602eda09fc78afc76e9706b6/60917835a05862243e7de9af_logo.svg +categories: +- storage +- dapps +- networking +- finantial