rstudio / helm

Helm Resources for RStudio Products
MIT License
36 stars 28 forks source link

added optional resources to default initContainer #542

Closed tkraan closed 2 months ago

tkraan commented 3 months ago

Closes #541

dbkegley commented 2 months ago

@tkraan thank you for contributing! I've confirmed on your branch that the resources are present in the rendered templates:

david@ubuntu:helm [kegs-init-container●] » helm template ./charts/rstudio-connect --set launcher.enabled=true --set sharedStorage.create=true --show-only templates/configmap.yaml | grep -A 3 rstudio-library-templates-data.tpl
  rstudio-library-templates-data.tpl: |
    {{- define "rstudio-library.templates.data" -}}
    {"job":{"annotations":{},"labels":{}},"pod":{"affinity":{},"annotations":{},"command":[],"containerSecurityContext":{},"defaultSecurityContext":{},"env":[],"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[{"image":"ghcr.io/rstudio/rstudio-connect-content-init:ubuntu2204-2024.08.0","imagePullPolicy":"IfNotPresent","name":"init","resources":{},"securityContext":{},"volumeMounts":[{"mountPath":"/mnt/rstudio-connect-runtime/","name":"rsc-volume"}]}],"labels":{},"nodeSelector":{},"priorityClassName":"","securityContext":{},"serviceAccountName":"","tolerations":[],"volumeMounts":[{"mountPath":"/opt/rstudio-connect","name":"rsc-volume"}],"volumes":[{"emptydir":{},"name":"rsc-volume"}]},"service":{"annotations":{},"labels":{},"type":"ClusterIP"}}
    {{- end }}
david@ubuntu:helm [kegs-init-container●] » helm template ./charts/rstudio-connect --set launcher.enabled=true --set sharedStorage.create=true --set launcher.defaultInitContainer.resources.requests.cpu="512Mi" --show-only templates/configmap.yaml | grep -A 3 rstudio-library-templates-data.tpl
  rstudio-library-templates-data.tpl: |
    {{- define "rstudio-library.templates.data" -}}
    {"job":{"annotations":{},"labels":{}},"pod":{"affinity":{},"annotations":{},"command":[],"containerSecurityContext":{},"defaultSecurityContext":{},"env":[],"extraContainers":[],"imagePullPolicy":"","imagePullSecrets":[],"initContainers":[{"image":"ghcr.io/rstudio/rstudio-connect-content-init:ubuntu2204-2024.08.0","imagePullPolicy":"IfNotPresent","name":"init","resources":{"requests":{"cpu":"512Mi"}},"securityContext":{},"volumeMounts":[{"mountPath":"/mnt/rstudio-connect-runtime/","name":"rsc-volume"}]}],"labels":{},"nodeSelector":{},"priorityClassName":"","securityContext":{},"serviceAccountName":"","tolerations":[],"volumeMounts":[{"mountPath":"/opt/rstudio-connect","name":"rsc-volume"}],"volumes":[{"emptydir":{},"name":"rsc-volume"}]},"service":{"annotations":{},"labels":{},"type":"ClusterIP"}}
    {{- end }}

We will also need to bump the chart's minor version and add an entry to the NEWS.

https://github.com/rstudio/helm/blob/853fc9fbf633dbe985d2e526e27bcd2dcd93a1d7/charts/rstudio-connect/Chart.yaml#L3

https://github.com/rstudio/helm/blob/main/charts/rstudio-connect/NEWS.md

@colearendt would appreciate an extra pair of eyes to make sure I didn't miss anything.

dbkegley commented 2 months ago

@tkraan I'm going to pull this branch into #545 and bump the chart version in that PR

dbkegley commented 2 months ago

closing in favor of https://github.com/rstudio/helm/pull/545