Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 49 subchart changes image auto publish #57

Merged
merged 6 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helm/config/dataone-indexer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ index.tdb.directory={{ .Values.idxworker.tripleDbDirectory }}

#The section for the rabbitMQ configuration
index.rabbitmq.hostname={{ include "idxworker.rabbitmq.hostname" . }}
index.rabbitmq.hostport={{ default .Values.rabbitmq.service.ports.amqp .Values.rabbitmq.hostport }}
index.rabbitmq.hostport={{- include "idxworker.rabbitmq.hostport" . }}
index.rabbitmq.username={{ .Values.rabbitmq.auth.username }}
## index.rabbitmq.password will be read from RABBITMQ_PASSWORD env var
index.rabbitmq.password=${env:RABBITMQ_PASSWORD}
Expand Down
10 changes: 6 additions & 4 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ APP VERSION: {{ .Chart.AppVersion }}

** Please be patient while the chart is being deployed **


RABBITMQ:
=========
Credentials:
echo "Username: {{ .Values.rabbitmq.auth.username }}"
echo "Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ .Values.rabbitmq.auth.existingPasswordSecret }} -o jsonpath="{.data.rabbitmq-password}" | base64 -d)"
echo "To get password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ .Values.rabbitmq.auth.existingPasswordSecret }} -o jsonpath="{.data.rabbitmq-password}" | base64 -d)"

Note that the credentials are saved in persistent volume claims and will not be changed upon upgrade or reinstallation unless the persistent volume claim has been deleted. If this is not the first installation of this chart, the credentials may not be valid.
IMPORTANT NOTE: the credentials are saved in persistent volume claims and will not be changed upon upgrade or re-installation unless the persistent volume claim has been deleted. If this is not the first installation of this chart, the credentials may not be valid.

This is applicable when no passwords are set and therefore the random password is autogenerated. In case of using a fixed password, you should specify it when upgrading.

More information about the credentials may be found at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases.

{{- $rmqHostPort := default .Values.rabbitmq.service.ports.amqp .Values.rabbitmq.hostport -}}
{{- $rmqHostPort := include "idxworker.rabbitmq.hostport" . -}}

RabbitMQ can be accessed within the cluster on port {{ $rmqHostPort }} at {{ include "idxworker.rabbitmq.hostname" . }}

Expand All @@ -37,12 +38,13 @@ Then, open the obtained URL in a browser.

{{- end }}


SOLR:
=====
Solr can be accessed via port {{ .Values.global.solrPort }} on the following DNS name from within
your cluster:

{{ .Values.solr.hostname }}:{{ .Values.global.solrPort }}
{{ include "idxworker.solr.hostname" . }}:{{ .Values.global.solrPort }}

{{- if .Values.solr.auth.enabled }}

Expand Down
55 changes: 38 additions & 17 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ Create the name of the service account to use

{{/*
set MN url
e.g. https://metacat-dev.test.dataone.org/metacat/d1/mn
If we're running as a subchart, can use direct access without needing to go through ingress/https;
e.g. http://metacatbrooke-hl:8080/metacat/d1/mn
If connecting to an instance outside the cluster, should use https;
e.g. https://metacat-dev.test.dataone.org/metacat/d1/mn
*/}}
{{- define "idxworker.mn.url" -}}
{{- if not .Values.idxworker.mn_url }}
{{- printf "https://%s-metacat-hl/%s/d1/mn" .Release.Name .Values.global.metacatAppContext }}
{{- else }}
{{- .Values.idxworker.mn_url }}
{{- $mn_url := .Values.idxworker.mn_url }}
{{- if not $mn_url }}
{{- $mn_url = printf "http://%s-hl:8080/%s/d1/mn" .Release.Name .Values.global.metacatAppContext }}
{{- end }}
{{- $mn_url }}
{{- end }}

{{/*
Expand All @@ -79,31 +82,49 @@ Either use the value set in .Values.persistence.claimName, or if blank, autopopu
{podname}-metacat-{releaseName}-0 (e.g. metacatbrooke-metacat-metacatbrooke-0)
*/}}
{{- define "idxworker.shared.claimName" -}}
{{- if not .Values.persistence.claimName }}
{{- .Release.Name }}-metacat-{{- .Release.Name }}-0
{{- else }}
{{- .Values.persistence.claimName }}
{{- $claimName := .Values.persistence.claimName }}
{{- if not $claimName }}
{{- $claimName = .Release.Name }}-metacat-{{- .Release.Name }}-0
{{- end }}
{{- $claimName }}
{{- end }}

{{/*
Check if RabbitMQ SubChart is enabled
*/}}
{{- define "rmq.enabled" -}}
{{ $rmqEnabled := (or (((.Values.global).rabbitmq).enabled) ((.Values.rabbitmq).enabled)) }}
{{ end }}

{{/*
set RabbitMQ HostName
*/}}
{{- define "idxworker.rabbitmq.hostname" -}}
{{- if not .Values.rabbitmq.hostname }}
{{- .Release.Name }}-rabbitmq-headless
{{- else }}
{{- .Values.rabbitmq.hostname }}
{{- $rmqHost := .Values.idxworker.rabbitmqHostname }}
{{- if and (include "rmq.enabled" .) (not $rmqHost) -}}
{{- $rmqHost = printf "%s-rabbitmq-headless" .Release.Name -}}
{{- end }}
{{- $rmqHost }}
{{- end }}

