Skip to content

Commit

Permalink
Merge pull request #59 from colearendt/enable-admin-port
Browse files Browse the repository at this point in the history
Enable admin port
  • Loading branch information
colearendt authored Jul 29, 2023
2 parents f80a76e + 3165ec2 commit bbd89b6
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 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
9 changes: 9 additions & 0 deletions charts/postgrest/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,22 @@ spec:
- name: PGRST_RAW_MEDIA_TYPES
value: {{ .Values.postgrest.rawMediaTypes }}
{{- end }}
{{- if .Values.pod.adminPort }}
- name: PGRST_ADMIN_SERVER_PORT
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: {{ .Values.pod.adminPort }}
protocol: TCP
{{- end }}
{{- with .Values.pod.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/postgrest/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if .Values.service.adminPort }}
- port: {{ .Values.service.adminPort }}
targetPort: http-admin
protocol: TCP
name: http-admin
{{- end }}
selector:
{{- include "postgrest.selectorLabels" . | nindent 4 }}
9 changes: 7 additions & 2 deletions 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,11 +75,14 @@ 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: /
port: http
path: /ready
port: http-admin
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe: {}
Expand All @@ -90,6 +94,7 @@ pod:
service:
type: ClusterIP
port: 80
adminPort: 9001

ingress:
enabled: false
Expand Down

0 comments on commit bbd89b6

Please sign in to comment.