Skip to content

Commit

Permalink
feat: Add initial scaffolding for helm chart source
Browse files Browse the repository at this point in the history
- Operator Helm chart source code with reside in this project.
  This PR adds some initial Helm chart configuration to deploy the certified operator.
  • Loading branch information
redhatrises committed Sep 13, 2023
1 parent aa59e91 commit a00a469
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 0 deletions.
23 changes: 23 additions & 0 deletions config/helmchart/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
47 changes: 47 additions & 0 deletions config/helmchart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]

icon: https://raw.githubusercontent.com/CrowdStrike/falcon-helm/main/images/crowdstrike-logo.svg
kubeVersion: ">1.24.0-0"
62 changes: 62 additions & 0 deletions config/helmchart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 }}
7 changes: 7 additions & 0 deletions config/helmchart/templates/operatorgroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- if .Values.certified.enabled }}
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: falcon-operator
namespace: {{ .Release.Namespace }}
{{- end }}
17 changes: 17 additions & 0 deletions config/helmchart/templates/subscription.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 4 additions & 0 deletions config/helmchart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
certified:
enabled: false
channel: stable
installPlanApproval: Automatic

0 comments on commit a00a469

Please sign in to comment.