Skip to content

Commit

Permalink
update values definitions to make adminPort configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
colearendt committed Jul 29, 2023
1 parent ecbfb8e commit 3165ec2
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion charts/postgrest/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: postgrest
description: A Helm chart for deploying Postgrest to Kubernetes
type: application
version: 0.3.3
version: 0.3.4
appVersion: v11.1.0
icon: https://avatars.githubusercontent.com/u/15115011?s=200&v=4
maintainers:
Expand Down
7 changes: 7 additions & 0 deletions charts/postgrest/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.3.4

- Add configuration for the `pod.adminPort` and `service.adminPort`
- `pod.adminPort` controls the PostgREST config and deployment
- `serivce.adminPort` controls the exposure of the health check to the service definition
- Update the `readinessProbe` to use the admin health-check

# 0.3.3

- Bump PostgREST version to v11.1.0
Expand Down
13 changes: 6 additions & 7 deletions charts/postgrest/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# postgrest

![Version: 0.3.3](https://img.shields.io/badge/Version-0.3.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v11.1.0](https://img.shields.io/badge/AppVersion-v11.1.0-informational?style=flat-square)
![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v11.1.0](https://img.shields.io/badge/AppVersion-v11.1.0-informational?style=flat-square)

## Installing the Chart

To install the chart with the release name `my-release` at version 0.3.3:
To install the chart with the release name `my-release` at version 0.3.4:

```bash
helm repo add colearendt https://colearendt.github.io/helm
helm install my-release colearendt/postgrest --version=0.3.3
helm install my-release colearendt/postgrest --version=0.3.4
```

#### _A Helm chart for deploying Postgrest to Kubernetes_
Expand Down Expand Up @@ -40,14 +40,12 @@ helm install my-release colearendt/postgrest --version=0.3.3
| initContainers | object | `{}` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| pod.adminPort | int | `9001` | The admin server port for PostgREST. Automatically sets the adminServerPort configuration value. |
| pod.annotations | object | `{}` | |
| pod.containerPort | int | `9000` | |
| pod.env | list | `[]` | |
| pod.livenessProbe | object | `{}` | |
| pod.readinessProbe.httpGet.path | string | `"/"` | |
| pod.readinessProbe.httpGet.port | string | `"http"` | |
| pod.readinessProbe.initialDelaySeconds | int | `5` | |
| pod.readinessProbe.periodSeconds | int | `5` | |
| pod.readinessProbe | object | `{"httpGet":{"path":"/ready","port":"http-admin"},"initialDelaySeconds":5,"periodSeconds":5}` | The readiness probe for PostgREST. Can also use requests to /live per https://postgrest.org/en/stable/references/admin.html#health-check |
| pod.securityContext | object | `{}` | |
| pod.startupProbe | object | `{}` | |
| pod.volumeMounts | list | `[]` | |
Expand Down Expand Up @@ -75,6 +73,7 @@ helm install my-release colearendt/postgrest --version=0.3.3
| resources | object | `{}` | |
| secret | object | `{}` | |
| securityContext | object | `{}` | |
| service.adminPort | int | `9001` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
Expand Down
8 changes: 0 additions & 8 deletions charts/postgrest/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,3 @@ Usage:
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

{{/*
Set the value of PGRST_ADMIN_SERVER_PORT to a fixed port.
*/}}
{{- define "postgrest.adminPort" -}}
9001
{{- end }}

16 changes: 9 additions & 7 deletions charts/postgrest/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,26 @@ spec:
- name: PGRST_RAW_MEDIA_TYPES
value: {{ .Values.postgrest.rawMediaTypes }}
{{- end }}
{{- if .Values.pod.adminPort }}
- name: PGRST_ADMIN_SERVER_PORT
value: {{ include "postgrest.adminPort" . | quote }}
value: {{ .Values.pod.adminPort | quote }}
{{- end }}
{{- if .Values.pod.env }}
{{- toYaml .Values.pod.env | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.pod.containerPort }}
protocol: TCP
{{- if .Values.pod.adminPort }}
- name: http-admin
containerPort: {{ include "postgrest.adminPort" . }}
containerPort: {{ .Values.pod.adminPort }}
protocol: TCP
{{- end }}
{{- with .Values.pod.readinessProbe }}
readinessProbe:
httpGet:
path: /live
port: http-admin
initialDelaySeconds: 5
periodSeconds: 5
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.pod.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/postgrest/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if .Values.postgrest.adminServerPort }}
- port: {{ include "postgrest.adminPort" . }}
{{- if .Values.service.adminPort }}
- port: {{ .Values.service.adminPort }}
targetPort: http-admin
protocol: TCP
name: http-admin
Expand Down
13 changes: 12 additions & 1 deletion charts/postgrest/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ postgrest:
preRequest: ""
rootSpec: ""
rawMediaTypes: ""
# NOTE: adminServerPort is set via pod.adminPort and service.adminPort

secret: {}

Expand All @@ -74,16 +75,26 @@ securityContext: {}
pod:
annotations: {}
containerPort: 9000
# -- The admin server port for PostgREST. Automatically sets the adminServerPort configuration value.
adminPort: 9001
env: []
# -- The readiness probe for PostgREST. Can also use requests to /live per https://postgrest.org/en/stable/references/admin.html#health-check
readinessProbe:
httpGet:
path: /ready
port: http-admin
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe: {}
startupProbe: {}
volumes: []
volumeMounts: []
securityContext: {}

service:
type: ClusterIP
port: 80
adminPort: 9001

ingress:
enabled: false
Expand Down

0 comments on commit 3165ec2

Please sign in to comment.