-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from jordanopensource/task/create_spiderfoot_v…
…ersion_2.0.0 Create spiderfoot version 2.0.0
- Loading branch information
Showing
12 changed files
with
345 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
apiVersion: v2 | ||
name: spiderfoot | ||
description: Spiderfoot helm chart for Kubernetes | ||
description: A Helm chart for spiderfoot | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
version: 1.0.1 | ||
appVersion: 3.3.0 | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 2.0.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "3.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{- define "common.labels.standard" -}} | ||
{{- if and (hasKey . "customLabels") (hasKey . "context") -}} | ||
{{- $default := dict "app.kubernetes.io/name" (include "common.names.name" .context) "helm.sh/chart" (include "common.names.chart" .context) "app.kubernetes.io/instance" .context.Release.Name "app.kubernetes.io/managed-by" .context.Release.Service -}} | ||
{{- with .context.Chart.AppVersion -}} | ||
{{- $_ := set $default "app.kubernetes.io/version" . -}} | ||
{{- end -}} | ||
{{ template "common.tplvalues.merge" (dict "values" (list .customLabels $default) "context" .context) }} | ||
{{- else -}} | ||
app.kubernetes.io/name: {{ include "common.names.name" . }} | ||
helm.sh/chart: {{ include "common.names.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- with .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ . | quote }} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Labels used on immutable fields such as deploy.spec.selector.matchLabels or svc.spec.selector | ||
{{ include "common.labels.matchLabels" (dict "customLabels" .Values.podLabels "context" $) -}} | ||
|
||
We don't want to loop over custom labels appending them to the selector | ||
since it's very likely that it will break deployments, services, etc. | ||
However, it's important to overwrite the standard labels if the user | ||
overwrote them on metadata.labels fields. | ||
*/}} | ||
{{- define "common.labels.matchLabels" -}} | ||
{{- if and (hasKey . "customLabels") (hasKey . "context") -}} | ||
{{ merge (pick (include "common.tplvalues.render" (dict "value" .customLabels "context" .context) | fromYaml) "app.kubernetes.io/name" "app.kubernetes.io/instance") (dict "app.kubernetes.io/name" (include "common.names.name" .context) "app.kubernetes.io/instance" .context.Release.Name ) | toYaml }} | ||
{{- else -}} | ||
app.kubernetes.io/name: {{ include "common.names.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "common.names.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "common.names.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | 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 "common.names.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 -}} | ||
|
||
{{/* | ||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts. | ||
*/}} | ||
{{- define "common.names.namespace" -}} | ||
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a fully qualified app name adding the installation's namespace. | ||
*/}} | ||
{{- define "common.names.fullname.namespace" -}} | ||
{{- printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{/* | ||
Return the proper Storage Class | ||
{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }} | ||
*/}} | ||
{{- define "common.storage.class" -}} | ||
|
||
{{- $storageClass := .persistence.storageClass -}} | ||
{{- if .global -}} | ||
{{- if .global.storageClass -}} | ||
{{- $storageClass = .global.storageClass -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- if $storageClass -}} | ||
{{- if (eq "-" $storageClass) -}} | ||
{{- printf "storageClassName: \"\"" -}} | ||
{{- else }} | ||
{{- printf "storageClassName: %s" $storageClass -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* | ||
Renders a value that contains template perhaps with scope if the scope is present. | ||
Usage: | ||
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }} | ||
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }} | ||
*/}} | ||
{{- define "common.tplvalues.render" -}} | ||
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }} | ||
{{- if contains "{{" (toJson .value) }} | ||
{{- if .scope }} | ||
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }} | ||
{{- else }} | ||
{{- tpl $value .context }} | ||
{{- end }} | ||
{{- else }} | ||
{{- $value }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Merge a list of values that contains template after rendering them. | ||
Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge | ||
Usage: | ||
{{ include "common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }} | ||
*/}} | ||
{{- define "common.tplvalues.merge" -}} | ||
{{- $dst := dict -}} | ||
{{- range .values -}} | ||
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}} | ||
{{- end -}} | ||
{{ $dst | toYaml }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{- if and .Values.persistence.enabled .Values.persistence.hostPath (not .Values.persistence.existingClaim) -}} | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: {{ include "common.names.fullname" . }}-spiderfoot | ||
namespace: {{ include "common.names.namespace" . | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if not (empty .Values.persistence.accessModes) }} | ||
accessModes: | ||
{{- range .Values.persistence.accessModes }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
{{- end }} | ||
capacity: | ||
storage: {{ .Values.persistence.size | quote }} | ||
hostPath: | ||
path: {{ .Values.persistence.hostPath | quote }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
{{- if .Values.persistence.enabled }} | ||
{{- if not .Values.persistence.existingClaim -}} | ||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ template "spiderfoot.fullname" . }} | ||
labels: | ||
app: {{ template "spiderfoot.fullname" . }} | ||
name: {{ include "common.names.fullname" . }}-spiderfoot | ||
namespace: {{ include "common.names.namespace" . | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
{{- if or .Values.persistence.annotations .Values.commonAnnotations }} | ||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.persistence.annotations .Values.commonAnnotations ) "context" . ) }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
accessModes: | ||
- {{ .Values.persistence.accessMode | quote }} | ||
{{- if .Values.persistence.storageClass }} | ||
storageClassName: "{{ .Values.persistence.storageClass }}" | ||
{{- else }} | ||
{{- if .Values.persistence.hostPath }} | ||
storageClassName: "" | ||
{{- end }} | ||
{{- else }} | ||
{{- include "spiderfoot.storageClass" . | nindent 2 }} | ||
{{- end }} | ||
{{- if not (empty .Values.persistence.accessModes) }} | ||
accessModes: | ||
{{- range .Values.persistence.accessModes }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.persistence.size | quote }} | ||
{{- end -}} | ||
{{- end }} | ||
{{- if .Values.persistence.selector }} | ||
selector: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.selector "context" $) | nindent 4 }} | ||
{{- end -}} | ||
{{- if .Values.persistence.dataSource }} | ||
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.dataSource "context" $) | nindent 4 }} | ||
{{- end }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.