-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a single Helm package for dracon-dev and relevant make targets
This commit unifies the installation of dracon-dev and its dependencies via one single helm package. It installs all necessary dependencies for development such as Elasticsearch, Kibana, Postgres, Mongo and Tekton. Dependencies that need to be installed on a namespace different than the dracon components such as Tekton, Nginx, ElasticOperator and ArangoDB are installed via Make targets. This commit also refactors Make targets introducing `deploy-dracon-dev` which builds and loads dracon container images and installs the helm chart. Last this commit runs the necessary dracon migrations job as a helm post-install hook
- Loading branch information
1 parent
0a533f2
commit e0d92de
Showing
18 changed files
with
216 additions
and
54 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
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,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/ |
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,15 @@ | ||
dependencies: | ||
- name: postgresql | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 15.2.5 | ||
- name: mongodb | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 15.1.5 | ||
- name: elasticsearch | ||
repository: file://../elasticsearch | ||
version: 0.1.0 | ||
- name: kibana | ||
repository: file://../kibana | ||
version: 0.1.0 | ||
digest: sha256:a9bd592c24509f294eae3b9415f420b6ec7de9a141d2ba410b7eb7602e866961 | ||
generated: "2024-04-26T18:23:56.800279848+01:00" |
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,23 @@ | ||
apiVersion: v2 | ||
name: dracon | ||
description: A Helm chart for Kubernetes | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "0.1.0" | ||
dependencies: | ||
- name: postgresql | ||
version: 15.2.5 | ||
repository: https://charts.bitnami.com/bitnami | ||
condition: postgres.enabled | ||
- name: mongodb | ||
version: 15.1.5 | ||
repository: https://charts.bitnami.com/bitnami | ||
condition: mongodb.enabled | ||
- name: elasticsearch | ||
version: 0.1.0 | ||
repository: file://../elasticsearch | ||
condition: elasticsearch.enabled | ||
- name: kibana | ||
version: 0.1.0 | ||
repository: file://../kibana | ||
condition: kibana.enabled |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "dracon-migrations.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 "dracon-migrations.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 "dracon-migrations.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "dracon-migrations.labels" -}} | ||
helm.sh/chart: {{ include "dracon-migrations.chart" . }} | ||
{{ include "dracon-migrations.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "dracon-migrations.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "dracon-migrations.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "dracon-migrations.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "dracon-migrations.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.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,29 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: "{{.Release.Name}}" | ||
namespace: "{{.Values.namespace }}" | ||
labels: | ||
app.kubernetes.io/managed-by: {{.Release.Service | quote }} | ||
app.kubernetes.io/instance: {{.Release.Name | quote }} | ||
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" | ||
annotations: | ||
# This is what defines this resource as a hook. Without this line, the | ||
# job is considered part of the release. | ||
"helm.sh/hook": post-install | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
template: | ||
metadata: | ||
name: dracon-migrations | ||
labels: | ||
app.kubernetes.io/managed-by: {{.Release.Service | quote }} | ||
app.kubernetes.io/instance: {{.Release.Name | quote }} | ||
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: dracon-migrations | ||
image: {{.Values.global.image.registry}}/ocurity/dracon/draconctl:{{.Values.global.image.draconVersion|default "latest"}} | ||
command: ["draconctl","migrations","apply","--url", {{.Values.global.enrichmentDB.connectionStr | quote}},"/etc/dracon/migrations/enrichment"] |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ apiVersion: v1 | |
kind: ServiceAccount | ||
metadata: | ||
name: dracon-migrations | ||
namespace: "{{.Values.namespace }}" |
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,38 @@ | ||
|
||
elasticsearch: | ||
enabled: true | ||
version: 8.3.2 | ||
|
||
kibana: | ||
enabled: true | ||
version: 8.3.2 | ||
|
||
mongodb: | ||
enabled: true | ||
# auth: | ||
# enabled: true | ||
# usernames: ["consumer-mongodb"] | ||
# passwords: ["consumer-mongodb"] | ||
# databases: ["consumer-mongodb"] | ||
# rootUser: "consumer-mongodb" | ||
# rootPassword: "consumer-mongodb" | ||
|
||
postgresql: | ||
enabled: true | ||
auth: | ||
username: dracon | ||
password: dracon | ||
database: dracon | ||
postgresPassword: dracon | ||
fullnameOverride: dracon-enrichment-db | ||
|
||
tekton: | ||
enabled: true | ||
|
||
global: | ||
namespace: dracon | ||
image: | ||
registry: kind-registry:5000 | ||
draconVersion: "0.1.0" | ||
enrichmentDB: | ||
connectionStr: postgresql://dracon:[email protected]?sslmode=disable |
Empty file.
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 |
---|---|---|
@@ -1,24 +1,6 @@ | ||
apiVersion: v2 | ||
name: kibana | ||
description: A Helm chart for Kubernetes | ||
|
||
# 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: 0.1.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: "1.16.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