From edf1ad785e50d2bb4ebcc2adf6db5e0d19fd12e1 Mon Sep 17 00:00:00 2001 From: Trevor Nederlof Date: Wed, 6 Mar 2024 09:42:27 -0500 Subject: [PATCH 1/8] connect: Use ClusterIP service by default instead of NodePort --- charts/rstudio-connect/values.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 3c42dafd..2b091509 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -88,8 +88,9 @@ strategy: service: # -- Annotations that will be added onto the service annotations: {} - # -- The service type (LoadBalancer, NodePort, etc.) - type: NodePort + # -- The service type, usually ClusterIP (in-cluster only) or LoadBalancer (to + # expose the service using your cloud provider's load balancer) + type: ClusterIP # -- The nodePort to use when using service type NodePort. If not provided, Kubernetes will provide one automatically nodePort: false # -- The port to use for the Connect service From 11d47e033ac91c3256f01a31019cd918a1d6ed49 Mon Sep 17 00:00:00 2001 From: Trevor Nederlof Date: Wed, 6 Mar 2024 09:42:58 -0500 Subject: [PATCH 2/8] connect: update docs for service.nodePort for consistency --- charts/rstudio-connect/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 2b091509..06445aa1 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -91,7 +91,8 @@ service: # -- The service type, usually ClusterIP (in-cluster only) or LoadBalancer (to # expose the service using your cloud provider's load balancer) type: ClusterIP - # -- The nodePort to use when using service type NodePort. If not provided, Kubernetes will provide one automatically + # -- The explicit nodePort to use for `service.type` NodePort. If not + # provided, Kubernetes will choose one automatically nodePort: false # -- The port to use for the Connect service port: 80 From 8632da99a0c6cc4096a274c36986bece0e6a66ff Mon Sep 17 00:00:00 2001 From: Trevor Nederlof Date: Wed, 6 Mar 2024 09:44:08 -0500 Subject: [PATCH 3/8] connect: Add support for controlling loadBalancerIP and clusterIP --- charts/rstudio-connect/templates/svc.yaml | 6 ++++++ charts/rstudio-connect/values.yaml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/charts/rstudio-connect/templates/svc.yaml b/charts/rstudio-connect/templates/svc.yaml index 34fff7f1..759b282e 100644 --- a/charts/rstudio-connect/templates/svc.yaml +++ b/charts/rstudio-connect/templates/svc.yaml @@ -10,6 +10,12 @@ metadata: {{ include "rstudio-connect.annotations" . | indent 4 }} spec: type: {{ .Values.service.type }} +{{- if and (eq .Values.service.type "ClusterIP") .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} +{{- end }} +{{- if and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} selector: {{- include "rstudio-connect.selectorLabels" . | nindent 4 }} ports: diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 06445aa1..440ee8f9 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -91,6 +91,11 @@ service: # -- The service type, usually ClusterIP (in-cluster only) or LoadBalancer (to # expose the service using your cloud provider's load balancer) type: ClusterIP + # -- The cluster-internal IP to use with `service.type` ClusterIP + clusterIP: "" + # -- The external IP to use with `service.type` LoadBalancer, when supported + # by the cloud provider + loadBalancerIP: "" # -- The explicit nodePort to use for `service.type` NodePort. If not # provided, Kubernetes will choose one automatically nodePort: false From 38a91d2e496beae39e48e2b15af8a6ad36191595 Mon Sep 17 00:00:00 2001 From: Trevor Nederlof Date: Wed, 6 Mar 2024 09:45:06 -0500 Subject: [PATCH 4/8] connect: Ignore nodePort settings when the service type is not NodePort --- charts/rstudio-connect/templates/svc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/rstudio-connect/templates/svc.yaml b/charts/rstudio-connect/templates/svc.yaml index 759b282e..4246c9cb 100644 --- a/charts/rstudio-connect/templates/svc.yaml +++ b/charts/rstudio-connect/templates/svc.yaml @@ -22,9 +22,9 @@ spec: - name: http protocol: TCP port: {{ .Values.service.port }} - {{- if .Values.service.nodePort }} +{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }} nodePort: {{ .Values.service.nodePort }} - {{- end }} +{{- end }} targetPort: {{ .Values.service.targetPort }} {{- if .Values.prometheusExporter.enabled }} - name: metrics From 3c3d2150c443832fca8d6fe3ac162f62f2914943 Mon Sep 17 00:00:00 2001 From: Trevor Nederlof Date: Wed, 6 Mar 2024 09:46:28 -0500 Subject: [PATCH 5/8] connect: Simplify handling of Service annotations --- charts/rstudio-connect/templates/_helpers.tpl | 6 ------ charts/rstudio-connect/templates/svc.yaml | 4 +++- charts/rstudio-connect/values.yaml | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/charts/rstudio-connect/templates/_helpers.tpl b/charts/rstudio-connect/templates/_helpers.tpl index 043e5e4c..4587e757 100644 --- a/charts/rstudio-connect/templates/_helpers.tpl +++ b/charts/rstudio-connect/templates/_helpers.tpl @@ -85,12 +85,6 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- include "rstudio-library.config.gcfg" ( mergeOverwrite $defaultConfig .Values.config ) }} {{- end -}} -{{- define "rstudio-connect.annotations" -}} -{{- range $key,$value := $.Values.service.annotations -}} -{{ $key }}: {{ $value | quote }} -{{ end }} -{{- end -}} - {{/* - Define the runtime.yaml file - If a string: diff --git a/charts/rstudio-connect/templates/svc.yaml b/charts/rstudio-connect/templates/svc.yaml index 4246c9cb..53ccfc0f 100644 --- a/charts/rstudio-connect/templates/svc.yaml +++ b/charts/rstudio-connect/templates/svc.yaml @@ -6,8 +6,10 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{- include "rstudio-connect.labels" . | nindent 4 }} +{{- with .Values.service.annotations }} annotations: -{{ include "rstudio-connect.annotations" . | indent 4 }} + {{- toYaml . | nindent 4 }} +{{- end }} spec: type: {{ .Values.service.type }} {{- if and (eq .Values.service.type "ClusterIP") .Values.service.clusterIP }} diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 440ee8f9..c63974f7 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -86,7 +86,7 @@ strategy: maxUnavailable: 0 service: - # -- Annotations that will be added onto the service + # -- Annotations for the service, for example to specify [an internal load balancer](https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer) annotations: {} # -- The service type, usually ClusterIP (in-cluster only) or LoadBalancer (to # expose the service using your cloud provider's load balancer) From 5dc86f6365147ffa872d15dd350dc58bb6464afb Mon Sep 17 00:00:00 2001 From: Trevor Nederlof Date: Wed, 6 Mar 2024 09:48:31 -0500 Subject: [PATCH 6/8] connect: Bump version to 0.6.0 and update NEWS --- charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-connect/NEWS.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index dc6ffc21..70787e70 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 RStudio Connect -version: 0.5.14 +version: 0.6.0 apiVersion: v2 appVersion: 2024.02.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 7d114cc0..c3eebf5e 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,3 +1,10 @@ +# 0.6.0 + +- BREAKING: The generated service will now have type `ClusterIP` by default. +- Add support for setting the `loadBalancerIP` or `clusterIP`. +- Ignore `nodePort` settings when the service is not a `NodePort`. +- Improve the documentation for some service-related settings. + # 0.5.14 - Bump Connect version to 2024.02.0 From 907927d41720a8957378cd54a54228ec1c9bff81 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 6 Mar 2024 15:05:00 +0000 Subject: [PATCH 7/8] Update helm-docs and README.md --- charts/rstudio-connect/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/charts/rstudio-connect/README.md b/charts/rstudio-connect/README.md index 645ae04c..2d169a55 100644 --- a/charts/rstudio-connect/README.md +++ b/charts/rstudio-connect/README.md @@ -1,6 +1,6 @@ # RStudio Connect -![Version: 0.5.14](https://img.shields.io/badge/Version-0.5.14-informational?style=flat-square) ![AppVersion: 2024.02.0](https://img.shields.io/badge/AppVersion-2024.02.0-informational?style=flat-square) +![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![AppVersion: 2024.02.0](https://img.shields.io/badge/AppVersion-2024.02.0-informational?style=flat-square) #### _Official Helm chart for RStudio Connect_ @@ -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.14: +To install the chart with the release name `my-release` at version 0.6.0: ```bash helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-connect --version=0.5.14 +helm upgrade --install my-release rstudio/rstudio-connect --version=0.6.0 ``` To explore other chart versions, take a look at: @@ -192,11 +192,13 @@ The Helm `config` values are converted into the `rstudio-connect.gcfg` service c | replicas | int | `1` | The number of replica pods to maintain for this service | | resources | object | `{}` | Defines resources for the rstudio-connect container | | securityContext | object | `{"privileged":true}` | Values to set the `securityContext` for Connect container. It must include "privileged: true" or "CAP_SYS_ADMIN" when launcher is not enabled. If launcher is enabled, this can be removed with `securityContext: null` | -| service.annotations | object | `{}` | Annotations that will be added onto the service | -| service.nodePort | bool | `false` | The nodePort to use when using service type NodePort. If not provided, Kubernetes will provide one automatically | +| service.annotations | object | `{}` | Annotations for the service, for example to specify [an internal load balancer](https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer) | +| service.clusterIP | string | `""` | The cluster-internal IP to use with `service.type` ClusterIP | +| service.loadBalancerIP | string | `""` | The external IP to use with `service.type` LoadBalancer, when supported by the cloud provider | +| service.nodePort | bool | `false` | The explicit nodePort to use for `service.type` NodePort. If not provided, Kubernetes will choose one automatically | | service.port | int | `80` | The port to use for the Connect service | | service.targetPort | int | `3939` | The port to forward to on the Connect pod. Also see pod.port | -| service.type | string | `"NodePort"` | The service type (LoadBalancer, NodePort, etc.) | +| service.type | string | `"ClusterIP"` | The service type, usually ClusterIP (in-cluster only) or LoadBalancer (to expose the service using your cloud provider's load balancer) | | serviceMonitor.additionalLabels | object | `{}` | additionalLabels normally includes the release name of the Prometheus Operator | | serviceMonitor.enabled | bool | `false` | Whether to create a ServiceMonitor CRD for use with a Prometheus Operator | | serviceMonitor.namespace | string | `""` | Namespace to create the ServiceMonitor in (usually the same as the one in which the Prometheus Operator is running). Defaults to the release namespace | From 300148b097674e90a2d2dfa5b29d20a8c405e780 Mon Sep 17 00:00:00 2001 From: Trevor Nederlof Date: Thu, 7 Mar 2024 12:17:39 -0500 Subject: [PATCH 8/8] Tweak language of NEWS --- charts/rstudio-connect/NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index c3eebf5e..a8916505 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,6 +1,6 @@ # 0.6.0 -- BREAKING: The generated service will now have type `ClusterIP` by default. +- BREAKING: The generated service will now have type `ClusterIP` set by default. - Add support for setting the `loadBalancerIP` or `clusterIP`. - Ignore `nodePort` settings when the service is not a `NodePort`. - Improve the documentation for some service-related settings.