Skip to content

Commit

Permalink
Onyxia v4 : ui renamed to web and version bumps (#52)
Browse files Browse the repository at this point in the history
* Warning : breaking changes, read README.md !
* Refactor ui to web
* Repository and tag for standard renovate matching
* Bump versions

---------

Co-authored-by: odysseu <[email protected]>
  • Loading branch information
olevitt and odysseu authored Sep 7, 2023
1 parent 3d83681 commit 4f9ed6c
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 120 deletions.
4 changes: 2 additions & 2 deletions charts/onyxia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ 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.
version: 3.8.4
version: 4.0.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.
appVersion: 2.13.19
appVersion: 2.28.0
10 changes: 10 additions & 0 deletions charts/onyxia/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Helm chart for [Onyxia](https://www.onyxia.sh/)

## Breaking changes

### v3 to v4

* `ui` block has been renamed to `web` in the values. Change your `values.yaml` file accordingly.
* Any resource created by helm that was suffixed by `ui` is now suffixed by `web`. This should be seamless for you unless you specifically rely on resource name for other purposes.
* `image.name` has been renamed to `image.repository` and `image.version` has been renamed to `image.tag` to be more standard. If you are overriding versions in either web or API you should use those new values keys.

26 changes: 13 additions & 13 deletions charts/onyxia/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Expand the name of the chart.
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "onyxia.ui.name" -}}
{{- printf "%s-%s" (include "onyxia.name" .) .Values.ui.name | trunc 63 | trimSuffix "-" -}}
{{- define "onyxia.web.name" -}}
{{- printf "%s-%s" (include "onyxia.name" .) .Values.web.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}


Expand All @@ -34,8 +34,8 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{- define "onyxia.ui.fullname" -}}
{{- printf "%s-%s" (include "onyxia.fullname" .) .Values.ui.name | trunc 63 | trimSuffix "-" -}}
{{- define "onyxia.web.fullname" -}}
{{- printf "%s-%s" (include "onyxia.fullname" .) .Values.web.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}


Expand All @@ -54,8 +54,8 @@ Create chart name and version as used by the chart label.
{{- printf "onyxia-api" -}}
{{- end -}}

{{- define "onyxia.ui.chart" -}}
{{- printf "onyxia-ui" -}}
{{- define "onyxia.web.chart" -}}
{{- printf "onyxia-web" -}}
{{- end -}}


Expand All @@ -79,9 +79,9 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{- define "onyxia.ui.labels" -}}
helm.sh/chart: {{ include "onyxia.ui.chart" . }}
{{ include "onyxia.ui.selectorLabels" . }}
{{- define "onyxia.web.labels" -}}
helm.sh/chart: {{ include "onyxia.web.chart" . }}
{{ include "onyxia.web.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -100,8 +100,8 @@ app.kubernetes.io/name: {{ include "onyxia.api.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{- define "onyxia.ui.selectorLabels" -}}
app.kubernetes.io/name: {{ include "onyxia.ui.name" . }}
{{- define "onyxia.web.selectorLabels" -}}
app.kubernetes.io/name: {{ include "onyxia.web.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

Expand All @@ -115,9 +115,9 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- end -}}

{{- define "onyxia.ui.serviceAccountName" -}}
{{- define "onyxia.web.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "onyxia.ui.fullname" .) .Values.serviceAccount.name }}
{{ default (include "onyxia.web.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/onyxia/templates/deployment-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.api.securityContext | nindent 12 }}
image: "{{ .Values.api.image.name }}:{{ .Values.api.image.version }}"
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag }}"
envFrom:
- configMapRef:
name: {{ template "onyxia.fullname" . }}
Expand Down
71 changes: 0 additions & 71 deletions charts/onyxia/templates/deployment-ui.yaml

This file was deleted.

71 changes: 71 additions & 0 deletions charts/onyxia/templates/deployment-web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "onyxia.web.fullname" . }}
labels:
{{- include "onyxia.web.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.web.replicaCount }}
selector:
matchLabels:
{{- include "onyxia.web.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "onyxia.web.selectorLabels" . | nindent 8 }}
{{- with .Values.web.podLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "onyxia.web.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.web.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.web.securityContext | nindent 12 }}
image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag }}"
imagePullPolicy: {{ .Values.web.image.pullPolicy }}
env:
{{- if .Values.web.env }}
{{- range $key, $value := .Values.web.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end -}}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.web.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.web.resources | nindent 12 }}
{{- if .Values.web.extraVolumeMounts }}
volumeMounts: {{- toYaml .Values.web.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- with .Values.web.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.web.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.web.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.web.extraVolumes }}
volumes: {{- toYaml .Values.web.extraVolumes | nindent 6 }}
{{- end }}
8 changes: 4 additions & 4 deletions charts/onyxia/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if .Values.ingress.enabled -}}
{{- $fullNameApi := include "onyxia.api.fullname" . -}}
{{- $fullNameUi := include "onyxia.ui.fullname" . -}}
{{- $fullNameWeb := include "onyxia.web.fullname" . -}}
{{- $fullName := include "onyxia.fullname" . -}}
{{- $svcPortApi := .Values.api.service.port -}}
{{- $svcPortUi := .Values.ui.service.port -}}
{{- $svcPortWeb := .Values.web.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down Expand Up @@ -45,8 +45,8 @@ spec:
pathType: Prefix
backend:
service:
name: {{ $fullNameUi }}
name: {{ $fullNameWeb }}
port:
number: {{ $svcPortUi }}
number: {{ $svcPortWeb }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if .Values.route.enabled -}}
{{- $fullNameUi := include "onyxia.ui.fullname" . -}}
{{- $fullNameWeb := include "onyxia.web.fullname" . -}}
{{- $fullName := include "onyxia.fullname" . -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ $fullName }}-ui
name: {{ $fullName }}-web
labels:
{{- include "onyxia.labels" . | nindent 4 }}
annotations:
Expand All @@ -16,7 +16,7 @@ spec:
path: /
to:
kind: Service
name: {{ $fullNameUi }}
name: {{ $fullNameWeb }}
tls:
termination: {{ .Values.route.tls.termination }}
{{- if .Values.route.tls.key }}
Expand Down
15 changes: 0 additions & 15 deletions charts/onyxia/templates/service-ui.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions charts/onyxia/templates/service-web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "onyxia.web.fullname" . }}
labels:
{{- include "onyxia.web.labels" . | nindent 4 }}
spec:
type: {{ .Values.web.service.type }}
ports:
- port: {{ .Values.web.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "onyxia.web.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "onyxia.ui.serviceAccountName" . }}
name: {{ include "onyxia.web.serviceAccountName" . }}
labels:
{{- include "onyxia.ui.labels" . | nindent 4 }}
{{- include "onyxia.web.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/onyxia/templates/tests/test-connection-ihm.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "onyxia.ui.fullname" . }}-test-connection"
name: "{{ include "onyxia.web.fullname" . }}-test-connection"
labels:
{{- include "onyxia.ui.labels" . | nindent 4 }}
{{- include "onyxia.web.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "onyxia.ui.fullname" . }}:{{ .Values.ui.service.port }}']
args: ['{{ include "onyxia.web.fullname" . }}:{{ .Values.web.service.port }}']
restartPolicy: Never
12 changes: 6 additions & 6 deletions charts/onyxia/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ route:
# destinationCACertificate:
wildcardPolicy: None

ui:
name: ui
web:
name: web
replicaCount: 1
image:
name: inseefrlab/onyxia-web
version: 2.13.53
repository: inseefrlab/onyxia-web
tag: 2.28.0
pullPolicy: IfNotPresent
podLabels: {}
podSecurityContext:
Expand Down Expand Up @@ -90,8 +90,8 @@ api:
name: api
replicaCount: 1
image:
name: inseefrlab/onyxia-api
version: v0.27
repository: inseefrlab/onyxia-api
tag: v0.29
pullPolicy: IfNotPresent
contextPath: /api
podLabels: {}
Expand Down

0 comments on commit 4f9ed6c

Please sign in to comment.