Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
update helm chart to use rolling release by default
Browse files Browse the repository at this point in the history
also remove appVersion from chart infos because it doesn't bring much
value and might cause confusion and cognitive overhead
  • Loading branch information
stefanotorresi committed Sep 30, 2021
1 parent 3a84c0d commit 6a8da97
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 52 deletions.
35 changes: 15 additions & 20 deletions install-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

readonly ARGS=( "$@" )
readonly PROGNAME="./install-server.sh"
readonly TRENTO_VERSION="0.4.0"
TRENTO_VERSION="0.4.0"

usage() {
cat <<- EOF
Expand All @@ -31,16 +31,16 @@ cmdline() {
case "$arg" in
--private-key) args="${args}-p ";;
--rolling) args="${args}-r ";;
--help) args="${args}-h ";;
--help) args="${args}-h ";;

# pass through anything else
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} ";;
esac
done

eval set -- "$args"

while getopts "p:rh" OPTION
do
case $OPTION in
Expand All @@ -65,6 +65,10 @@ cmdline() {
read -rp "Please provide the path of the runner private key: " PRIVATE_KEY </dev/tty
fi

if [[ "$ROLLING" == "true" ]]; then
TRENTO_VERSION="rolling"
fi

return 0
}

Expand Down Expand Up @@ -105,31 +109,22 @@ update_helm_dependencies() {
install_trento_server_chart() {
local repo_owner=${TRENTO_REPO_OWNER:-"trento-project"}
local private_key=${PRIVATE_KEY:-"./id_rsa_runner"}
local image_tag=${IMAGE_TAG:-""}
local rolling=${ROLLING:-false}
local trento_packages_url="https://github.com/${repo_owner}/trento/archive/refs/tags"
local trento_source_zip="${TRENTO_VERSION}"

if [[ "$rolling" == "true" ]]; then
image_tag="rolling"
trento_source_zip="rolling"
fi
local trento_packages_url="https://github.com/${repo_owner}/trento/archive/refs/tags"

echo "Installing trento-server chart..."
pushd -- /tmp >/dev/null
curl -f -sS -O -L "${trento_packages_url}/${trento_source_zip}.zip" >/dev/null
unzip -o "${trento_source_zip}.zip" >/dev/null
rm ${trento_source_zip}.zip
popd >/dev/null
pushd -- /tmp/trento-"${trento_source_zip}"/packaging/helm/trento-server >/dev/null

pushd -- /tmp/trento-"${trento_source_zip}"/packaging/helm/trento-server >/dev/null
helm dep update >/dev/null
helm upgrade --install trento-server . \
--set-file trento-runner.privateKey="${private_key}" \
--set trento-web.image.tag="${image_tag}" \
--set trento-runner.image.tag="${image_tag}" \
--set trento-web.image.pullPolicy="Always" \
--set trento-runner.image.pullPolicy="Always"
--set trento-web.image.tag="${TRENTO_VERSION}" \
--set trento-runner.image.tag="${TRENTO_VERSION}"
rm -rf /tmp/trento-"${trento_source_zip}"
popd >/dev/null
}
Expand All @@ -142,4 +137,4 @@ main() {
update_helm_dependencies
install_trento_server_chart
}
main
main
2 changes: 1 addition & 1 deletion packaging/helm/trento-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ dependencies:
- name: consul
version: "~0.32.1"
repository: https://helm.releases.hashicorp.com
condition: consul.enabled
condition: consul.enabled
10 changes: 2 additions & 8 deletions packaging/helm/trento-server/charts/trento-runner/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: trento-runner
description: Trento runner chart
description: Trento Runner Chart

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -15,10 +15,4 @@ 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: "0.4.0"
version: 0.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
value:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand Down
13 changes: 4 additions & 9 deletions packaging/helm/trento-server/charts/trento-runner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ replicaCount: 1
privateKey: ""

image:
repository: ghcr.io/trento-project/trento
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
repository: ghcr.io/trento-project/trento-runner
pullPolicy: Always
tag: "rolling"

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -38,10 +37,6 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 80

ingress:
enabled: false
className: ""
Expand Down Expand Up @@ -81,4 +76,4 @@ nodeSelector: {}

tolerations: []

affinity: {}
affinity: {}
8 changes: 1 addition & 7 deletions packaging/helm/trento-server/charts/trento-web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ 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: "0.4.0"
version: 0.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
value: {{ .Release.Name }}-consul-server:8500
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
Expand Down
9 changes: 4 additions & 5 deletions packaging/helm/trento-server/charts/trento-web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: ghcr.io/trento-project/trento
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
repository: ghcr.io/trento-project/trento-web
pullPolicy: Always
tag: "rolling"

imagePullSecrets: []
nameOverride: ""
Expand Down

0 comments on commit 6a8da97

Please sign in to comment.