Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix template env vars #397

Merged
merged 4 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 RStudio Connect
version: 0.5.1
version: 0.5.2
apiVersion: v2
appVersion: 2023.06.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
5 changes: 5 additions & 0 deletions charts/rstudio-connect/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.5.2

- Add support for `pod.command` and `pod.env` for Connect off-host execution sessions
- `pod.command` is a hack for now... it will be removed eventually

# 0.5.1

- Bump Connect version to 2023.06.0
Expand Down
9 changes: 5 additions & 4 deletions charts/rstudio-connect/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RStudio Connect

![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) ![AppVersion: 2023.06.0](https://img.shields.io/badge/AppVersion-2023.06.0-informational?style=flat-square)
![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![AppVersion: 2023.06.0](https://img.shields.io/badge/AppVersion-2023.06.0-informational?style=flat-square)

#### _Official Helm chart for RStudio Connect_

Expand All @@ -26,11 +26,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.5.1:
To install the chart with the release name `my-release` at version 0.5.2:

```bash
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-connect --version=0.5.1
helm upgrade --install my-release rstudio/rstudio-connect --version=0.5.2
```

To explore other chart versions, take a look at:
Expand Down Expand Up @@ -118,7 +118,8 @@ The Helm `config` values are converted into the `rstudio-connect.gcfg` service c
| launcher.includeTemplateValues | bool | `true` | whether to include the templateValues rendering process |
| launcher.launcherKubernetesProfilesConf | object | `{}` | User definition of launcher.kubernetes.profiles.conf for job customization |
| launcher.namespace | string | `""` | The namespace to launch sessions into. Uses the Release namespace by default |
| launcher.templateValues | object | `{"job":{"annotations":{},"labels":{}},"pod":{"affinity":{},"annotations":{},"containerSecurityContext":{},"defaultSecurityContext":{},"env":[],"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[],"labels":{},"nodeSelector":{},"priorityClassName":"","securityContext":{},"serviceAccountName":"","tolerations":[],"volumeMounts":[],"volumes":[]},"service":{"annotations":{},"labels":{},"type":"ClusterIP"}}` | Values to pass along to the RStudio Connect session templating process |
| launcher.templateValues | object | `{"job":{"annotations":{},"labels":{}},"pod":{"affinity":{},"annotations":{},"command":[],"containerSecurityContext":{},"defaultSecurityContext":{},"env":[],"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[],"labels":{},"nodeSelector":{},"priorityClassName":"","securityContext":{},"serviceAccountName":"","tolerations":[],"volumeMounts":[],"volumes":[]},"service":{"annotations":{},"labels":{},"type":"ClusterIP"}}` | Values to pass along to the RStudio Connect session templating process |
| launcher.templateValues.pod.command | list | `[]` | command for all pods. This is really not something we should expose and will be removed once we have a better option |
| launcher.useTemplates | bool | `true` | Whether to use launcher templates when launching sessions. Defaults to true |
| license.file | object | `{"contents":false,"mountPath":"/etc/rstudio-licensing","mountSubPath":false,"secret":false,"secretKey":"license.lic"}` | the file section is used for licensing with a license file |
| license.file.contents | bool | `false` | contents is an in-line license file |
Expand Down
9 changes: 6 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
# DO NOT MODIFY the "Version: " key
# Helm Version: v1
# Helm Version: v3
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -151,7 +151,10 @@ spec:
imagePullPolicy: {{- . | nindent 12 }}
{{- end }}
{{- $isShell := false }}
{{- if .Job.command }}
{{- if $templateData.pod.command }}
command: {{- toYaml $templateData.pod.command | nindent 12 }}
{{- if .Job.command }}{{- $isShell = true }}{{- end }}
{{- else if .Job.command }}
command: ['/bin/sh']
{{- $isShell = true }}
{{- else }}
Expand Down Expand Up @@ -206,7 +209,7 @@ spec:
name: {{ get . "secret" }}
key: {{ get . "key" }}
{{- end }}
{{- if .Values.pod.env }}
{{- if $templateData.pod.env }}
{{- toYaml $templateData.pod.env | nindent 12 }}
{{- end }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-connect/files/service.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version: 2.3.1
# DO NOT MODIFY the "Version: " key
# Helm Version: v1
# Helm Version: v3
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: v1
kind: Service
Expand Down
2 changes: 2 additions & 0 deletions charts/rstudio-connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ launcher:
affinity: {}
nodeSelector: {}
priorityClassName: ""
# -- command for all pods. This is really not something we should expose and will be removed once we have a better option
command: []
job:
annotations: {}
labels: {}
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 RStudio Workbench
version: 0.6.2
version: 0.6.3
apiVersion: v2
appVersion: 2023.06.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-workbench/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.6.3

- Fix support for `pod.env` on sessions

# 0.6.2

- Add support for [Sealed Secrets](https://github.com/bitnami-labs/sealed-secrets)
Expand Down
8 changes: 4 additions & 4 deletions charts/rstudio-workbench/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RStudio Workbench

![Version: 0.6.2](https://img.shields.io/badge/Version-0.6.2-informational?style=flat-square) ![AppVersion: 2023.06.0](https://img.shields.io/badge/AppVersion-2023.06.0-informational?style=flat-square)
![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-informational?style=flat-square) ![AppVersion: 2023.06.0](https://img.shields.io/badge/AppVersion-2023.06.0-informational?style=flat-square)

#### _Official Helm chart for RStudio Workbench_

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

## Installing the Chart

To install the chart with the release name `my-release` at version 0.6.2:
To install the chart with the release name `my-release` at version 0.6.3:

```bash
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-workbench --version=0.6.2
helm upgrade --install my-release rstudio/rstudio-workbench --version=0.6.3
```

To explore other chart versions, take a look at:
Expand Down Expand Up @@ -414,7 +414,7 @@ Use of [Sealed Secrets](https://github.com/bitnami-labs/sealed-secrets) disables
| launcher.includeTemplateValues | bool | `true` | whether to include the templateValues rendering process |
| launcher.kubernetesHealthCheck | object | `{"enabled":true,"extraCurlArgs":["-fsSL"]}` | configuration for the "Kubernetes Health Check" that the launcher entrypoint runs at startup |
| launcher.namespace | string | `""` | allow customizing the namespace that sessions are launched into. Note RBAC and some config issues today |
| launcher.templateValues | object | `{"job":{"annotations":{},"labels":{}},"pod":{"affinity":{},"annotations":{},"command":[],"containerSecurityContext":{},"defaultSecurityContext":{},"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[],"labels":{},"nodeSelector":{},"securityContext":{},"serviceAccountName":"","tolerations":[],"volumeMounts":[],"volumes":[]},"service":{"annotations":{},"labels":{},"type":"ClusterIP"}}` | values that are passed along to the launcher job rendering process as a data object (in JSON). These values are then used within session templates. |
| launcher.templateValues | object | `{"job":{"annotations":{},"labels":{}},"pod":{"affinity":{},"annotations":{},"command":[],"containerSecurityContext":{},"defaultSecurityContext":{},"env":[],"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[],"labels":{},"nodeSelector":{},"securityContext":{},"serviceAccountName":"","tolerations":[],"volumeMounts":[],"volumes":[]},"service":{"annotations":{},"labels":{},"type":"ClusterIP"}}` | values that are passed along to the launcher job rendering process as a data object (in JSON). These values are then used within session templates. |
| launcher.templateValues.pod.command | list | `[]` | command for all pods. This is really not something we should expose and will be removed once we have a better option |
| launcher.useTemplates | bool | `false` | whether to render and use templates in the job launching process |
| launcherPem | string | `""` | An inline launcher.pem key. If not provided, one will be auto-generated. See README for more details. |
Expand Down
3 changes: 3 additions & 0 deletions charts/rstudio-workbench/ci/launcher-template-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ launcher:
volumeMounts:
- name: test
mountPath: /tmp/mnt
env:
- name: SOME_ENV_VAR
value: the-env-var-value
securityContext:
runAsUser: 999
defaultSecurityContext:
Expand Down
4 changes: 2 additions & 2 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
# DO NOT MODIFY the "Version: " key
# Helm Version: v2
# Helm Version: v3
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -209,7 +209,7 @@ spec:
name: {{ get . "secret" }}
key: {{ get . "key" }}
{{- end }}
{{- if .Values.pod.env }}
{{- if $templateData.pod.env }}
{{- toYaml $templateData.pod.env | nindent 12 }}
{{- end }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-workbench/files/service.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version: 2.3.1
# DO NOT MODIFY the "Version: " key
# Helm Version: v2
# Helm Version: v3
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: v1
kind: Service
Expand Down
12 changes: 6 additions & 6 deletions charts/rstudio-workbench/snapshot/complex-values.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,12 @@ spec:
mountPath: "/startup/user-provisioning"
- name: rstudio-custom-startup
mountPath: "/startup/custom"
- name: rstudio-pam
mountPath: "/etc/pam.d/pam-example"
subPath: "pam-example"
- name: rstudio-pam
mountPath: "/etc/pam.d/pam-example-2"
subPath: "pam-example-2"
- name: rstudio-pam
mountPath: "/etc/pam.d/pam-example"
subPath: "pam-example"

- name: rstudio-job-overrides-old
mountPath: "/mnt/job-json-overrides"
Expand Down Expand Up @@ -1029,12 +1029,12 @@ spec:
mountPath: "/startup/user-provisioning"
- name: rstudio-custom-startup
mountPath: "/startup/custom"
- name: rstudio-pam
mountPath: "/etc/pam.d/pam-example"
subPath: "pam-example"
- name: rstudio-pam
mountPath: "/etc/pam.d/pam-example-2"
subPath: "pam-example-2"
- name: rstudio-pam
mountPath: "/etc/pam.d/pam-example"
subPath: "pam-example"

- name: rstudio-job-overrides-old
mountPath: "/mnt/job-json-overrides"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ metadata:
data:
rstudio-library-templates-data.tpl: |
{{- define "rstudio-library.templates.data" -}}
{"job":{"annotations":{"seven":"eight"},"labels":{"nine":"ten"}},"pod":{"affinity":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"kubernetes.azure.com/scalesetpriority","operator":"In","values":["spot"]}]}]}}},"annotations":{"one":"two"},"command":[],"containerSecurityContext":{"privileged":false},"defaultSecurityContext":{"fsGroupChangePolicy":"Always","runAsGroup":999},"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[],"labels":{"three":"four"},"nodeSelector":{},"securityContext":{"runAsUser":999},"serviceAccountName":"test","tolerations":[{"effect":"NoSchedule","key":"kubernetes.azure.com/scalesetpriority","operator":"Equal","value":"spot"}],"volumeMounts":[{"mountPath":"/tmp/mnt","name":"test"},{"mountPath":"/mnt/session-configmap/rstudio","name":"session-config"},{"mountPath":"/mnt/session-secret/","name":"session-secret"}],"volumes":[{"emptyDir":{},"name":"test"},{"configMap":{"defaultMode":420,"name":"release-name-rstudio-workbench-session"},"name":"session-config"},{"name":"session-secret","secret":{"defaultMode":272,"secretName":"release-name-rstudio-workbench-session-secret"}}]},"service":{"annotations":{"five":"six"},"labels":{},"type":"ClusterIP"}}
{"job":{"annotations":{"seven":"eight"},"labels":{"nine":"ten"}},"pod":{"affinity":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"kubernetes.azure.com/scalesetpriority","operator":"In","values":["spot"]}]}]}}},"annotations":{"one":"two"},"command":[],"containerSecurityContext":{"privileged":false},"defaultSecurityContext":{"fsGroupChangePolicy":"Always","runAsGroup":999},"env":[{"name":"SOME_ENV_VAR","value":"the-env-var-value"}],"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[],"labels":{"three":"four"},"nodeSelector":{},"securityContext":{"runAsUser":999},"serviceAccountName":"test","tolerations":[{"effect":"NoSchedule","key":"kubernetes.azure.com/scalesetpriority","operator":"Equal","value":"spot"}],"volumeMounts":[{"mountPath":"/tmp/mnt","name":"test"},{"mountPath":"/mnt/session-configmap/rstudio","name":"session-config"},{"mountPath":"/mnt/session-secret/","name":"session-secret"}],"volumes":[{"emptyDir":{},"name":"test"},{"configMap":{"defaultMode":420,"name":"release-name-rstudio-workbench-session"},"name":"session-config"},{"name":"session-secret","secret":{"defaultMode":272,"secretName":"release-name-rstudio-workbench-session-secret"}}]},"service":{"annotations":{"five":"six"},"labels":{},"type":"ClusterIP"}}
{{- end }}
job.tpl: |
# Version: 2.3.1
# DO NOT MODIFY the "Version: " key
# Helm Version: v2
# Helm Version: v3
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -356,7 +356,7 @@ data:
name: {{ get . "secret" }}
key: {{ get . "key" }}
{{- end }}
{{- if .Values.pod.env }}
{{- if $templateData.pod.env }}
{{- toYaml $templateData.pod.env | nindent 12 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -431,7 +431,7 @@ data:
service.tpl: |
# Version: 2.3.1
# DO NOT MODIFY the "Version: " key
# Helm Version: v2
# Helm Version: v3
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -859,7 +859,7 @@ spec:
template:
metadata:
annotations:
checksum/config-general: 55198bf3cd0c9395996d79d9d808358acf5cdc61d77ee8e4d4627d0967794601
checksum/config-general: 61ebdf4aaea69d39d94c8360f8ef39c65b689bf8c05916942325176c4b6dbbf3
checksum/config-graphite: 9e9249a6820fceccee72ec5c0811fe22cc8a91eabd085164826ff92b3d693b36
checksum/config-prestart: 88c121990a2291900c2e9e4dda1cecda9614a767ee6c6c05068bcadd0f8e97e9
checksum/config-secret: 430b73ff69335b3048f037da394321b8a5f15f7e6415d51cbaab07cf99039fed
Expand Down
1 change: 1 addition & 0 deletions charts/rstudio-workbench/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ launcher:
serviceAccountName: ""
volumes: []
volumeMounts: []
env: []
imagePullPolicy: ""
imagePullSecrets: []
initContainers: []
Expand Down
Loading
Loading