Skip to content

Commit

Permalink
Merge pull request #545 from rstudio/hostAliases-addition
Browse files Browse the repository at this point in the history
Add hostAliases to the main Connect pod and content pods
  • Loading branch information
dbkegley committed Sep 10, 2024
2 parents 5960d10 + b06007a commit df13444
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 7 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.6
version: 0.7.7
apiVersion: v2
appVersion: 2024.08.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,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
Expand Down
12 changes: 7 additions & 5 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.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_

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.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:
Expand Down Expand Up @@ -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 |
Expand All @@ -179,7 +180,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 |
Expand All @@ -197,6 +198,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 |
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-connect/files/job.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion charts/rstudio-connect/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-connect/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/rstudio-connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand All @@ -325,6 +328,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: {}

Expand Down

0 comments on commit df13444

Please sign in to comment.