Skip to content

Commit

Permalink
Merge pull request #478 from rstudio/tn-change-connect-service
Browse files Browse the repository at this point in the history
Change Connect default service.type and other service generation items
  • Loading branch information
atheriel authored Mar 7, 2024
2 parents 6a46a14 + 300148b commit 7bb32e0
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 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 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
Expand Down
7 changes: 7 additions & 0 deletions charts/rstudio-connect/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.6.0

- 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.

# 0.5.14

- Bump Connect version to 2024.02.0
Expand Down
14 changes: 8 additions & 6 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.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_

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.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:
Expand Down Expand Up @@ -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 |
Expand Down
6 changes: 0 additions & 6 deletions charts/rstudio-connect/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 11 additions & 3 deletions charts/rstudio-connect/templates/svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ 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 }}
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:
- 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
Expand Down
15 changes: 11 additions & 4 deletions charts/rstudio-connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,18 @@ 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 (LoadBalancer, NodePort, etc.)
type: NodePort
# -- The nodePort to use when using service type NodePort. If not provided, Kubernetes will provide one automatically
# -- 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
# -- The port to use for the Connect service
port: 80
Expand Down

0 comments on commit 7bb32e0

Please sign in to comment.