Skip to content

Commit

Permalink
Rename TRENTO_DOMAIN to TRENTO_WEB_ORIGIN (#97)
Browse files Browse the repository at this point in the history
* Rename TRENTO_DOMAIN to TRENTO_WEB_ORIGIN

* Make TRENTO_WEB_ORIGIN mandatory in installation script
  • Loading branch information
nelsonkopliku authored Jun 10, 2024
1 parent 1b6e4a5 commit e66b626
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion charts/trento-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: The trento server chart contains all the components necessary to ru
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates
version: 2.3.1-dev
version: 2.3.1-dev1

dependencies:
- name: trento-web
Expand Down
2 changes: 1 addition & 1 deletion charts/trento-server/charts/trento-web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +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: 2.3.1-dev
version: 2.3.1-dev1
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ data:
PROMETHEUS_URL: "http://{{ .Release.Name }}-{{ .Values.global.prometheus.name }}"
AMQP_URL: "amqp://trento:trento@{{ .Release.Name }}-{{ .Values.global.rabbitmq.name }}:{{ .Values.global.rabbitmq.servicePort }}"
CHARTS_ENABLED: "{{ .Values.chartsEnabled }}"
TRENTO_DOMAIN: "{{ .Values.trentoDomain }}"
TRENTO_WEB_ORIGIN: "{{ .Values.trentoWebOrigin }}"
2 changes: 1 addition & 1 deletion docs/trento-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ helm install trento .
or perform a rolling update:

```
helm upgrade trento . --set trento-web.trentoDomain="trento.example.com"
helm upgrade trento . --set trento-web.trentoWebOrigin="trento.example.com"
```

_Note: be sure to replace trento.example.com with a valid hostname that points to the Trento server._
Expand Down
2 changes: 1 addition & 1 deletion hack/cert-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ helm install cert-manager jetstack/cert-manager --namespace cert-manager --creat
### 4. Generate a valid configuration for cert-manager
Use `envsubst` to substitute the templates with actual valid data (make sure to replace the suggestions here with valid ones for your deployment):
```
export TRENTO_DOMAIN=example.com [email protected] TRENTO_NAMESPACE=default TRENTO_INGRESS_CLASS=traefik
export TRENTO_WEB_ORIGIN=example.com [email protected] TRENTO_NAMESPACE=default TRENTO_INGRESS_CLASS=traefik
envsubst < certificate.tpl.yaml > certificate.yaml
envsubst < cluster-issuer.tpl.yaml > cluster-issuer.yaml
envsubst < override-values.tpl.yaml > override-values.yaml
Expand Down
4 changes: 2 additions & 2 deletions hack/cert-manager/certificate.tpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
name: letsencrypt-production
kind: ClusterIssuer

commonName: ${TRENTO_DOMAIN}
commonName: ${TRENTO_WEB_ORIGIN}
dnsNames:
- ${TRENTO_DOMAIN}
- ${TRENTO_WEB_ORIGIN}
4 changes: 2 additions & 2 deletions hack/cert-manager/override-values.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
trento-web:
ingress:
hosts:
- host: ${TRENTO_DOMAIN}
- host: ${TRENTO_WEB_ORIGIN}
paths:
- path: /
pathType: ImplementationSpecific
Expand All @@ -13,7 +13,7 @@ trento-web:
trento-wanda:
ingress:
hosts:
- host: ${TRENTO_DOMAIN}
- host: ${TRENTO_WEB_ORIGIN}
paths:
- path: /api/checks
pathType: ImplementationSpecific
Expand Down
23 changes: 15 additions & 8 deletions scripts/install-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ usage() {
-r, --rolling Use the rolling version instead of the stable one.
-e, --existing-k8s Deploy to an existing kubernetes cluster (don't deploy k3s)
-u, --use-registry Container registry to pull the images from
-d, --trento-domain FQDN for trento-server
-d, --trento-web-origin Origin of trento-server
-h, --help Print this help.
Example:
Expand All @@ -52,7 +52,7 @@ cmdline() {
--rolling) args="${args}-r " ;;
--use-registry) args="${args}-u " ;;
--existing-k8s) args="${args}-e " ;;
--trento-domain) args="${args}-d " ;;
--trento-web-origin) args="${args}-d " ;;
--help) args="${args}-h " ;;

# pass through anything else
Expand Down Expand Up @@ -118,7 +118,7 @@ cmdline() {
;;

d)
TRENTO_DOMAIN=$OPTARG
TRENTO_WEB_ORIGIN=$OPTARG
;;

*)
Expand All @@ -128,7 +128,7 @@ cmdline() {
esac
done

check_trento_domain
check_trento_web_origin
set_admin_password
confirm_admin_password
configure_alerting
Expand Down Expand Up @@ -164,10 +164,17 @@ function set_admin_password() {
fi
}

function check_trento_domain() {
if [[ -z "$TRENTO_DOMAIN" ]]; then
read -rp "A valid domain is required for websockets functionality, please provide one: " TRENTO_DOMAIN </dev/tty
function check_trento_web_origin() {
if [[ -z "$TRENTO_WEB_ORIGIN" ]]; then
read -rp "A valid origin is required for websockets functionality, please provide one: " TRENTO_WEB_ORIGIN </dev/tty
fi

if [[ -z "$TRENTO_WEB_ORIGIN" ]]; then
echo "An origin for trento web is mandatory, please try again."
unset TRENTO_WEB_ORIGIN
check_trento_web_origin
fi

}

function confirm_admin_password() {
Expand Down Expand Up @@ -304,7 +311,7 @@ install_trento_server_chart() {
--set trento-wanda.image.tag="${TRENTO_WANDA_VERSION}"
--set trento-wanda.image.repository="${wanda_image}"
--set trento-web.adminUser.password="${ADMIN_PASSWORD}"
--set trento-web.trentoDomain="${TRENTO_DOMAIN}"
--set trento-web.trentoWebOrigin="${TRENTO_WEB_ORIGIN}"
)
if [[ "$ENABLE_ALERTING" == "true" ]]; then
args+=(
Expand Down

0 comments on commit e66b626

Please sign in to comment.