Skip to content

Commit

Permalink
feat(cryostat): deploy cryostat 3.0 (cryostatio#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored and aali309 committed Jun 20, 2024
1 parent 89fb49e commit 412339d
Show file tree
Hide file tree
Showing 10 changed files with 461 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/cryostat/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ version: "0.5.0-dev"

kubeVersion: ">= 1.21.0-0"

<<<<<<< HEAD
appVersion: "4.0.0-dev"
=======
appVersion: "3.0.0-dev"
>>>>>>> d4bb92a (feat(cryostat): deploy cryostat 3.0 (#111))

home: "https://cryostat.io"

Expand Down
57 changes: 57 additions & 0 deletions charts/cryostat/README.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions charts/cryostat/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
{{- $listNum = add1 $listNum }}
```
{{- if .Values.core.route.enabled }}
<<<<<<< HEAD
{{- /* Do nothing */}}
No actions required with this configuration.
=======
export ROUTE_HOST=$(oc get route -n {{ .Release.Namespace }} {{ include "cryostat.fullname" . }} -o jsonpath="{.status.ingress[0].host}")
{{- $envVars = list "STORAGE_EXT_URL=$ROUTE_HOST" }}
>>>>>>> d4bb92a (feat(cryostat): deploy cryostat 3.0 (#111))
{{- else if .Values.core.ingress.enabled }}
{{- /* Do nothing */}}
No actions required with this configuration.
Expand Down
46 changes: 46 additions & 0 deletions charts/cryostat/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,17 @@ Create the name of the service account to use
{{- end }}

{{/*
<<<<<<< HEAD
Get or generate a default connection key for database
*/}}
{{- define "cryostat.databaseConnectionKey" -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (printf "%s-db" .Release.Name)) -}}
=======
Get or generate a default connection key for credentials database
*/}}
{{- define "cryostat.databaseConnectionKey" -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (printf "%s-db-connection-key" .Release.Name)) -}}
>>>>>>> d4bb92a (feat(cryostat): deploy cryostat 3.0 (#111))
{{- if $secret -}}
{{/*
Use current key. Do not regenerate
Expand All @@ -74,6 +81,45 @@ Get or generate a default connection key for database
{{- else -}}
{{/*
Generate new key
<<<<<<< HEAD
=======
*/}}
{{- (randAlphaNum 32) | b64enc | quote -}}
{{- end -}}
{{- end -}}

{{/*
Get or generate a default encryption key for credentials database
*/}}
{{- define "cryostat.databaseEncryptionKey" -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (printf "%s-db-encryption-key" .Release.Name)) -}}
{{- if $secret -}}
{{/*
Use current key. Do not regenerate
*/}}
{{- $secret.data.CRYOSTAT_JMX_CREDENTIALS_DB_PASSWORD -}}
{{- else -}}
{{/*
Generate new key
*/}}
{{- (randAlphaNum 32) | b64enc | quote -}}
{{- end -}}
{{- end -}}

{{/*
Get or generate a default secret key for object storage
*/}}
{{- define "cryostat.objectStorageSecretKey" -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (printf "%s-storage-secret-key" .Release.Name)) -}}
{{- if $secret -}}
{{/*
Use current secret. Do not regenerate
*/}}
{{- $secret.data.SECRET_KEY -}}
{{- else -}}
{{/*
Generate new secret
>>>>>>> d4bb92a (feat(cryostat): deploy cryostat 3.0 (#111))
*/}}
{{- (randAlphaNum 32) | b64enc | quote -}}
{{- end -}}
Expand Down
7 changes: 7 additions & 0 deletions charts/cryostat/templates/db_connection_key_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-db-connection-key
type: Opaque
data:
CONNECTION_KEY: {{ include "cryostat.databaseConnectionKey" . }}
9 changes: 9 additions & 0 deletions charts/cryostat/templates/db_encryption_key_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if empty .Values.core.databaseSecretName -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-db-encryption-key
type: Opaque
data:
ENCRYPTION_KEY: {{ include "cryostat.databaseEncryptionKey" . }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/cryostat/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD
{{- if (.Values.authentication.openshift).enabled -}}
=======
{{- if .Values.core.route.enabled -}}
>>>>>>> d4bb92a (feat(cryostat): deploy cryostat 3.0 (#111))
{{- $fullName := include "cryostat.fullname" . -}}
{{- $redirectAnnotations := dict "serviceaccounts.openshift.io/oauth-redirectreference.primary" (printf "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"%s\"}}" $fullName) -}}
{{- $_ := merge .Values.serviceAccount.annotations $redirectAnnotations -}}
Expand Down
7 changes: 7 additions & 0 deletions charts/cryostat/templates/storage_access_key_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-storage-secret-key
type: Opaque
data:
SECRET_KEY: {{ include "cryostat.objectStorageSecretKey" . }}
Loading

0 comments on commit 412339d

Please sign in to comment.