From 93d3d8f00c0d8a9f5b8b9f1f40f859ccb5defdcf Mon Sep 17 00:00:00 2001 From: Tino Kraan Date: Fri, 23 Aug 2024 12:33:41 +0200 Subject: [PATCH 1/5] added optional resources to default initContainer --- charts/rstudio-connect/templates/configmap.yaml | 3 ++- charts/rstudio-connect/values.yaml | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/charts/rstudio-connect/templates/configmap.yaml b/charts/rstudio-connect/templates/configmap.yaml index bb14f55f..5dcab04d 100644 --- a/charts/rstudio-connect/templates/configmap.yaml +++ b/charts/rstudio-connect/templates/configmap.yaml @@ -23,9 +23,10 @@ data: {{- $initContainerImageTag := .Values.launcher.defaultInitContainer.tag | default (printf "%s%s" .Values.launcher.defaultInitContainer.tagPrefix $defaultVersion )}} {{- $initContainerImage := print .Values.launcher.defaultInitContainer.repository ":" ( $initContainerImageTag ) }} {{- $initContainerPullPolicy := default "IfNotPresent" .Values.launcher.defaultInitContainer.imagePullPolicy }} + {{- $initContainerResources := .Values.launcher.defaultInitContainer.resources }} {{- $initContainerSecurityContext := .Values.launcher.defaultInitContainer.securityContext }} {{- $initContainerVolumeMount := dict "name" ("rsc-volume") "mountPath" ("/mnt/rstudio-connect-runtime/") }} - {{- $initContainerJson := dict "name" ("init") "image" ($initContainerImage) "imagePullPolicy" ($initContainerPullPolicy) "volumeMounts" ( list $initContainerVolumeMount ) "securityContext" $initContainerSecurityContext }} + {{- $initContainerJson := dict "name" ("init") "image" ($initContainerImage) "imagePullPolicy" ($initContainerPullPolicy) "resources" ($initContainerResources) "volumeMounts" ( list $initContainerVolumeMount ) "securityContext" $initContainerSecurityContext }} {{- $jobJsonInitContainer := dict "target" ("/spec/template/spec/initContainers/0") "name" ("defaultInitContainer") "json" $initContainerJson }} {{- /* set up job-json defaults */ -}} {{- $jobJsonDefaults := list }} diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 63ab267b..10a3316d 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -325,6 +325,14 @@ launcher: tag: "" # -- The imagePullPolicy for the default initContainer imagePullPolicy: "" + # -- Optional resources for the default initContainer + resources: {} + # requests: + # cpu: "128m" + # memory: "128Mi" + # limits: + # cpu: "512m" + # memory: "512Mi" # -- The securityContext for the default initContainer securityContext: {} @@ -371,4 +379,4 @@ config: AccessLog: STDOUT AccessLogFormat: COMMON # COMMON, COMBINED, or JSON Metrics: - Enabled: true + Enabled: true \ No newline at end of file From bcff3ed0d6cf7a77aa540e93bce5e6b88fb02aae Mon Sep 17 00:00:00 2001 From: Sam Cofer Date: Thu, 5 Sep 2024 15:30:59 -0500 Subject: [PATCH 2/5] Add hostAliases to the main Connect pod and content pods --- charts/rstudio-connect/files/job.tpl | 4 ++++ charts/rstudio-connect/templates/deployment.yaml | 4 ++++ charts/rstudio-connect/values.yaml | 3 +++ 3 files changed, 11 insertions(+) diff --git a/charts/rstudio-connect/files/job.tpl b/charts/rstudio-connect/files/job.tpl index c8279a75..60a694fb 100644 --- a/charts/rstudio-connect/files/job.tpl +++ b/charts/rstudio-connect/files/job.tpl @@ -78,6 +78,10 @@ spec: {{- if or $templateData.pod.serviceAccountName .Job.serviceAccountName }} serviceAccountName: {{ .Job.serviceAccountName | default $templateData.pod.serviceAccountName | quote }} {{- end }} + {{- with $templateData.pod.hostAliases }} + hostAliases: + {{- toYaml . | nindent 8 }} + {{- end }} shareProcessNamespace: {{ .Job.shareProcessNamespace }} {{- if or (ne (len .Job.volumes) 0) (ne (len $templateData.pod.volumes) 0) }} volumes: diff --git a/charts/rstudio-connect/templates/deployment.yaml b/charts/rstudio-connect/templates/deployment.yaml index 2668e8ba..d86f080d 100644 --- a/charts/rstudio-connect/templates/deployment.yaml +++ b/charts/rstudio-connect/templates/deployment.yaml @@ -46,6 +46,10 @@ spec: affinity: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.pod.hostAliases }} + hostAliases: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 63ab267b..9549545d 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -127,6 +127,8 @@ pod: port: 3939 # -- The termination grace period seconds allowed for the pod before shutdown terminationGracePeriodSeconds: 120 + # -- Array of hostnames to supply to the main pod + hostAliases: [] # -- The pod's run command. By default, it uses the container's default command: [] @@ -307,6 +309,7 @@ launcher: tolerations: [] affinity: {} nodeSelector: {} + hostAliases: [] priorityClassName: "" # -- command for all pods. This is really not something we should expose and will be removed once we have a better option command: [] From c07067d0bc0e2176102cd692f4708eab05e0ac2c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 5 Sep 2024 20:35:25 +0000 Subject: [PATCH 3/5] Update helm-docs and README.md --- charts/rstudio-connect/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/rstudio-connect/README.md b/charts/rstudio-connect/README.md index ada463a0..b7355ac1 100644 --- a/charts/rstudio-connect/README.md +++ b/charts/rstudio-connect/README.md @@ -179,7 +179,7 @@ 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":{},"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 Posit Connect session templating process | +| launcher.templateValues | object | `{"job":{"annotations":{},"labels":{}},"pod":{"affinity":{},"annotations":{},"command":[],"containerSecurityContext":{},"defaultSecurityContext":{},"env":[],"extraContainers":[],"hostAliases":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[],"labels":{},"nodeSelector":{},"priorityClassName":"","securityContext":{},"serviceAccountName":"","tolerations":[],"volumeMounts":[],"volumes":[]},"service":{"annotations":{},"labels":{},"type":"ClusterIP"}}` | Values to pass along to the Posit 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 | @@ -197,6 +197,7 @@ The Helm `config` values are converted into the `rstudio-connect.gcfg` service c | pod.annotations | object | `{}` | Additional annotations to add to the rstudio-connect pods | | pod.env | list | `[]` | An array of maps that is injected as-is into the "env:" component of the pod.container spec | | pod.haste | bool | `true` | A helper that defines the RSTUDIO_CONNECT_HASTE environment variable | +| pod.hostAliases | list | `[]` | Array of hostnames to supply to the main pod | | pod.labels | object | `{}` | Additional labels to add to the rstudio-connect pods | | pod.port | int | `3939` | The containerPort used by the main pod container | | pod.securityContext | object | `{}` | Values to set the `securityContext` for the connect pod | From f79295bf5c70f3e9a03e1636fe75b0cc7bc8cca4 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Tue, 10 Sep 2024 13:54:10 -0400 Subject: [PATCH 4/5] Add launcher initContainer resource requests and limits for Connect --- charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-connect/NEWS.md | 5 +++++ charts/rstudio-connect/values.yaml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index 6705a487..4b371778 100644 --- a/charts/rstudio-connect/Chart.yaml +++ b/charts/rstudio-connect/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-connect description: Official Helm chart for Posit Connect -version: 0.7.6 +version: 0.7.7 apiVersion: v2 appVersion: 2024.08.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index f7d20fa6..3ee0e075 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,5 +1,10 @@ # Changelog +## 0.7.7 + +- Add helm values for `pod.hostAliases` and `launcher.templateValues.pod.hostAliases` +- Add helm values for `launcher.defaultInitContainer.resources` + ## 0.7.6 - Bump Connect version to 2024.08.0 diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 5a6dc80d..dc681601 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -382,4 +382,4 @@ config: AccessLog: STDOUT AccessLogFormat: COMMON # COMMON, COMBINED, or JSON Metrics: - Enabled: true \ No newline at end of file + Enabled: true From b06007af566523c27f24165f3c8e7f6f63a7d0b1 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 10 Sep 2024 17:55:17 +0000 Subject: [PATCH 5/5] Update helm-docs and README.md --- charts/rstudio-connect/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/rstudio-connect/README.md b/charts/rstudio-connect/README.md index b7355ac1..f1fc2603 100644 --- a/charts/rstudio-connect/README.md +++ b/charts/rstudio-connect/README.md @@ -1,6 +1,6 @@ # Posit Connect -![Version: 0.7.6](https://img.shields.io/badge/Version-0.7.6-informational?style=flat-square) ![AppVersion: 2024.08.0](https://img.shields.io/badge/AppVersion-2024.08.0-informational?style=flat-square) +![Version: 0.7.7](https://img.shields.io/badge/Version-0.7.7-informational?style=flat-square) ![AppVersion: 2024.08.0](https://img.shields.io/badge/AppVersion-2024.08.0-informational?style=flat-square) #### _Official Helm chart for Posit Connect_ @@ -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.6: +To install the chart with the release name `my-release` at version 0.7.7: ```{.bash} helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.6 +helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.7 ``` To explore other chart versions, look at: @@ -166,10 +166,11 @@ The Helm `config` values are converted into the `rstudio-connect.gcfg` service c | initContainers | bool | `false` | The initContainer spec that will be used verbatim | | launcher.additionalRuntimeImages | list | `[]` | Optional. Additional images to append to the end of the "launcher.customRuntimeYaml" (in the "images" key). If `customRuntimeYaml` is a "map", then "additionalRuntimeImages" will only be used if it is a "list". | | launcher.customRuntimeYaml | string | `"base"` | Optional. The runtime.yaml definition of Kubernetes runtime containers. Defaults to "base", which pulls in the default runtime.yaml file. If changing this value, be careful to include the images that you have already used. If set to "pro", will pull in the "pro" versions of the default runtime images (i.e. including the pro drivers at the cost of a larger image). Starting with Connect v2023.05.0, this configuration is used to bootstrap the initial set of execution environments the first time the server starts. If any execution environments already exist in the database, these values are ignored; execution environments are not created or modified during subsequent restarts. | -| launcher.defaultInitContainer | object | `{"enabled":true,"imagePullPolicy":"","repository":"ghcr.io/rstudio/rstudio-connect-content-init","securityContext":{},"tag":"","tagPrefix":"ubuntu2204-"}` | Image definition for the default Posit Connect Content InitContainer | +| launcher.defaultInitContainer | object | `{"enabled":true,"imagePullPolicy":"","repository":"ghcr.io/rstudio/rstudio-connect-content-init","resources":{},"securityContext":{},"tag":"","tagPrefix":"ubuntu2204-"}` | Image definition for the default Posit Connect Content InitContainer | | launcher.defaultInitContainer.enabled | bool | `true` | Whether to enable the defaultInitContainer. If disabled, you must ensure that the session components are available another way. | | launcher.defaultInitContainer.imagePullPolicy | string | `""` | The imagePullPolicy for the default initContainer | | launcher.defaultInitContainer.repository | string | `"ghcr.io/rstudio/rstudio-connect-content-init"` | The repository to use for the Content InitContainer image | +| launcher.defaultInitContainer.resources | object | `{}` | Optional resources for the default initContainer | | launcher.defaultInitContainer.securityContext | object | `{}` | The securityContext for the default initContainer | | launcher.defaultInitContainer.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | | launcher.defaultInitContainer.tagPrefix | string | `"ubuntu2204-"` | A tag prefix for the Content InitContainer image (common selections: jammy-, ubuntu2204-). Only used if tag is not defined |