diff --git a/config/helmchart/.helmignore b/config/helmchart/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/config/helmchart/.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/config/helmchart/Chart.yaml b/config/helmchart/Chart.yaml new file mode 100644 index 00000000..9b47fa29 --- /dev/null +++ b/config/helmchart/Chart.yaml @@ -0,0 +1,47 @@ +apiVersion: v2 +name: falcon-platform +description: A Helm chart to deploy CrowdStrike Falcon sensors into Kubernetes clusters using the CrowdStrike Falcon Operator. + +# 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 + +# 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: $VERSION + +# 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: "$VERSION" + +keywords: + - CrowdStrike + - Falcon + - EDR + - kubernetes + - security + - monitoring + - alerting + - operator + +home: https://crowdstrike.com + +sources: + - https://github.com/CrowdStrike/falcon-helm + - https://github.com/CrowdStrike/falcon-operator + +maintainers: + - name: CrowdStrike Solutions Architecture + email: integrations@crowdstrike.com + +icon: https://raw.githubusercontent.com/CrowdStrike/falcon-helm/main/images/crowdstrike-logo.svg +kubeVersion: ">1.24.0-0" diff --git a/config/helmchart/kustomization.yaml b/config/helmchart/kustomization.yaml new file mode 100644 index 00000000..3a461b18 --- /dev/null +++ b/config/helmchart/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +helmGlobals: + chartHome: ../helmchart +helmCharts: + - name: test + version: 1.0.0 diff --git a/config/helmchart/templates/_helpers.tpl b/config/helmchart/templates/_helpers.tpl new file mode 100644 index 00000000..911101ab --- /dev/null +++ b/config/helmchart/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "falcon-platform.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 "falcon-platform.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 "falcon-platform.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "falcon-platform.labels" -}} +helm.sh/chart: {{ include "falcon-platform.chart" . }} +{{ include "falcon-platform.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "falcon-platform.selectorLabels" -}} +app.kubernetes.io/name: {{ include "falcon-platform.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "falcon-platform.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "falcon-platform.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/config/helmchart/templates/operatorgroup.yaml b/config/helmchart/templates/operatorgroup.yaml new file mode 100644 index 00000000..2a5a5241 --- /dev/null +++ b/config/helmchart/templates/operatorgroup.yaml @@ -0,0 +1,7 @@ +{{- if .Values.certified.enabled }} +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: falcon-operator + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/config/helmchart/templates/subscription.yaml b/config/helmchart/templates/subscription.yaml new file mode 100644 index 00000000..ebcda457 --- /dev/null +++ b/config/helmchart/templates/subscription.yaml @@ -0,0 +1,17 @@ +{{- if .Values.certified.enabled }} +--- +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: falcon-operator + namespace: {{ .Release.Namespace }} + labels: + {{- include "falcon-platform.labels" . | nindent 4 }} +spec: + channel: {{ .Values.certified.channel }} + installPlanApproval: {{ .Values.certified.installPlanApproval }} + name: falcon-operator-rhmp + source: redhat-marketplace + sourceNamespace: openshift-marketplace + startingCSV: falcon-operator.v{{ .Chart.AppVersion }} +{{- end }} diff --git a/config/helmchart/values.yaml b/config/helmchart/values.yaml new file mode 100644 index 00000000..ea47d7fa --- /dev/null +++ b/config/helmchart/values.yaml @@ -0,0 +1,4 @@ +certified: + enabled: false + channel: stable + installPlanApproval: Automatic