Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPM: implement service.targetPort as configurable #648

Merged
merged 10 commits into from
Mar 27, 2025
2 changes: 1 addition & 1 deletion charts/rstudio-pm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rstudio-pm
description: Official Helm chart for Posit Package Manager
version: 0.5.44
version: 0.5.45
apiVersion: v2
appVersion: 2024.11.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-pm/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.5.45

- Allow value for `service.targetPort`

## 0.5.44

- Set `enableMigration: false` to by default disable the migration job because it is not needed for new installations and is only needed if you update from a Package Manager version that is 3+ years old. If you are upgrading from a Package Manager version that does run as root, you can enable the migration job by setting `enableMigration: true`.
Expand Down
7 changes: 4 additions & 3 deletions charts/rstudio-pm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Posit Package Manager

![Version: 0.5.44](https://img.shields.io/badge/Version-0.5.44-informational?style=flat-square) ![AppVersion: 2024.11.0](https://img.shields.io/badge/AppVersion-2024.11.0-informational?style=flat-square)
![Version: 0.5.45](https://img.shields.io/badge/Version-0.5.45-informational?style=flat-square) ![AppVersion: 2024.11.0](https://img.shields.io/badge/AppVersion-2024.11.0-informational?style=flat-square)

#### _Official Helm chart for Posit Package Manager_

Expand All @@ -24,11 +24,11 @@ To ensure a stable production deployment:

## Installing the chart

To install the chart with the release name `my-release` at version 0.5.44:
To install the chart with the release name `my-release` at version 0.5.45:

```{.bash}
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-pm --version=0.5.44
helm upgrade --install my-release rstudio/rstudio-pm --version=0.5.45
```

To explore other chart versions, look at:
Expand Down Expand Up @@ -251,6 +251,7 @@ The Helm `config` values are converted into the `rstudio-pm.gcfg` service config
| 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 Service port. This is the port your service will run under. |
| service.targetPort | int | `4242` | The port to forward to on the Package Manager pod. Also see pod.port |
| 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) |
| serviceAccount.annotations | object | `{}` | Annotations for the ServiceAccount, if any |
| serviceAccount.create | bool | `true` | Whether to create a [Service Account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) |
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-pm/templates/svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
targetPort: 4242
targetPort: {{ .Values.service.targetPort }}
{{- if .Values.config.Metrics.Enabled }}
- name: metrics
port: 2112
Expand Down
2 changes: 2 additions & 0 deletions charts/rstudio-pm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ service:
nodePort: false
# -- The Service port. This is the port your service will run under.
port: 80
# -- The port to forward to on the Package Manager pod. Also see pod.port
targetPort: 4242
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides service.targetPort and pod.port, there are a bunch of other 4242 references in the values, like the config.HTTP.Listen = :4242 setting, liveness/startup probe. I assume users would have to find-and-replace all 4242 references manually to fully change the running port?

Is it possible to use a template variable here so you only have to set 4242 once somewhere?

Otherwise this is fine of course, as it's still better than what we had before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @glin !

I created #652 to capture this. I'd like to see us do this across all three products to be consistent.


# -- replicas is the number of replica pods to maintain for this service
replicas: 1
Expand Down