{{/*
set RabbitMQ HostPort
*/}}
{{- define "idxworker.rabbitmq.hostport" }}
{{- $rmqPort := .Values.idxworker.rabbitmqHostPort }}
{{- if and (include "rmq.enabled" .) (not $rmqPort) -}}
{{ $rmqPort = .Values.rabbitmq.service.ports.amqp }}
{{- end }}
{{- $rmqPort }}
{{- end }}

{{/*
set Solr HostName
*/}}
{{- define "idxworker.solr.hostname" -}}
{{- if not .Values.solr.hostname }}
{{- .Release.Name }}-solr-headless
{{- else }}
{{- .Values.solr.hostname }}
{{- $solrHost := .Values.idxworker.solrHostname }}
{{- if and (or (((.Values.global).solr).enabled) ((.Values.solr).enabled)) (not $solrHost) -}}
{{- $solrHost = printf "%s-solr-headless" .Release.Name -}}
{{- end }}
{{- $solrHost }}
{{- end }}
7 changes: 4 additions & 3 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ spec:
- sh
- -c
- >
until nc -z {{ include "idxworker.rabbitmq.hostname" . }}{{- print " " }}
{{- default .Values.rabbitmq.service.ports.amqp .Values.rabbitmq.hostport }} >
{{- print " " }}/dev/null; do echo waiting for RabbitMQ; sleep 2; done;
HOST="{{ include "idxworker.rabbitmq.hostname" . }}";
PORT={{ include "idxworker.rabbitmq.hostport" . }};
until nc -z $HOST $PORT > /dev/null; do
echo waiting for RabbitMQ at $HOST - port $PORT; sleep 1; done;
- name: init-solr
image: busybox:latest
command:
Expand Down
43 changes: 23 additions & 20 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ global:
## @param global.ephemeralVolumeStorageClass Optional override of global.storageClass.
## Can be used to assign a storageClass that has a 'Delete' Reclaim Policy, thus allowing
## ephemeral volumes to be cleaned up automatically (eg "csi-cephfs-sc-ephemeral")
## Comment out to use default StorageClass, if one is set on your cluster
##
ephemeralVolumeStorageClass: csi-cephfs-sc-ephemeral

Expand Down Expand Up @@ -103,6 +104,21 @@ idxworker:
##
cn_url: "https://cn.dataone.org/cn"

## @param idxworker.solrHostname hostname of the solr service to use
## Leave unset (solrHostname: "") to automatically populate when using solr bitnami subchart
##
solrHostname: ""

## @param idxworker.rabbitmqHostname hostname of the rabbitmq service to use
## Leave unset (rabbitmqHostname: "") to automatically populate when using rmq bitnami subchart
##
rabbitmqHostname: ""

## @param idxworker.rabbitmqHostPort hostport of the rabbitmq service
## Leave unset (rabbitmqHostPort: "") to automatically populate when using rmq bitnami subchart
##
rabbitmqHostPort: ""

## @param idxworker.data_directory Location of data within the metacat shared volume
##
data_directory: /var/metacat/data
Expand All @@ -119,19 +135,10 @@ idxworker:
##
tripleDbDirectory: /etc/dataone/tdb-cache

## @section RabbitMQ Configuration
## @section RabbitMQ Bitnami Sub-Chart Configuration
##
rabbitmq:
enabled: true
## @param rabbitmq.hostname (idxworker-specific param): hostname of the rabbitmq service to use
## Leave this value unset (hostname: "") to have it automatically populated
##
hostname: ""
## @param rabbitmq.hostport (idxworker-specific param): hostport of the rabbitmq service
## Leave this value unset (hostport: "") to have it automatically populated
##
hostport: ""

persistence:
size: 10Gi
#replicaCount: 3
Expand All @@ -150,9 +157,10 @@ rabbitmq:
existingPasswordSecret: ""


## @section Solr Configuration
## @section Solr Bitnami Sub-Chart Configuration
##
solr:
enabled: true
collection: temp_collection

## @param solr.customCollection (required) name of the solr collection to use
Expand All @@ -163,11 +171,10 @@ solr:
- dataone_core
#javaMem: "-Xms512m -Xmx2g"

## @param solr.hostname (idxworker-specific param): hostname of the solr service to use
## Leave this value unset (hostname: "") to have it automatically populated
##
hostname: ""

containerSecurityContext:
runAsUser: 1000
persistence:
size: 10Gi
service:
ports:
## @param solr.service.ports.http: see global.solrPort (required)
Expand All @@ -183,8 +190,6 @@ solr:
## instead connecting to a solr instance outside the cluster
##
enabled: false
persistence:
size: 10Gi
extraVolumes:
- name: solr-config
configMap:
Expand All @@ -200,5 +205,3 @@ solr:
postStart:
exec:
command: ["/bin/bash", "-c", "/solrconfig/config-solr.sh"]
containerSecurityContext:
runAsUser: 1000