Skip to content

Commit

Permalink
Merge pull request #529 from rstudio/update-templates
Browse files Browse the repository at this point in the history
Update templates
  • Loading branch information
jforest authored Oct 4, 2024
2 parents 127de43 + 861ea63 commit 35db878
Show file tree
Hide file tree
Showing 16 changed files with 659 additions and 22 deletions.
2 changes: 1 addition & 1 deletion charts/rstudio-connect/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rstudio-connect
description: Official Helm chart for Posit Connect
version: 0.7.9
version: 0.7.10
apiVersion: v2
appVersion: 2024.09.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
9 changes: 9 additions & 0 deletions charts/rstudio-connect/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.7.10

- Bump version of launcher templates `job.tpl` and `service.tpl`
- `enableServiceLinks` now defaults to `false` for sessions (instead of not being set).
To enable them for sessions, set `launcher.templateValues.enableServiceLinks: true`.
- Also see related discussion [on the Kubernetes project](https://github.com/kubernetes/kubernetes/issues/121787)
- Removed a protection against `.resources.enabled = false` which was a [bad attempt at backwards compatibility two
years ago](https://github.com/rstudio/helm/pull/224) (v0.2.34)

## 0.7.9

- Bump Connect version to 2024.09.0
Expand Down
6 changes: 3 additions & 3 deletions charts/rstudio-connect/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Posit Connect

![Version: 0.7.9](https://img.shields.io/badge/Version-0.7.9-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square)
![Version: 0.7.10](https://img.shields.io/badge/Version-0.7.10-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square)

#### _Official Helm chart for Posit Connect_

Expand Down Expand Up @@ -30,11 +30,11 @@ To ensure reproducibility in your environment and insulate yourself from future

## Installing the chart

To install the chart with the release name `my-release` at version 0.7.9:
To install the chart with the release name `my-release` at version 0.7.10:

```{.bash}
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.9
helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.10
```

To explore other chart versions, look at:
Expand Down
2 changes: 0 additions & 2 deletions charts/rstudio-connect/ci/complex-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ replicas: 2

resources:
requests:
enabled: false
memory: "1Gi"
cpu: "100m"
ephemeralStorage: "100Mi"
limits:
enabled: false
memory: "2Gi"
cpu: "2000m"
ephemeralStorage: "200Mi"
Expand Down
16 changes: 13 additions & 3 deletions charts/rstudio-connect/files/job.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version: 2.3.1
# Version: 2.4.0
# DO NOT MODIFY the "Version: " key
# Helm Version: v3
# Helm Version: v1
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: batch/v1
kind: Job
Expand All @@ -18,6 +18,9 @@ metadata:
{{- end }}
labels:
app.kubernetes.io/managed-by: "launcher"
{{- with .Job.instanceId }}
launcher-instance-id: {{ toYaml . }}
{{- end }}
{{- with .Job.metadata.job.labels }}
{{- range $key, $val := . }}
{{ $key }}: {{ toYaml $val | indent 4 | trimPrefix (repeat 4 " ") }}
Expand All @@ -30,6 +33,9 @@ metadata:
{{- end }}
generateName: {{ toYaml .Job.generateName }}
spec:
{{- if $templateData.job.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ $templateData.job.ttlSecondsAfterFinished }}
{{- end }}
backoffLimit: 0
template:
metadata:
Expand Down Expand Up @@ -59,6 +65,9 @@ spec:
{{- end }}
{{- end }}
labels:
{{- with .Job.instanceId }}
launcher-instance-id: {{ toYaml . }}
{{- end }}
{{- with .Job.metadata.pod.labels }}
{{- range $key, $val := . }}
{{ $key }}: {{ toYaml $val | indent 8 | trimPrefix (repeat 8 " ") }}
Expand All @@ -74,6 +83,7 @@ spec:
{{- if .Job.host }}
nodeName: {{ toYaml .Job.host }}
{{- end }}
enableServiceLinks: {{ if hasKey $templateData.pod "enableServiceLinks" }}{{ $templateData.pod.enableServiceLinks }}{{ else }}false{{ end }}
restartPolicy: Never
{{- if or $templateData.pod.serviceAccountName .Job.serviceAccountName }}
serviceAccountName: {{ .Job.serviceAccountName | default $templateData.pod.serviceAccountName | quote }}
Expand All @@ -100,7 +110,7 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or (ne (len .Job.placementConstraints) 0) (ne (len $templateData.pod.nodeSelector) 0) }}
{{- if or (ne (len .Job.placementConstraints) 0) (and $templateData.pod.nodeSelector (ne (len $templateData.pod.nodeSelector) 0)) }}
nodeSelector:
{{- range .Job.placementConstraints }}
{{ .name }}: {{ toYaml .value }}
Expand Down
7 changes: 5 additions & 2 deletions charts/rstudio-connect/files/service.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version: 2.3.1
# Version: 2.4.0
# DO NOT MODIFY the "Version: " key
# Helm Version: v3
# Helm Version: v1
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: v1
kind: Service
Expand All @@ -20,6 +20,9 @@ metadata:
labels:
app.kubernetes.io/managed-by: "launcher"
job-name: {{ toYaml .Job.id }}
{{- with .Job.instanceId }}
launcher-instance-id: {{ toYaml . }}
{{- end }}
{{- with .Job.metadata.service.labels }}
{{- range $key, $val := . }}
{{ $key }}: {{ toYaml $val | indent 8 | trimPrefix (repeat 8 " ") }}
Expand Down
4 changes: 2 additions & 2 deletions charts/rstudio-connect/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ spec:
{{- end }}
{{ include "rstudio-library.license-mount" (dict "license" ( .Values.license )) | indent 10 }}
{{- if .Values.pod.volumeMounts }}
{{ toYaml .Values.pod.volumeMounts | indent 10 }}
{{- toYaml .Values.pod.volumeMounts | nindent 10 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{ toYaml (omit . "enabled") | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
{{- $liveness := omit .Values.livenessProbe "enabled" }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-workbench/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rstudio-workbench
description: Official Helm chart for Posit Workbench
version: 0.8.2
version: 0.8.3
apiVersion: v2
appVersion: 2024.09.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
7 changes: 7 additions & 0 deletions charts/rstudio-workbench/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.8.3

- Bump version of launcher templates `job.tpl` and `service.tpl`
- `enableServiceLinks` now defaults to `false` for sessions (instead of not being set).
To enable them for sessions, set `launcher.templateValues.enableServiceLinks: true`
- Also see related discussion [on the Kubernetes project](https://github.com/kubernetes/kubernetes/issues/121787)

## 0.8.2

- Bump Workbench version to 2024.09.0
Expand Down
6 changes: 3 additions & 3 deletions charts/rstudio-workbench/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Posit Workbench

![Version: 0.8.2](https://img.shields.io/badge/Version-0.8.2-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square)
![Version: 0.8.3](https://img.shields.io/badge/Version-0.8.3-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square)

#### _Official Helm chart for Posit Workbench_

Expand All @@ -24,11 +24,11 @@ To ensure a stable production deployment:

## Installing the chart

To install the chart with the release name `my-release` at version 0.8.2:
To install the chart with the release name `my-release` at version 0.8.3:

```{.bash}
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-workbench --version=0.8.2
helm upgrade --install my-release rstudio/rstudio-workbench --version=0.8.3
```

To explore other chart versions, look at:
Expand Down
13 changes: 10 additions & 3 deletions charts/rstudio-workbench/files/job.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version: 2.3.1
# Version: 2.4.0
# DO NOT MODIFY the "Version: " key
# Helm Version: v4
# Helm Version: v1
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: batch/v1
kind: Job
Expand All @@ -18,6 +18,9 @@ metadata:
{{- end }}
labels:
app.kubernetes.io/managed-by: "launcher"
{{- with .Job.instanceId }}
launcher-instance-id: {{ toYaml . }}
{{- end }}
{{- with .Job.metadata.job.labels }}
{{- range $key, $val := . }}
{{ $key }}: {{ toYaml $val | indent 4 | trimPrefix (repeat 4 " ") }}
Expand Down Expand Up @@ -62,6 +65,9 @@ spec:
{{- end }}
{{- end }}
labels:
{{- with .Job.instanceId }}
launcher-instance-id: {{ toYaml . }}
{{- end }}
{{- with .Job.metadata.pod.labels }}
{{- range $key, $val := . }}
{{ $key }}: {{ toYaml $val | indent 8 | trimPrefix (repeat 8 " ") }}
Expand All @@ -77,6 +83,7 @@ spec:
{{- if .Job.host }}
nodeName: {{ toYaml .Job.host }}
{{- end }}
enableServiceLinks: {{ if hasKey $templateData.pod "enableServiceLinks" }}{{ $templateData.pod.enableServiceLinks }}{{ else }}false{{ end }}
restartPolicy: Never
{{- if or $templateData.pod.serviceAccountName .Job.serviceAccountName }}
serviceAccountName: {{ .Job.serviceAccountName | default $templateData.pod.serviceAccountName | quote }}
Expand All @@ -99,7 +106,7 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or (ne (len .Job.placementConstraints) 0) (ne (len $templateData.pod.nodeSelector) 0) }}
{{- if or (ne (len .Job.placementConstraints) 0) (and $templateData.pod.nodeSelector (ne (len $templateData.pod.nodeSelector) 0)) }}
nodeSelector:
{{- range .Job.placementConstraints }}
{{ .name }}: {{ toYaml .value }}
Expand Down
7 changes: 5 additions & 2 deletions charts/rstudio-workbench/files/service.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version: 2.3.1
# Version: 2.4.0
# DO NOT MODIFY the "Version: " key
# Helm Version: v4
# Helm Version: v1
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: v1
kind: Service
Expand All @@ -20,6 +20,9 @@ metadata:
labels:
app.kubernetes.io/managed-by: "launcher"
job-name: {{ toYaml .Job.id }}
{{- with .Job.instanceId }}
launcher-instance-id: {{ toYaml . }}
{{- end }}
{{- with .Job.metadata.service.labels }}
{{- range $key, $val := . }}
{{ $key }}: {{ toYaml $val | indent 8 | trimPrefix (repeat 8 " ") }}
Expand Down
Loading

0 comments on commit 35db878

Please sign in to comment.