Skip to content

Commit

Permalink
chore: add single global Gitlab URL (#3222)
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Apr 3, 2024
1 parent 832ddf0 commit 911e658
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 41 deletions.
3 changes: 1 addition & 2 deletions docs/how-to-guides/admin/gitlab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ Upgrading Renku with the newly modified Helm values
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

#. Backup your current unedited values file
#. Replace every GitLab URL from \https://$RENKU_URL/gitlab to \https://gitlab.$RENKU_URL. There should be 4 instances, at ``gateway.gitlabUrl``, ``notebooks.gitlab.url`` and ``ui.gitlabUrl``.
#. If you have a value set at ``global.gitlab.urlPrefix`` change it from ``/gitlab`` to ``/``
#. Replace every GitLab URL from \https://$RENKU_URL/gitlab to \https://gitlab.$RENKU_URL. This is set in `global.gitlab.url`.
#. Set ``gitlab.enabled`` to ``false``.
#. Re-install the Renku Helm chart with the newly modified values.
4 changes: 0 additions & 4 deletions helm-chart/renku/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ KC_DB_PASSWORD: {{ default (randAlphaNum 64) .Values.global.keycloak.postgresPas
{{- end -}}
{{- end -}}

{{- define "renku.gitlabUrl" -}}
{{ .Values.global.gitlab.url | default (printf "%s://%s/gitlab" (include "renku.http" .) .Values.global.renku.domain) }}
{{- end -}}

{{- define "renku.baseUrl" -}}
{{ printf "%s://%s" (include "renku.http" .) .Values.global.renku.domain }}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/renku/templates/gateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
name: {{ cat (include "renku.fullname" .) "-gateway-revproxy" | nospace }}
key: cliClientSecret
- name: GITLAB_URL
value: {{ include "renku.gitlabUrl" . | quote }}
value: {{ .Values.global.gitlab.url | quote }}
- name: GITLAB_CLIENT_SECRET
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
- name: TOKEN_REPOSITORY_BASE_URL
value: "http://{{ template "renku.graph.tokenRepository.fullname" . }}:{{ .Values.graph.tokenRepository.service.port }}"
- name: GITLAB_BASE_URL
value: {{ .Values.global.gitlab.url }}
value: {{ .Values.global.gitlab.url | quote }}
- name: GITLAB_RATE_LIMIT
value: {{ .Values.graph.commitEventService.gitlab.rateLimit }}
- name: SENTRY_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/renku/templates/graph/event-log-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- name: EVENT_LOG_BASE_URL
value: "http://{{ template "renku.graph.eventLog.fullname" . }}:{{ .Values.graph.eventLog.service.port }}"
- name: GITLAB_BASE_URL
value: {{ .Values.global.gitlab.url }}
value: {{ .Values.global.gitlab.url | quote }}
- name: GITLAB_RATE_LIMIT
value: {{ .Values.graph.eventLog.gitlab.rateLimit }}
- name: SENTRY_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
- name: RENKU_CORE_SERVICE_URLS
value: {{ include "renku.graph.core.urls" . | quote }}
- name: GITLAB_BASE_URL
value: {{ .Values.global.gitlab.url }}
value: {{ .Values.global.gitlab.url | quote }}
- name: GITLAB_RATE_LIMIT
value: {{ .Values.graph.knowledgeGraph.gitlab.rateLimit }}
- name: SENTRY_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
- name: EVENT_LOG_BASE_URL
value: "http://{{ template "renku.graph.eventLog.fullname" . }}:{{ .Values.graph.eventLog.service.port }}"
- name: GITLAB_BASE_URL
value: {{ .Values.global.gitlab.url }}
value: {{ .Values.global.gitlab.url | quote }}
- name: GITLAB_RATE_LIMIT
value: {{ .Values.graph.tokenRepository.gitlab.rateLimit }}
- name: SENTRY_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- name: TOKEN_REPOSITORY_BASE_URL
value: "http://{{ template "renku.graph.tokenRepository.fullname" . }}:{{ .Values.graph.tokenRepository.service.port }}"
- name: GITLAB_BASE_URL
value: {{ .Values.global.gitlab.url }}
value: {{ .Values.global.gitlab.url | quote }}
- name: GITLAB_RATE_LIMIT
value: {{ .Values.graph.triplesGenerator.gitlab.rateLimit }}
- name: JENA_BASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
- name: TOKEN_REPOSITORY_BASE_URL
value: "http://{{ template "renku.graph.tokenRepository.fullname" . }}:{{ .Values.graph.tokenRepository.service.port }}"
- name: GITLAB_BASE_URL
value: {{ .Values.global.gitlab.url }}
value: {{ .Values.global.gitlab.url | quote }}
- name: GITLAB_RATE_LIMIT
value: {{ .Values.graph.webhookService.gitlab.rateLimit }}
- name: SELF_IP
Expand Down
8 changes: 2 additions & 6 deletions helm-chart/renku/templates/notebooks/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,9 @@ spec:
value: |
{{- .Values.notebooks.sessionIngress.annotations | toYaml | nindent 16 }}
- name: NB_GIT__URL
{{ if .Values.notebooks.gitlab.url }}
value: {{ .Values.notebooks.gitlab.url }}
{{ else }}
value: {{ template "notebooks.http" . }}://{{ .Values.global.renku.domain}}{{ .Values.global.gitlab.urlPrefix }}
{{ end }}
value: {{ .Values.global.gitlab.url | quote }}
- name: NB_GIT__REGISTRY
value: {{ required "An image registry must be specified." .Values.notebooks.gitlab.registry.host }}
value: {{ required "An image registry must be specified." .Values.global.gitlab.registry.host }}
- name: NB_SESSIONS__GIT_RPC_SERVER__IMAGE
value: "{{ .Values.notebooks.gitRpcServer.image.name }}:{{ .Values.notebooks.gitRpcServer.image.tag }}"
- name: NB_SESSIONS__GIT_PROXY__IMAGE
Expand Down
4 changes: 2 additions & 2 deletions helm-chart/renku/templates/notebooks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ spec:
- name: NB_SESSIONS__OIDC__ALLOW_UNVERIFIED_EMAIL
value: {{ $.Values.notebooks.oidc.allowUnverifiedEmail | quote }}
- name: NB_GIT__URL
value: {{ $.Values.notebooks.gitlab.url | quote }}
value: {{ .Values.global.gitlab.url | quote }}
- name: NB_GIT__REGISTRY
value: {{ $.Values.notebooks.gitlab.registry.host | quote }}
value: {{ $.Values.global.gitlab.registry.host | quote }}
- name: GITLAB_TOKEN
value: {{ $.Values.notebooks.tests.gitlab_token | quote }}
- name: NOTEBOOKS_BASE_URL
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/renku/templates/setup-job-gitlab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
name: {{ template "renku.fullname" . }}-gitlab-postgres
key: gitlab-postgres-password
- name: GITLAB_URL
value: "http://{{ template "gitlab.fullname" . }}{{ .Values.global.gitlab.urlPrefix }}"
value: {{ .Values.global.gitlab.url | quote }}
- name: RENKU_URL
value: "{{ template "renku.http" . }}://{{ .Values.global.renku.domain }}"
{{- end }}
2 changes: 1 addition & 1 deletion helm-chart/renku/templates/tests/test-renku.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
- name: RENKU_TEST_URL
value: '{{ template "renku.http" . }}://{{ .Values.global.renku.domain }}'
- name: GITLAB_TEST_URL
value: {{ .Values.gateway.gitlabUrl | default (printf "%s://%s/gitlab" (include "renku.http" .) .Values.global.renku.domain) | quote }}
value: {{ .Values.global.gitlab.url | quote }}
- name: RENKU_TEST_EMAIL
value: '{{ .Values.tests.parameters.email }}'
- name: RENKU_TEST_USERNAME
Expand Down
16 changes: 6 additions & 10 deletions helm-chart/renku/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ global:
## setting this value or by randomly generating it because it was omitted below.
postgresPassword:
value:
## URL prefix for gitlab
# urlPrefix: /
## Full URL for gitlab
## NOTE: Many services have this setting internally, they should switch to using the global setting instead
## URL for gitlab deployment
# url:
## Set the default image registry
# registry:
# host:

## Secret for the gitlab keycloak client
clientSecret: # use `openssl rand -hex 32`
keycloak:
Expand Down Expand Up @@ -929,12 +930,7 @@ notebooks:
## immediate eviction of the user session. EmptyDirs are used when the enabled flag
## above is set to false.
useEmptyDirSizeLimit: false
gitlab:
## specify the GitLab instance URL
url:
registry:
## Set the default image registry
host:

## For sending exceptions to Sentry, specify the DSN to use
sentry:
enabled: false
Expand Down
7 changes: 7 additions & 0 deletions helm-chart/values.yaml.changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ For changes that require manual steps other than changing values, please check o
Please follow this convention when adding a new row
* `<type: NEW|EDIT|DELETE> - *<resource name>*: <details>`

## Upgrading to Renku 0.50.0

The gitlab configuration has been unified in the `global` section of the values, which requires modifications for existing deployments.

* EDIT - *notebooks.gitlab.registry.host* -> *global.gitlab.registry.host*
* DELETE - *notebooks.gitlab` has been removed.

## Upgrading to Renku 0.49.0

The PostgreSQL chart dependency has been upgraded, which requires modification of the postgres data volume of existing deployments. See [these instructions](https://github.com/SwissDataScienceCenter/renku/tree/master/helm-chart/utils/postgres_migrations/version_upgrades/README.md) for more details.
Expand Down
11 changes: 3 additions & 8 deletions scripts/generate-values/base-renku-values.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ global:
clientSecret: <use `openssl rand -hex 32`>
gitlabClientSecret: <use `openssl rand -hex 32`>
gitlab:
urlPrefix: /
clientSecret: <use `openssl rand -hex 32`>
registry:
host: {gitlab_registry}
url: {gitlab_url}
renku:
domain: {renku_domain}
uiserver:
clientSecret: <use `openssl rand -hex 32`>
useHTTPS: true
gateway:
gitlabUrl: {gitlab_url}
secretKey: <use `openssl rand -hex 32`>
gitlab:
enabled: false
Expand All @@ -40,8 +41,6 @@ gitlab:
- {gitlab_registry}
secretName: registry-tls
graph:
gitlab:
url: {gitlab_url}
tokenRepository:
tokenEncryption:
secret: <use `openssl rand -hex 8 | base64`>
Expand All @@ -68,10 +67,6 @@ jena:
renku:
password: <use `openssl rand -hex 8 | base64`>
notebooks:
gitlab:
registry:
host: {gitlab_registry}
url: {gitlab_url}
oidc:
allowUnverifiedEmail: true
authUrl: https://{renku_domain}/auth/realms/Renku/protocol/openid-connect/auth
Expand Down

0 comments on commit 911e658

Please sign in to comment.